Commit graph

481 commits

Author SHA1 Message Date
Stu Grossman
968519095a * Makefile.in: Get rid of srcroot. Set all INSTALL macros via
autoconf.
	* gencode.c (write_opcodes):  Pad operands field to account for
	MSVC braindamage.
	* simops.c:  Include errno.h.  Exclude SYS_chown, since MSVC
	doesn't support it.  (Why is this here in the first place?!?)
	* v850_sim.h:  Get rid of 64 bit defs.  Also, get rid of #elif's.
	Change number of operands in struct simops from 9 to 6.  Define
	SIGTRAP and SIGQUIT for MSVC.
1996-10-24 17:39:30 +00:00
Michael Meissner
aeb1f26ba8 Provide better statistics, particularly for doing VLIW work; Fix ldb to correctly sign extend 1996-10-22 19:49:37 +00:00
Martin Hunt
eca43eb1f5 Mon Oct 21 16:16:26 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* interp.c (sim_resume): Change the way single-stepping and exceptions
 	are handled so single-stepping works again.
1996-10-21 23:17:43 +00:00
Michael Meissner
c7f6f3993c Add support for fsel 1996-10-18 16:22:35 +00:00
David Edelsohn
6cc77b01e7 * configure.in (--enable-sim-powerpc): Delete.
(--enable-sim): Add.
	* configure: Regenerated.
1996-10-17 20:11:31 +00:00
David Edelsohn
d9c0593f2a Add more m32r support. 1996-10-17 18:57:19 +00:00
Michael Meissner
55116079e2 Make simulated loads/stores faster on x86, AIX, and big endian hosts 1996-10-17 16:47:51 +00:00
Jeff Law
c929945aad Add missing v850 sanitization stuff. 1996-10-17 04:57:03 +00:00
Michael Meissner
d6fe5ca568 Make read/write memory functions inlined 1996-10-16 22:16:21 +00:00
Michael Meissner
5c2556697f Make read/write memory functions inlined 1996-10-16 22:14:23 +00:00
Michael Meissner
11ec4de669 Fix tracing of accumulators 1996-10-16 17:52:31 +00:00
Stu Grossman
254ef34062 * interp.c (MEM_SIZE): It's now bytes, not a power of 2.
* (map):  Add support for external mem in the 1->2 meg range.
	Also, abort() when memory access is way out of bounds.  (Better to
	die than to give wrong result.  (This will be fixed later.))
	* (sim_size):  MEM_SIZE is now bytes, not shift factor.
1996-10-15 23:23:00 +00:00
Michael Meissner
57bc1a721a Better error messages when a program stops due to signal; support d10v getpid/kill 1996-10-15 15:44:10 +00:00
Michael Meissner
8918b3a72b Fix ld2w r2,@r2 so that r3 loads the proper value 1996-10-13 02:25:01 +00:00
Jeff Law
aee4f36a89 * configure.in: Only build the V850 simulator if
we are using gcc.
        * configure: Rebuild.
So builds with "cc" don't die in the v850 simulator directory.
1996-10-12 03:14:54 +00:00
Jason Molenda
feede9b699 * Makefile.in (mostlyclean): Move config.log to distclean. 1996-10-03 07:16:56 +00:00
Jason Molenda
38e4433bfb * Makefile.in (clean): Remove config.log. 1996-10-02 07:57:18 +00:00
David Edelsohn
81ca9d3b3f m32r [work in progress] 1996-09-30 21:10:54 +00:00
Stu Grossman
88777ce2a6 * gencode.c (write_opcodes): Output hex values for opcode mask
and patterns.
	* interp.c (sim_resume):  Save and restore PC from the appropriate
	register.
	* (sim_fetch_register sim_store_register):  Fix byte-order problem
	with reading and writing registers.
	* simops.c (OP_FFFF):  Implement pseudo-breakpoint insn.
1996-09-28 01:38:45 +00:00
Jeff Law
da86a4fa81 * simops.c (trace_input): Fix thinko. 1996-09-27 23:41:12 +00:00
Jackie Smith Cashion
21cea5d45d Thu Sep 26 17:35:00 1996 James G. Smith <jsmith@cygnus.co.uk>
* interp.c (SignalException): Check for explicit terminating
 	breakpoint value.
	* gencode.c: Pass instruction value through SignalException()
 	calls for Trap, Breakpoint and Syscall.
1996-09-26 16:42:57 +00:00
Jackie Smith Cashion
617c07c61d Thu Sep 26 11:35:17 1996 James G. Smith <jsmith@cygnus.co.uk>
* interp.c (SquareRoot): Add HAVE_SQRT check to ensure sqrt() is
 	only used on those hosts that provide it.
	* configure.in: Add sqrt() to list of functions to be checked for.
	* config.in: Re-generated.
	* configure: Re-generated.
1996-09-26 10:39:34 +00:00
Michael Meissner
a18cb10038 Fix tracing for st2w 1996-09-25 20:33:21 +00:00
Martin Hunt
c58a1ec2aa Fri Sep 20 15:36:45 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* interp.c (sim_create_inferior): Reinitialize State every time
	sim_create_inferior() is called.
1996-09-20 22:39:45 +00:00
Ian Lance Taylor
149ee67274 * gencode.c (process_instructions): Call build_endian_shift when
expanding STORE RIGHT, to fix swr.
	* support.h (SIGNEXTEND): If the sign bit is not set, explicitly
	clear the high bits.
	* interp.c (Convert): Fix fmt_single to fmt_long to not truncate.
	Fix float to int conversions to produce signed values.
1996-09-20 19:49:49 +00:00
Michael Meissner
ed9714ab65 Lose doc directory until we DOS-ize it; Add doc/.Sanitize 1996-09-20 13:11:37 +00:00
Michael Meissner
183632b238 Add documentation files 1996-09-20 12:46:09 +00:00
Michael Meissner
fd96c1f320 PSIM 1996/9/19 update 1996-09-20 12:36:54 +00:00
Ian Lance Taylor
458e1f58e6 Fix multiplication, ldxc1, and floating point conversion. See ChangeLog. 1996-09-20 03:07:43 +00:00
Michael Meissner
c12f5c678e Make sure cmp{,eq,u}i use correct casts 1996-09-20 01:42:15 +00:00
Ian Lance Taylor
c05d17211e * interp.c (CHECKHILO): Don't set HIACCESS, LOACCESS, or HLPC.
It's OK to have a mult follow a mult.  What's not OK is to have a
	mult follow an mfhi.
1996-09-19 22:52:26 +00:00
Ian Lance Taylor
47c6ce6c2d * gencode.c (process_instructions): Correct shift count for 32
bit shift instructions.  Correct sign extension for arithmetic
	shifts to not shift the number of bits in the type.
1996-09-19 21:55:10 +00:00
Ian Lance Taylor
cc5201d78c * gencode.c (process_instructions): Correct handling of nor
instruction.
1996-09-19 19:35:09 +00:00
Michael Meissner
addb61a5b2 Fix tracing info 1996-09-19 17:23:21 +00:00
Michael Meissner
f061ddf67d Make sure there is a trailing space after the instruction 1996-09-19 15:06:37 +00:00
Michael Meissner
891513ee79 Provide macros that can be overriden for the width of the PC & line number fields 1996-09-19 15:02:27 +00:00
Michael Meissner
74473ea10c Add dependencies on lib{bfd,iberity}.a 1996-09-19 14:31:01 +00:00
Michael Meissner
0535fa1aa0 Rename sim_bfd -> exec_bfd for gdb compatibility 1996-09-18 13:56:57 +00:00
Michael Meissner
a49a15ade8 Make exit/stop return correct exit value; Add line number tracing. 1996-09-18 13:23:31 +00:00
Jackie Smith Cashion
3733d1095f Tue Sep 17 11:04:50 1996 James G. Smith <jsmith@cygnus.co.uk>
* run.c (main): Explicitly cast malloc() parameter.

This is needed because for certain builds the size field being given
to malloc() is actually 64bits long, and without a cast or malloc
prototype the resulting value used by malloc() depended on the host
endianness, and how long long paramaters are passed into functions.
1996-09-17 10:10:35 +00:00
Jackie Smith Cashion
f24b7b69ee Mon Sep 16 11:38:16 1996 James G. Smith <jsmith@cygnus.co.uk>
* interp.c (sim_monitor): Improved monitor printf
 	simulation. Tidied up simulator warnings, and added "--log" option
 	for directing warning message output.
	* gencode.c: Use sim_warning() rather than WARNING macro.
1996-09-16 10:47:20 +00:00
Michael Meissner
215ac9533c Fix brf0{t,f}.s <label> -> instruction not to execute instruction if branch succeeds 1996-09-15 03:46:52 +00:00
Ian Lance Taylor
ad0d14e7a2 * Makefile.in (CC_FOR_BUILD): New variable.
(AR, AR_FLAGS, BISON, MAKEINFO): Remove duplicate variables.
	(RANLIB, CC): Likewise.
	(end): Use $(CC_FOR_BUILD), not $(CC).
	* configure.in: Set CC_FOR_BUILD.
	* configure: Rebuild.
1996-09-14 04:05:41 +00:00
Michael Meissner
19d44375ff For unknown traps, print contents of registers and continue execution 1996-09-14 02:36:40 +00:00
Mark Alexander
65c0d7dee9 * simops.c (OP_5F00): Fix problems with system calls. 1996-09-12 19:52:40 +00:00
Michael Meissner
a57190924d Correct trap tracing information 1996-09-12 16:20:05 +00:00
Michael Meissner
1d00ce8392 Print line # and function name or filename if they exist for each PC. 1996-09-12 16:06:02 +00:00
Michael Meissner
9b280a864b Store bfd pointer in a global variable 1996-09-12 15:28:40 +00:00
Michael Meissner
5ceef1b54f fix typo 1996-09-11 22:56:25 +00:00
Michael Meissner
ead4a3f157 Add tracing support; Fix some problems with hardwired sizes 1996-09-11 20:54:21 +00:00
Jeff Law
9909e232c0 * interp.c (hash): Make this an inline function
when compiling with GCC.  Simplify.
        * simpos.c: Explicitly include "sys/syscall.h".  Remove
        some #if 0'd code.  Enable more emulated syscalls.
Checking in more stuff.
1996-09-10 02:51:07 +00:00
Michael Meissner
2254cd90a9 Addi needs to set the carry 1996-09-09 21:12:46 +00:00
Michael Meissner
308f64d3ac Fix ld2w tracing 1996-09-09 20:45:33 +00:00
Michael Meissner
60fc5b7270 Correct tracing of cpfg 1996-09-09 20:10:31 +00:00
Michael Meissner
293c76a376 Make ex{f,t}* tests agree with book 1996-09-09 18:24:18 +00:00
Michael Meissner
069398aaff Fix accumulator shifts 1996-09-09 17:30:36 +00:00
Stu Grossman
fad4a760fd * erc32.c (port_init): Disable this for __GO32__ (got no pty's
there either...).
1996-09-08 23:35:50 +00:00
Ian Lance Taylor
f39a09c9ad * configure.in: Do build erc32 for DOS and Windows hosts.
* configure: Rebuild.
1996-09-08 21:24:10 +00:00
Martin Hunt
ea2155e858 Fri Sep 6 17:56:17 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* simops.c (OP_2600, OP_2601): Changed min and max comparisons
	to use signed register values.
1996-09-07 00:58:25 +00:00
Stu Grossman
1852b017b8 * Makefile.in erc32/Makefile.in: Don't set srcroot. This should
be inherited from the parent.  Remove INSTALL_XFORM and
	INSTALL_XFORM1.  Make INSTALL be set from configure.
1996-09-05 01:16:22 +00:00
Ian Lance Taylor
68867afb88 * configure.in: Only build the MIPS simulator if we are using
gcc.
	* configure: Rebuild.
1996-09-04 19:50:55 +00:00
Michael Meissner
9b86c7e2e2 Second pass at canadian cross 1996-09-04 19:11:53 +00:00
Michael Meissner
1eaaf3050e First cut at dealing with canadian crosses; make -t in debugger set d10v_debug if DEBUG 1996-09-04 18:50:13 +00:00
Michael Meissner
7eebfc6296 More debug support; Enable -t/-v to work correctly; Add --enable-sim-cflags configure switch 1996-09-04 17:42:51 +00:00
Michael Meissner
87178dbdf7 Enhance debug support 1996-09-04 15:41:43 +00:00
Mark Alexander
8719be26c4 * simops.c: Include correct syscall.h for d10v, not host's.
Fix #ifdef SYS_stat.
1996-09-04 11:51:06 +00:00
Jeff Law
9fca2fd3c6 * gencode.c: Fix various indention & style problems.
Remove test code.  Remove #if 0 code.
        * interp.c: Provide prototypes for all static functions.
        Fix minor indention problems.
        (sim_open, sim_resume): Remove unused variables.
        (sim_read): Return type is "int".
        * simops.c: Remove unused variables.
        (divh): Make result of divide-by-zero zero.
        (setf): Initialize result to keep compiler quiet.
        (sar instructions): These just clear the overflow bit.
        * v850_sim.h: Provide prototypes for put_byte, put_half
        and put_word.
Cleaning up.
1996-09-03 18:31:48 +00:00
Michael Meissner
63a91cfb9d Portability fixes; re-add printf/putchar traps 1996-09-03 18:01:03 +00:00
Jeff Law
2b6b2c6d8e Fix typpppo 1996-09-03 17:15:16 +00:00
Jeff Law
d81352b8b8 * interp.c: OP should be an array of 32bit operands!
(v850_callback): Declare.
        (do_format_5): Fix extraction of OP[0].
        (sim_size): Remove debugging printf.
        (sim_set_callbacks): Do something useful.
        (sim_stop_reason): Gross hacks to get c-torture running.
        * simops.c: Simplify code for computing targets of bCC
        insns.   Invert 's' bit if 'ov' bit is set for some
        instructions.  Fix 'cy' bit handling for numerous
        instructions.  Make the simulator stop when a halt
        instruction is encountered.  Very crude support for
        emulated syscalls (trap 0).
        * v850_sim.h: Include "callback.h" and declare
        v850_callback.  Items in the operand array are 32bits.
Fixes & syscall stuff.
1996-09-03 16:25:51 +00:00
Jeff Law
82feb39ed1 Opps. Forgot to commit this a few days ago. 1996-08-31 02:49:05 +00:00
Jeff Law
787d66bb4d * simops.c: Fix "not1" and "set1". 1996-08-30 21:55:26 +00:00
Jeff Law
3046d87986 * simops.c: Don't forget to initialize temp for
"ld.h" and "ld.w"
1996-08-30 20:15:51 +00:00
Jeff Law
ba853302f2 * interp.c: Remove various debugging printfs. 1996-08-30 16:42:49 +00:00
Jeff Law
0e4ccc58f2 * simops.c: Fix satadd, satsub boundary case handling. 1996-08-30 16:41:39 +00:00
Jeff Law
83fc3bac9f * interp.c (hash): Fix.
* interp.c (do_format_8): Get operands correctly and
        call the target function.
        * simops.c: Rough cut at "clr1", "not1", "set1", and "tst1".
1996-08-30 16:35:10 +00:00
Jeff Law
3cb6bf7818 * interp.c (do_format_4): Get operands correctly and
call the target function.
        * simops.c: Rough cut at "sld.b", "sld.h", "sld.w", "sst.b",
        "sst.h", and "sst.w".
1996-08-30 05:49:07 +00:00
Jeff Law
28647e4c0c * v850_sim.h: The V850 doesn't have split I&D spaces. Change
accordingly.  Remove many unused definitions.
        * interp.c: The V850 doesn't have split I&D spaces.  Change
        accordingly.
        (get_longlong, get_longword, get_word): Deleted.
        (write_longlong, write_longword, write_word): Deleted.
        (get_operands): Deleted.
        (get_byte, get_half, get_word): New functions.
        (put_byte, put_half, put_word): New functions.
        * simops.c: Remove unused functions.  Rough cut at
        "ld.b", "ld.h", "ld.w", "st.b", "st.h", "st.w" insns.
1996-08-30 05:41:10 +00:00
Jeff Law
614f1c68ed * v850_sim.h (struct _state): Remove "psw" field. Add
"sregs" field.
        (PSW): Remove bogus definition.
        * simops.c: Change condition code handling to use the psw
        register within the sregs array.  Handle "ldsr" and "stsr".
1996-08-30 05:09:08 +00:00
Jeff Law
dca41ba76b * simops.c: Handle "satadd", "satsub", "satsubi", "satsubr". 1996-08-30 04:59:02 +00:00
Jeff Law
e9b6cbaca5 * interp.c (do_format_5): Get operands correctly and
call the target function.
        (sim_resume): Don't do a PC update for format 5 instructions.
        * simops.c: Handle "jarl" and "jmp" instructions.
1996-08-30 04:27:48 +00:00
Jeff Law
3095b8dfc5 * simops.c: Fix minor typos. Handle "cmp", "setf", "tst"
"di", and "ei" instructions correctly.
1996-08-30 04:11:32 +00:00
Jeff Law
2108e86459 * interp.c (do_format_3): Get operands correctly and call
the target function.
        * simops.c: Handle bCC instructions.
1996-08-30 03:48:13 +00:00
Jeff Law
35404c7d07 * simops.c: Add condition code handling to shift insns.
Fix minor typos in condition code handling for other insns.
1996-08-30 03:23:36 +00:00
Jeff Law
aabce0f46c * Makefile.in: Fix typo.
* simops.c: Add condition code handling to "sub" "subr" and
        "divh" instructions.
1996-08-30 03:07:24 +00:00
Jeff Law
0ef0eba580 * interp.c (hash): Update to be more accurate.
(lookup_hash): Call hash rather than computing the hash
        code here.
        (do_format_1_2): Handle format 1 and format 2 instructions.
        Get operands correctly and call the target function.
        (do_format_6): Get operands correctly and call the target
        function.
        (do_formats_9_10): Rough cut so shift ops will work.
        (sim_resume): Tweak to deal with format 1 and format 2
        handling in a single funtion.  Don't update the PC
        for format 3 insns.  Fix typos.
        * simops.c: Slightly reorganize.  Add condition code handling
        to "add", "addi", "and", "andi", "or", "ori", "xor", "xori"
        and "not" instructions.
        * v850_sim.h (reg_t): Registers are 32bits.
        (_state): The V850 has 32 general registers.  Add a 32bit
        psw and pc register too.  Add accessor macros
Fixing lots of stuff.  Starting to add condition code support.  Basically
check pointing the work to date.
1996-08-29 23:39:23 +00:00
Jeff Law
775533747d * simops.c: Add shift support. 1996-08-29 22:29:41 +00:00
Jeff Law
fb8eb42bd6 Fix typos in multiply and divide code. 1996-08-29 22:05:15 +00:00
Jeff Law
e98e3b2c5a * simops.c: Add multiply & divide support. Abort for system
instructions.
1996-08-29 20:08:37 +00:00
Jeff Law
1fe983dcdf * simops.c: Add logicals, mov, movhi, movea, add, addi, sub
and subr.  No condition codes yet.
1996-08-29 19:53:37 +00:00
Jeff Law
22c1c7ddea * ChangeLog, Makefile.in, configure, configure.in, v850_sim.h,
gencode.c, interp.c, simops.c: Created.
So we've got something to hack on.
1996-08-29 01:06:42 +00:00
Jeff Law
085114ca36 * configure.in (v850-*-*): Added V850 simulator. 1996-08-29 01:05:40 +00:00
Martin Hunt
d70b4d426b Wed Aug 28 17:33:19 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, d10v_sim.h, interp.c: Fix byte-order problems.
1996-08-29 00:35:11 +00:00
Martin Hunt
166acb9f8f New file. 1996-08-28 18:09:06 +00:00
Martin Hunt
4f425a3203 Mon Aug 26 18:30:28 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* d10v_sim.h (SEXT32): Added.
	* interp.c: Commented out printfs.
	* simops.c:  Fixed error in sb and st2w.
1996-08-27 01:32:48 +00:00
Ian Lance Taylor
64d538ce80 * Makefile.in (gencode): Depend upon gencode.o, getopt.o, and
getopt1.o, rather than on gencode.c.  Link objects together.
	Don't link against -liberty.
	(gencode.o, getopt.o, getopt1.o): New targets.
	* gencode.c: Include <ctype.h> and "ansidecl.h".
	(AND): Undefine after including "ansidecl.h".
	(ULONG_MAX): Define if not defined.
	(OP_*): Don't define macros; now defined in opcode/mips.h.
	(main): Call my_strtoul rather than strtoul.
	(my_strtoul): New static function.
1996-08-22 22:06:21 +00:00
Michael Meissner
ca78464476 Fixes from Andrew 1996-08-19 22:21:19 +00:00
Angela Marie Thomas
e1fcafd594 removed NOTES from Things-to-keep since it's a dead file 1996-08-18 21:28:18 +00:00
Michael Meissner
83a650d857 Improve -t options support to list all of the configuration macros & work standalone 1996-08-13 17:29:04 +00:00
Michael Meissner
9aecf50da5 Test whether /dev/zero works before attemping to us it 1996-08-12 23:06:21 +00:00