3 * interp.c (CoProcPresent): Add UNUSED attribute - not used by all
8 * interp.c (sim_do_command): Check for common commands if a
9 simulator specific command fails.
13 * interp.c (sim_engine_run): ifdef out uses of simSTOP, simSTEP
14 and simBE when DEBUG is defined.
18 * interp.c (interrupt_event): New function. Pass exception event
19 onto exception handler.
21 * configure.in: Check for stdlib.h.
22 * configure: Regenerate.
24 * gencode.c (build_instruction): Add UNUSED attribute to tempS
26 (build_instruction): Initialize memval1.
27 (build_instruction): Add UNUSED attribute to byte, bigend,
29 (build_operands): Ditto.
31 * interp.c: Fix GCC warnings.
32 (sim_get_quit_code): Delete.
34 * configure.in: Add INLINE, ENDIAN, HOSTENDIAN and WARNINGS.
36 * configure: Re-generate.
38 * Makefile.in (SIM_OBJS): Add sim-watch.o module.
42 * interp.c (mips_option_handler): New function parse argumes using
44 (myname): Replace with STATE_MY_NAME.
45 (sim_open): Delete check for host endianness - performed by
47 (simHOSTBE, simBE): Delete, replaced by sim-endian flags.
48 (sim_open): Move much of the initialization from here.
49 (sim_load): To here. After the image has been loaded and
51 (sim_open): Move ColdReset from here.
52 (sim_create_inferior): To here.
53 (sim_open): Make FP check less dependant on host endianness.
55 * Makefile.in (SIM_RUN_OBJS): Set to nrun.o - use new version or
57 * interp.c (sim_set_callbacks): Delete.
59 * interp.c (membank, membank_base, membank_size): Replace with
60 STATE_MEMORY, STATE_MEM_SIZE, STATE_MEM_BASE.
61 (sim_open): Remove call to callback->init. gdb/run do this.
65 * sim-main.h (SIM_HAVE_FLATMEM): Define.
67 * interp.c (big_endian_p): Delete, replaced by
68 current_target_byte_order.
72 * interp.c (host_read_long, host_read_word, host_swap_word,
73 host_swap_long): Delete. Using common sim-endian.
74 (sim_fetch_register, sim_store_register): Use H2T.
75 (pipeline_ticks): Delete. Handled by sim-events.
77 (sim_engine_run): Update.
81 * interp.c (sim_stop_reason): Move code determining simEXCEPTION
83 (SignalException): To here. Signal using sim_engine_halt.
84 (sim_stop_reason): Delete, moved to common.
88 * interp.c (sim_open): Add callback argument.
89 (sim_set_callbacks): Delete SIM_DESC argument.
94 * Makefile.in (SIM_OBJS): Add common modules.
96 * interp.c (sim_set_callbacks): Also set SD callback.
97 (set_endianness, xfer_*, swap_*): Delete.
98 (host_read_word, host_read_long, host_swap_word, host_swap_long):
99 Change to functions using sim-endian macros.
100 (control_c, sim_stop): Delete, use common version.
101 (simulate): Convert into.
102 (sim_engine_run): This function.
103 (sim_resume): Delete.
105 * interp.c (simulation): New variable - the simulator object.
106 (sim_kind): Delete global - merged into simulation.
107 (sim_load): Cleanup. Move PC assignment from here.
108 (sim_create_inferior): To here.
110 * sim-main.h: New file.
111 * interp.c (sim-main.h): Include.
115 * configure: Regenerated to track ../common/aclocal.m4 changes.
119 * tconfig.in (SIM_HAVE_BIENDIAN): Define.
123 * gencode.c (build_instruction): DIV instructions: check
124 for division by zero and integer overflow before using
125 host's division operation.
129 * Makefile.in (SIM_OBJS): Add sim-load.o.
130 * interp.c: #include bfd.h.
131 (target_byte_order): Delete.
132 (sim_kind, myname, big_endian_p): New static locals.
133 (sim_open): Set sim_kind, myname. Move call to set_endianness to
134 after argument parsing. Recognize -E arg, set endianness accordingly.
135 (sim_load): Return SIM_RC. New arg abfd. Call sim_load_file to
136 load file into simulator. Set PC from bfd.
137 (sim_create_inferior): Return SIM_RC. Delete arg start_address.
138 (set_endianness): Use big_endian_p instead of target_byte_order.
142 * interp.c (sim_size): Delete prototype - conflicts with
143 definition in remote-sim.h. Correct definition.
147 * configure: Regenerated to track ../common/aclocal.m4 changes.
152 * interp.c (sim_open): New arg `kind'.
154 * configure: Regenerated to track ../common/aclocal.m4 changes.
158 * configure: Regenerated to track ../common/aclocal.m4 changes.
162 * interp.c (sim_open): Set optind to 0 before calling getopt.
166 * configure: Regenerated to track ../common/aclocal.m4 changes.
170 * interp.c : Replace uses of pr_addr with pr_uword64
171 where the bit length is always 64 independent of SIM_ADDR.
172 (pr_uword64) : added.
176 * configure: Re-generate.
180 * configure: Regenerate to track ../common/aclocal.m4 changes.
184 * interp.c (sim_open): New SIM_DESC result. Argument is now
186 (other sim_*): New SIM_DESC argument.
191 * gencode.c (POP_AND,POP_OR,POP_NOR,POP_XOR):
192 Change values to avoid overloading DOUBLEWORD which is tested
194 * gencode.c: reinstate "offending code".
199 * interp.c: Fix printing of addresses for non-64-bit targets.
200 (pr_addr): Add function to print address based on size.
202 * gencode.c: #ifdef out offending code until a permanent fix
203 can be added. Code is causing build errors for non-5900 mips targets.
209 * gencode.c (process_instructions): Correct test for ISA dependent
210 architecture bits in isa field of MIPS_DECODE.
215 * interp.c (simopen): Add support for LSI MiniRISC PMON vectors.
220 * gencode.c (MIPS_DECODE): Correct instruction feature flags for
226 * gencode.c (build_mips16_operands): Correct computation of base
227 address for extended PC relative instruction.
232 * Makefile.in, configure, configure.in, gencode.c,
233 interp.c, support.h: add r5900.
238 * interp.c (mips16_entry): Add support for floating point cases.
239 (SignalException): Pass floating point cases to mips16_entry.
240 (ValueFPR): Don't restrict fmt_single and fmt_word to even
242 (StoreFPR): Likewise. Also, don't clobber fpr + 1 for fmt_single
244 (COP_LW): Pass fmt_word rather than fmt_uninterpreted to StoreFPR,
245 and then set the state to fmt_uninterpreted.
246 (COP_SW): Temporarily set the state to fmt_word while calling
251 * gencode.c (build_instruction): The high order may be set in the
252 comparison flags at any ISA level, not just ISA 4.
256 * Makefile.in (@COMMON_MAKEFILE_FRAG): Use
257 COMMON_{PRE,POST}_CONFIG_FRAG instead.
258 * configure.in: sinclude ../common/aclocal.m4.
259 * configure: Regenerated.
263 * configure: Rebuild after change to aclocal.m4.
267 * configure configure.in Makefile.in: Update to new configure
268 scheme which is more compatible with WinGDB builds.
269 * configure.in: Improve comment on how to run autoconf.
270 * configure: Re-run autoconf to get new ../common/aclocal.m4.
271 * Makefile.in: Use autoconf substitution to install common
276 * gencode.c (build_instruction): Use BigEndianCPU instead of
281 * interp.c (sim_monitor): Make output to stdout visible in
282 wingdb's I/O log window.
286 * support.h: Undo previous change to SIGTRAP
291 * interp.c (store_word, load_word): New static functions.
292 (mips16_entry): New static function.
293 (SignalException): Look for mips16 entry and exit instructions.
294 (simulate): Use the correct index when setting fpr_state after
295 doing a pending move.
299 * interp.c: Fix byte-swapping code throughout to work on
300 both little- and big-endian hosts.
304 * support.h: Make definitions of SIGTRAP and SIGQUIT consistent
305 with gdb/config/i386/xm-windows.h.
309 * gencode.c (build_instruction): Work around MSVC++ code gen bug
310 that messes up arithmetic shifts.
314 * support.h: Use _WIN32 instead of __WIN32__. Also add defs for
315 SIGTRAP and SIGQUIT for _WIN32.
319 * gencode.c (build_instruction) [MUL]: Cast operands to word64, to
320 force a 64 bit multiplication.
321 (build_instruction) [OR]: In mips16 mode, don't do anything if the
322 destination register is 0, since that is the default mips16 nop
327 * gencode.c (MIPS16_DECODE): SWRASP is I8, not RI.
328 (build_endian_shift): Don't check proc64.
329 (build_instruction): Always set memval to uword64. Cast op2 to
330 uword64 when shifting it left in memory instructions. Always use
331 the same code for stores--don't special case proc64.
333 * gencode.c (build_mips16_operands): Fix base PC value for PC
335 (build_instruction): Call JALDELAYSLOT rather than DELAYSLOT for a
337 * interp.c (simJALDELAYSLOT): Define.
338 (JALDELAYSLOT): Define.
339 (INDELAYSLOT, INJALDELAYSLOT): Define.
340 (simulate): Clear simJALDELAYSLOT when simDELAYSLOT is cleared.
344 * interp.c (sim_open): add flush_cache as a PMON routine
345 (sim_monitor): handle flush_cache by ignoring it
349 * gencode.c (build_instruction): Use !ByteSwapMem instead of
351 * interp.c (CONFIG, config_EP_{mask,shift,D,DxxDxx, config_BE): Delete.
352 (BigEndianMem): Rename to ByteSwapMem and change sense.
353 (BigEndianCPU, sim_write, LoadMemory, StoreMemory): Change
354 BigEndianMem references to !ByteSwapMem.
355 (set_endianness): New function, with prototype.
356 (sim_open): Call set_endianness.
357 (sim_info): Use simBE instead of BigEndianMem.
358 (xfer_direct_word, xfer_direct_long, swap_direct_word,
359 swap_direct_long, xfer_big_word, xfer_big_long, xfer_little_word,
360 xfer_little_long, swap_word, swap_long): Delete unnecessary MSC_VER
361 ifdefs, keeping the prototype declaration.
362 (swap_word): Rewrite correctly.
363 (ColdReset): Delete references to CONFIG. Delete endianness related
364 code; moved to set_endianness.
368 * gencode.c (build_instruction, case JUMP): Truncate PC to 32 bits.
369 * interp.c (CHECKHILO): Define away.
370 (simSIGINT): New macro.
371 (membank_size): Increase from 1MB to 2MB.
372 (control_c): New function.
373 (sim_resume): Rename parameter signal to signal_number. Add local
374 variable prev. Call signal before and after simulate.
375 (sim_stop_reason): Add simSIGINT support.
376 (sim_warning, sim_error, dotrace, SignalException): Define as stdarg
378 (sim_warning): Delete call to SignalException. Do call printf_filtered
380 (AddressTranslation): Add #ifdef DEBUG around debugging message and
381 a call to sim_warning.
385 * gencode.c (process_instructions): If ! proc64, skip DOUBLEWORD
390 Add support for mips16 (16 bit MIPS implementation):
391 * gencode.c (inst_type): Add mips16 instruction encoding types.
392 (GETDATASIZEINSN): Define.
393 (MIPS_DECODE): Add REG flag to dsllv, dsrav, and dsrlv. Add
394 jalx. Add LEFT flag to mfhi and mflo. Add RIGHT flag to mthi and
396 (MIPS16_DECODE): New table, for mips16 instructions.
397 (bitmap_val): New static function.
398 (struct mips16_op): Define.
399 (mips16_op_table): New table, for mips16 operands.
400 (build_mips16_operands): New static function.
401 (process_instructions): If PC is odd, decode a mips16
402 instruction. Break out instruction handling into new
403 build_instruction function.
404 (build_instruction): New static function, broken out of
405 process_instructions. Check modifiers rather than flags for SHIFT
406 bit count and m[ft]{hi,lo} direction.
407 (usage): Pass program name to fprintf.
408 (main): Remove unused variable this_option_optind. Change
409 ``*loptarg++'' to ``loptarg++''.
410 (my_strtoul): Parenthesize && within ||.
411 * interp.c (LoadMemory): Accept a halfword pAddr if vAddr is odd.
412 (simulate): If PC is odd, fetch a 16 bit instruction, and
413 increment PC by 2 rather than 4.
414 * configure.in: Add case for mips16*-*-*.
415 * configure: Rebuild.
419 * interp.c: Allow -t to enable tracing in standalone simulator.
420 Fix garbage output in trace file and error messages.
424 * Makefile.in: Delete stuff moved to ../common/Make-common.in.
425 (SIM_{OBJS,EXTRA_CFLAGS,EXTRA_CLEAN}): Define.
426 * configure.in: Simplify using macros in ../common/aclocal.m4.
427 * configure: Regenerated.
428 * tconfig.in: New file.
432 * interp.c: Fix bugs in 64-bit port.
433 Use ansi function declarations for msvc compiler.
434 Initialize and test file pointer in trace code.
435 Prevent duplicate definition of LAST_EMED_REGNUM.
439 * interp.c (xfer_big_long): Prevent unwanted sign extension.
443 * interp.c (SignalException): Check for explicit terminating
445 * gencode.c: Pass instruction value through SignalException()
446 calls for Trap, Breakpoint and Syscall.
450 * interp.c (SquareRoot): Add HAVE_SQRT check to ensure sqrt() is
451 only used on those hosts that provide it.
452 * configure.in: Add sqrt() to list of functions to be checked for.
453 * config.in: Re-generated.
454 * configure: Re-generated.
458 * gencode.c (process_instructions): Call build_endian_shift when
459 expanding STORE RIGHT, to fix swr.
460 * support.h (SIGNEXTEND): If the sign bit is not set, explicitly
462 * interp.c (Convert): Fix fmt_single to fmt_long to not truncate.
463 Fix float to int conversions to produce signed values.
467 * gencode.c (MIPS_DECODE): Set UNSIGNED for multu instruction.
468 (process_instructions): Correct handling of nor instruction.
469 Correct shift count for 32 bit shift instructions. Correct sign
470 extension for arithmetic shifts to not shift the number of bits in
471 the type. Fix 64 bit multiply high word calculation. Fix 32 bit
472 unsigned multiply. Fix ldxc1 and friends to use coprocessor 1.
474 * interp.c (CHECKHILO): Don't set HIACCESS, LOACCESS, or HLPC.
475 It's OK to have a mult follow a mult. What's not OK is to have a
477 (Convert): Comment out incorrect rounding code.
481 * interp.c (sim_monitor): Improved monitor printf
482 simulation. Tidied up simulator warnings, and added "--log" option
483 for directing warning message output.
484 * gencode.c: Use sim_warning() rather than WARNING macro.
488 * Makefile.in (gencode): Depend upon gencode.o, getopt.o, and
489 getopt1.o, rather than on gencode.c. Link objects together.
490 Don't link against -liberty.
491 (gencode.o, getopt.o, getopt1.o): New targets.
492 * gencode.c: Include <ctype.h> and "ansidecl.h".
493 (AND): Undefine after including "ansidecl.h".
494 (ULONG_MAX): Define if not defined.
495 (OP_*): Don't define macros; now defined in opcode/mips.h.
496 (main): Call my_strtoul rather than strtoul.
497 (my_strtoul): New static function.
501 * gencode.c (process_instructions): Generate word64 and uword64
502 instead of `long long' and `unsigned long long' data types.
503 * interp.c: #include sysdep.h to get signals, and define default
505 * (Convert): Work around for Visual-C++ compiler bug with type
507 * support.h: Make things compile under Visual-C++ by using
508 __int64 instead of `long long'. Change many refs to long long
509 into word64/uword64 typedefs.
513 * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir,
514 INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set values.
516 * configure.in (AC_PREREQ): autoconf 2.5 or higher.
517 (AC_PROG_INSTALL): Added.
518 (AC_PROG_CC): Moved to before configure.host call.
519 * configure: Rebuilt.
523 * configure.in: Define @SIMCONF@ depending on mips target.
524 * configure: Rebuild.
525 * Makefile.in (run): Add @SIMCONF@ to control simulator
527 * gencode.c: Change LOADDRMASK to 64bit memory model only.
528 * interp.c: Remove some debugging, provide more detailed error
529 messages, update memory accesses to use LOADDRMASK.
533 * configure.in: Add calls to AC_CONFIG_HEADER, AC_CHECK_HEADERS,
534 AC_CHECK_LIB, and AC_CHECK_FUNCS. Change AC_OUTPUT to set
536 * configure: Rebuild.
537 * config.in: New file, generated by autoheader.
538 * interp.c: Include "config.h". Include <stdlib.h>, <string.h>,
539 and <strings.h> if they exist. Replace #ifdef sun with #ifdef
540 HAVE_ANINT and HAVE_AINT, as appropriate.
541 * Makefile.in (run): Use @LIBS@ rather than -lm.
542 (interp.o): Depend upon config.h.
543 (Makefile): Just rebuild Makefile.
544 (clean): Remove stamp-h.
545 (mostlyclean): Make the same as clean, not as distclean.
546 (config.h, stamp-h): New targets.
550 * interp.c (ColdReset): Fix boolean test. Make all simulator
555 * interp.c (xfer_direct_word, xfer_direct_long,
556 swap_direct_word, swap_direct_long, xfer_big_word,
557 xfer_big_long, xfer_little_word, xfer_little_long,
558 swap_word,swap_long): Added.
559 * interp.c (ColdReset): Provide function indirection to
560 host<->simulated_target transfer routines.
561 * interp.c (sim_store_register, sim_fetch_register): Updated to
562 make use of indirected transfer routines.
566 * gencode.c (process_instructions): Ensure FP ABS instruction
568 * interp.c (AbsoluteValue): Add routine. Also provide simple PMON
573 * interp.c (sim_do_command): Complain if callback structure not
578 * interp.c (Convert): Provide round-to-nearest and round-to-zero
579 support for Sun hosts.
580 * Makefile.in (gencode): Ensure the host compiler and libraries
581 used for cross-hosted build.
585 * interp.c, gencode.c: Some more (TODO) tidying.
589 * gencode.c, interp.c: Replaced explicit long long references with
590 WORD64HI, WORD64LO, SET64HI and SET64LO macro calls.
591 * support.h (SET64LO, SET64HI): Macros added.
595 * configure: Regenerate with autoconf 2.7.
599 * interp.c (LoadMemory): Enclose text following #endif in /* */.
600 * support.h: Remove superfluous "1" from #if.
601 * support.h (CHECKSIM): Remove stray 'a' at end of line.
605 * interp.c (StoreFPR): Control UndefinedResult() call on
606 WARN_RESULT manifest.
610 * gencode.c: Tidied instruction decoding, and added FP instruction
613 * interp.c: Added dineroIII, and BSD profiling support. Also
614 run-time FP handling.
618 * Changelog, Makefile.in, README.Cygnus, configure, configure.in,
619 gencode.c, interp.c, support.h: created.