4 * v850.igen: Added missing sanitization markers.
6 * v850.igen: Make break have a zero first field, since otherwise
7 it clashes with the DIVH instruction.
11 * simops.c (OP_10007E0): Rename SIGABRT -> SIM_SIGABRT. Give
12 sim_stopped instead of sim_signalled.
14 * v850.igen (BREAK), simops.c (OP_12007E0): Rename SIGTRAP to
16 (illegal): Rename SIGILL to SIM_SIGILL.
18 * sim-main.h, simops.c, interp.c: Do not include signal.h.
20 * sim-main.h: Include sim-signal.h instead of signal.h.
21 (SIGTRAP, SIGQUIT): Delete definition.
22 (SIG_V850_EXIT): Delete definition.
26 * Makefile.in (SIM_OBJS): Use $(SIM_NEW_COMMON_OBJS).
30 * interp.c (sim_open): Check state magic number.
31 (sim-assert.h): Include.
35 * v850.igen: Add model filter field to records.
39 * configure: Regenerated to track ../common/aclocal.m4 changes.
43 * sim-main.h: delete null override of SIM_ENGINE_HALT_HOOK and
44 SIM_ENGINE_RESTART_HOOK.
48 * configure: Regenerated to track ../common/aclocal.m4 changes.
52 * sim-main.h (WITH_TARGET_WORD_MSB): Delete.
54 * configure.in (SIM_AC_OPTION_BITSIZE): Specify 32 bit
55 architecture with MSB == 31.
59 * v850.igen: Make divh insn with RRRRR==0 breakpoint.
63 * configure: Regenerated to track ../common/aclocal.m4 changes.
67 * Makefile.in (SIM_WARNINGS, SIM_ALIGNMENT, SIM_ENDIAN,
68 SIM_HOSTENDIAN, SIM_RESERVED_BITS): Delete, moved to common.
69 (SIM_EXTRA_CFLAGS): Update.
73 * configure: Regenerated to track ../common/aclocal.m4 changes.
74 * configure.in: Really specify NONSTRICT_ALIGNMENT as the default.
78 * configure.in: Specify NONSTRICT_ALIGNMENT as the default.
79 * configure: Regenerated to track ../common/aclocal.m4 changes.
83 * v850.igen (disp16): Use EXTEND16 to sign extend disp.
84 (disp22): Only shift left by 1, not 2.
85 ("jmp"): Ensure PC is 2 byte aligned.
87 * simops.c, v850.igen: Move "Bcond", "jr", "jarl" code to
88 v850.igen. Fix tracing.
90 * simops.c (OP_300, OP_400, OP_500): Move "sdl.b", "sld.h",
91 "sld.w" insns to v850.igen. Fix tracing.
93 (OP_70): Ditto for "sld.hu".
96 * v850.igen: Clarify tracing of "sld.b", "sld.h" et.al.
99 * simops.c (condition_met): Make global.
101 * sim-main.h (TRACE_ALU_INPUT3, TRACE_BRANCH0, TRACE_LD,
103 start-sanitize-v850eq
104 (TRACE_LD_NAME): Define.
108 * simops.c: Move "cmov", "cmov imm" to v850.igen, fix.
113 * simops.c: Move "mov", "reti", to v850.igen, fix tracing.
115 * interp.c (hash): Delete.
117 * v850.igen (nop): Really do nothing.
119 * interp.c (do_interrupt): Mask interrupts after PSW is saved, not
121 * v850.igen (reti): Return to current PC not previous.
126 * simops.c: Move "ctret", "bsw", "hsw" to v850.igen, fix tracing.
127 (trace_module): Global, save component/module name across insn.
129 * simops.c: Move "bsh" to v850.igen, fix.
131 * v850.igen (callt): Load correct number of bytes. Fix tracing.
132 (stsr, ldsr): Correct src, dest fields. Fix tracing.
133 (ctret): Force alignment. Fix tracing.
138 * simops.c (trace_output): Add result argument.
139 (trace_result): New function. Simpler version of trace_output,
140 assumes trace needed.
141 (trace_output): Call trace_result.
142 (trace_output): For IMM_REG_REG, trace correct register.
143 (trace_input): Add case for 16bit immediates.
144 (OP_600, OP_640, OP_680, OP_6C0, OP_6A0): Use.
146 * sim-main.h (TRACE_ALU_INPUT, TRACE_ALU_RESULT): Define.
147 (trace_values, trace_name, trace_pc, trace_num_values): Make
151 v850.insn (movea, stsr): Use.
153 (sxb, sxh, zxb, zxh): Ditto.
158 * simops.c: Move "movea" from here.
159 * v850.igen: To here.
161 * v850.igen (simm16): Define, sign extend imm16.
162 (uimm16): Define, no sign extension.
163 (addi, andi, movea, movhi, mulhi, ori, satsubi, xori): Use.
166 * simops.c: Move "sxh", "switch", "sxb", "callt", "dispose",
168 * v850.igen: To here.
169 (switch): Fix off by two error in NIA calc.
174 * simops.c (trace_pc, trace_name, trace_values, trace_num_values):
176 (trace_input): Just save pc, name and values for trace_output.
177 (trace_output): Write trace values to a buffer. Use
178 trace_one_insn to print trace info and buffer.
179 (SIZE_OPERANDS, SIZE_LOCATION): Delete.
183 * sim-main.h (struct _sim_cpu): Add psw_mask so that reserved bits
186 * simops.c (OP_2007E0, OP_4007E0): Move "ldsr", "stsr"
187 instructions from here.
188 * v850.igen (ldsr, stsr): To here. Mask out reserved bits when
191 * interp.c (sim_open): Set psw_mask if machine known.
196 * v850-dc: Add rule to diferentiate between breakpoint and divh.
197 * v850.igen (break): New instruction, breakpoint simulator.
200 * v850.igen (breakpoint): Enable. Change to a 32bit instruction.
205 * simops.c (Multiply64): Don't store into register zero.
210 * Makefile.in (semantics.o): Add dependency.
212 * sim-main.h (SAVE_1, SAVE_2): Perform backward compatible save,
213 do not adjust CIA/NIA.
217 start-sanitize-v850eq
218 * simops.c (OP_300, OP_400, OP_70): Make behavour depend on PSW[US].
220 * simops.c: Move "divun", "sld.bu", "divhn", "divhun", "divn",
221 "divun", "pushml" code from here to v850.igen.
222 (divun): Make global.
223 (type3_regs): Make global
225 * v850.igen: Move simops.c code to here.
227 * interp.c (sim_create_inferior): For v850eq set US bit by
232 * interp.c (sim_open): Don't set arch, now set by
236 * configure: Regenerated to track ../common/aclocal.m4 changes.
240 * simops.c (op_types): Move from here.
243 * sim-main.h (trace_input, trace_output), simops.c: Make global.
245 * simops.c (OP_60): Move "jmp" code from here.
246 * v850.igen (jmp): To here.
248 start-sanitize-v850eq
249 * simops.c (OP_60): Move "sld.bu" code from here.
250 * v850.igen (sld.bu): To here.
255 start-sanitize-v850eq
256 * v850.igen (prepare, ...): Add to v850eq architecture.
260 * interp.c (sim_open): Default to v850eq.
263 start-sanitize-v850eq
265 * interp.c (sim_open): Default to v850e.
267 * sim-main.h (signal.h): Include.
269 * v850.igen (illegal): Report/halt illegal instructions.
271 * Makefile.in (SIM_EXTRA_CFLAGS): Add SIM_RESERVED_BITS.
273 * configure.in: Add reserved bits option.
274 * configure: Regenerate.
278 * interp.c (sim_open): Use sim_do_commandf instead of asprintf.
280 * sim-main.h (INSN_NAME):
282 * Makefile.in (INCLUDE): Add SIM_EXTRA_DEPS.
283 (SIM_EXTRA_DEPS): Add itable.h
284 (tmp-gencode): Does not depend on simops.h
286 * sim-main.h (itable.h): Include.
287 (MAX_INSNS, INSN_NAME): Define.
289 * interp.c: Compute inttype from the interrupt_names index that
294 * simops.c (trace_input): Use trace_printf instead of
296 (trace_output): Ditto.
297 (trace_input): Only trace when TRACE_ALU_P. Delete code
298 disasembling instruction.
299 (trace_output): Only trace when TRACE_ALU_P.
303 * simops.c (trace_input, trace_output): Use sim_io_printf.
304 (OP_620): Pass correct argument to trace.
306 (trace_input): Obtain prog_bfd, text_start et.al from simulator
311 * v850.igen: New file.
317 * sim-main.h (SEXT16): Delete, use EXTEND16.
318 (SEXT8): Delete, use EXTEND8.
319 (SEXT32): Delete, used?
320 (SEXT40, SEXT44, SEXT64): Use UNSIGNED64 for constants, not ...LL.
321 (WITH_TARGET_WORD_MSB): Define as 31. v850 little bit endian.
323 * simops.c: Use EXTEND15 from sim-bits instead of SEXT16.
325 * sim-main.h (DEBUG_TRACE, DEBUG_VALUES, v850_debug): Delete,
326 replace with TRACE_INSN_P and TRACE_ALU_P.
328 * simops.c (trace_input, trace_output): Update.
330 * interp.c (sim_engine_run): Delete.
331 (lookup_hash): Delete.
332 (sim_open): Do not fill hash table.
337 * simops.c (OP_FFFF): Use sim_engine_halt.
341 * sim-main.h (struct sim_cpu): Delete member exception. Using
344 * interp.c (sim_info): Do not do anything in sim-info.
345 (sim_stop): Delete, replace with sim-stop.
346 (sim_stop_reason): Delete, replace with sim-reason.
348 * sim-main.h (WITH_WATCHPOINTS): Define.
349 (WITH_MODULO_MEMORY): Define
351 * Makefile.in (SIM_OBJS): Add sim-resume, sim-watch, sim-stop,
354 * interp.c (enum interrupt_cond_type): Delete.
355 (struct interrupt_generator): Delete.
356 (enum interrupt_type): Drop int_none.
357 (sim_open): Initialize WATCHPOINT module.
358 (sim_resume, sim_run): Rename sim_resume to sim_run.
359 (sim_engine_run): Replace interrupt code with call to sim-events.
360 (sim_set_interrupt): Delete.
361 (sim_parse_number): Delete.
363 Thu Sep 4 17:21:23 1997 Doug Evans <dje@seba>
365 * configure: Regenerated to track ../common/aclocal.m4 changes.
369 * simops.c (fetch_argv): New function, fetch a arg vector from
372 * configure.in: Check for fork, execve, execv.
373 * configure: Regenerate.
375 * interp.c (sim_store_register, sim_fetch_register): Use H2T_4 and
376 T2H_4 for byte swapping.
378 * sim-main.h, interp.c (get_word, get_half, get_byte, put_word,
379 put_half, put_byte): Delete.
381 * Makefile.in (SIM_OBJS): Add sim-memopt.o module.
383 * sim-main.h (load_mem, store_mem): Redefine as macros.
384 (IMEM, IMEM_IMMED): New macros - fetch instructions.
386 * simops.c (OP_10007E0): For SYS_read, SYS_write, SYS_open
387 transfer data via a buffer.
388 (fetch_str): New function, fetch string from memory.
390 * Makefile.in (SIM_OBJS): Add sim-hrw.o module.
392 * interp.c (sim_open): Establish memory maps using sim-memopt.c
394 (sim_do_command): Print error if memory-map command is used. Call
396 (map): Delete, replaced by sim-core.
397 (sim_memory_init): Delete, replaced by sim-core.
398 (sim_set_memory_map): Delete, replaced by sim-memopt.
399 (load_mem): Delete, replaced by sim-core.
400 (store_mem): Delete, replaced by sim-core.
401 (sim_write): Delete, replaced by sim-hrw.
402 (sim_read): Delete, replaced by sim-hrw.
404 * sim-main.h (struct sim_state): Remove memory members, using
409 * sim-main.h: Replace SIM_HAVE_FLATMEM with mem ptr.
410 * interp.c (map): Do not add to a void pointer.
412 * Makefile.in (INCLUDE): Add sim-main.h
414 * configure.in: Check for time.h
415 * configure: Re-generate.
417 * interp.c (struct interrupt_generator): Make time unsigned long,
419 (sim_resume): Make oldpc SIM_ADDR.
420 (struct hash_entry): Make mask/opcode unsigned.
422 * v850_sim.h (struct simops ): Make opcode and mask unsigned.
424 * simops.c (utime.h): Include if available.
425 (OP_10007E0): Check for UTIME function.
426 (divun): Put parentheses around shift argument.
427 (OP_640): Put parentheses around shift argument, was wrong.
428 (OP_107F0): Return something.
430 * interp.c (sim_parse_number): Use strtoul not strtol.
431 (sim_resume): Use sim_elapsed_time_get to keep track of the time.
433 * configure.in (SIM_AC_OPTION_WARNINGS): Add.
434 (SIM_AC_OPTION_ENDIAN): Set to hardwired big.
435 (SIM_AC_OPTION_HOST_ENDIAN): Add.
436 (AC_CHECK_FUNCS): Add utime.
437 (AC_CHECK_HEADERS): Add stdlib.h, string.h, strings.h, utime.h
438 configure: Regenerate.
441 * Makefile.in (SIM_RUN_OBJS): Use nrun.o.
442 (SIM_OBJS): Add sim-io.o, sim-hload.o, sim-utils.o, sim-options.o,
443 sim-config.o, sim-module.o, sim-events.o, sim-core.o,
444 sim-endian.o, sim-engine.o, sim-trace.o, sim-profile.o
445 (SIM_ENDIAN, SIM_WARNGINS): Define.
447 * simops.c (OP_10007E0): Use sim_io_* for transfers.
449 * interp.c (sim_resume): Pass sd around.
451 * simops.c (sim-main.h): Include.
453 * gencode.c (write_template): Generate #include sim-main.h.
454 (write_opcodes): Ditto.
456 * interp.c (prog_bfd, prog_bfd_was_opened_p): Delete.
457 (v850_callback): Ditto.
458 (sim_kind, myname): Ditto.
459 (lookup_hash): Pass SD. Use sim_io_error.
460 (sim_set_memory_map): Pass in SD, use.
461 (init_system): Pass in SD, use.
463 (sim_set_profile): Delete.
464 (sim_set_profile_size): Delete.
465 (do_interrupt): Pass in SD, use.
466 (sim_info): Use sim_io_printf.
467 (sim_create_inferior): Reset registers. Set PC from prog_bfd
469 (sim_load): Delete, use common/sim-hload.c
470 (sim_size): Rename to sim_memory_init.
471 (sim_write): Remove call to init_system.
472 (init_system): Delete.
473 (sim_set_callbacks): Delete.
474 (sim_set_interrupt): Pass in SD, use.
475 (start_time): Delete.
477 * v850_sim.h: Remove everything except `struct simops' from here.
478 * sim-main.h: Move most to here.
479 * gencode.c: Move #includes to here.
481 * sim-main.h(struct _sim_cpu): Rename struct _state.
482 (#define PC, et.al.): Update
483 (v850_callback): Delete. Replaced with SIM_DESC arg.
484 (int8, uint8, int16, uint16, int32, uint32): Define types using
485 unsigned8 et.al from common/sim-types.h.
486 * sim-main.h (State): Define as STATE_CPU.
490 * configure.in: Check for time, chmod.
491 * configure: Regenerate.
492 * simops.c (SYS_time, SYS_chmod): Use HAVE_TIME, HAVE_CHMOD.
494 * simops.c (../../libgloss/v850/sys/syscall.h): Include instead of
496 (OP_10007E0): Check the existance each SYS_* macro independantly.
498 * v850_sim.h (SIGQUIT, SIGTRAP): Only define if missing.
502 * configure: Regenerated to track ../common/aclocal.m4 changes.
507 * interp.c (sim_kill): Delete.
508 (sim_create_inferior): Add ABFD argument.
509 (sim_load): Move setting of PC from here.
510 (sim_create_inferior): To here.
514 * configure: Regenerated to track ../common/aclocal.m4 changes.
519 * interp.c (sim_open): Add ABFD argument.
524 * simops.c (bsh): Only set CY flag if either of the bottom
527 * simops.c (prepare, dispose): Lower numbered
528 registers go to higher numbered address.
530 * simops.c (unsigned divide instructions): S bit set if result has
533 start-sanitize-v850eq
534 * simops.c (pushml, pushmh, popml, popmh): Lower numbered
535 registers go to higher numbered address.
541 * simops.c (OP_107E0, OP_107F0, OP_307E0, OP_307F0): Use correct
542 interpretation of SR bit in list18 structure.
543 start-sanitize-v850eq
544 (divn, divun): New functions to perform N step divide functions.
547 start-sanitize-v850eq
550 * simops.c (OP_300, OP_400, OP_60, OP_70): Support variant opcodes
551 with US bit set in the PSW.
556 * interp.c (sim_resume): Opcode functions return amount to be
557 added to PC and all opcodes take a standard format in the OP[]
560 (do_format_*): Functions removed.
562 * v850_sim.h (SP, EP): New register mnemonics.
564 * gencode.c (write_header): Functions prototypes return an
567 * simops.c: Opcode functions return amount to be added to PC.
570 * v850_sim.h (CTPC, CTPSW, CTBP): New register mnemonics.
572 * simops.c: Add support for v850e instructions.
576 start-sanitize-v850eq
577 * simops.c: Add support for v850eq instructions.
582 * interp.c (sim_open): Add callback argument.
583 (sim_set_callbacks): Delete SIM_DESC argument.
587 * configure: Regenerated to track ../common/aclocal.m4 changes.
591 * interp.c (prog_bfd_was_opened_p): New static local.
592 (prog_bfd): New global variable.
593 (sim_open): Undo patch to add -E support.
594 (sim_close): Close prog_bfd if sim_load opened it.
595 (sim_load): Record bfd of loaded file in prog_bfd.
596 * simops.c (prog_bfd): Renamed from exec_bfd.
600 * interp.c (sim_stop): Stub function.
604 * Makefile.in (SIM_OBJS): Add sim-load.o.
605 * interp.c (sim_kind, myname): New static locals.
606 (sim_open): Set sim_kind, myname. Ignore -E arg.
607 (sim_load): Return SIM_RC. New arg abfd. Call sim_load_file to
608 load file into simulator. Set start address from bfd.
609 (sim_create_inferior): Return SIM_RC. Delete arg start_address.
613 * simops.c (OP_10007E0): Only provide system calls SYS_execv,
614 SYS_wait, SYS_wait, SYS_utime, SYS_time if defined by the host.
618 * configure: Regenerated to track ../common/aclocal.m4 changes.
623 * interp.c (sim_open): New arg `kind'.
625 * configure: Regenerated to track ../common/aclocal.m4 changes.
629 * configure: Regenerated to track ../common/aclocal.m4 changes.
633 * configure: Regenerated to track ../common/aclocal.m4 changes.
637 * configure: Re-generate.
641 * configure: Regenerate to track ../common/aclocal.m4 changes.
645 * interp.c (sim_open): New SIM_DESC result. Argument is now
647 (other sim_*): New SIM_DESC argument.
651 * Makefile.in (@COMMON_MAKEFILE_FRAG): Use
652 COMMON_{PRE,POST}_CONFIG_FRAG instead.
653 * configure.in: sinclude ../common/aclocal.m4.
654 * configure: Regenerated.
658 * configure configure.in Makefile.in: Update to new configure
659 scheme which is more compatible with WinGDB builds.
660 * configure.in: Improve comment on how to run autoconf.
661 * configure: Re-run autoconf to get new ../common/aclocal.m4.
662 * Makefile.in: Use autoconf substitution to install common
667 * simops.c (OP_{E0,2E0,6E0}): The multiply operations sign extend,
672 * simops.c: Put ifdefs around things to make MSVC happy. Get rid
673 of unistd.h. Disable SYS_stat, SYS_chown, SYS_time, SYS_times,
674 SYS_gettimeofday and SYS_utime from MSVC.
678 * simops.c (OP_10007E0): Know that kill encodes the signal number
679 via: 0xdead0000 | signal and turn it back into a signal.
683 * v850_sim.h (SIG_V850_EXIT): Define as -1.
685 * interp.c (sim_open): Cast calloc function.
686 (sim_stop_reason): If signal is SIG_V850_EXIT, inform gdb the
687 program exited with the appropriate exit code.
688 (sim_set_interrupt): Declare buildargv.
690 * simops.c (OP_10007E0): Make exit signal normal exit. Make time
691 type correct and work on big endian systems.
695 * Makefile.in: Delete stuff moved to ../common/Make-common.in.
696 (SIM_OBJS,SIM_EXTRA_CFLAGS,SIM_EXTRA_CLEAN): Define.
697 * configure.in: Simplify using macros in ../common/aclocal.m4.
698 Call AC_CHECK_HEADERS(unistd.h).
699 * configure: Regenerated.
700 * config.in: New file.
701 * simops.c: #include "config.h". #include <unistd.h> if present.
705 * v850_sim.h (State): New slots dummy_mem, pending_nmi.
706 (EIPC, etc): New macros for system registers.
707 * simops.c, interp.c: Use everywhere.
709 * interp.c: Add support for interrupts issued by interrupt
710 generators, either PC- or time-based. Controlled by simulator
711 command "sim interrupt".
713 * interp.c: Add support for variable-size allocation of memory,
714 via simulator command "sim memory-map".
715 (map): Issue SIGSEGV for references to invalid memory regions.
719 * simops.c: Include <sys/time.h> for struct timeval and
724 * simops.c (OP_10007E0): Handle SYS_times and SYS_gettimeofday.
726 * simops.c (OP_10007E0): Handle SYS_time.
730 * simops.c: Include <sys/stat.h>.
731 (OP_10007E0): Handle SYS_stat.
735 * simops.c (OP_10007E0): Don't declare errno.
737 * simops.c (OP_500): Mask off low bit in displacement
741 * simops.c (OP_500): Fix displacement handling for sld.w.
742 (OP_501): Similarly for sst.w.
744 * simops.c (trace_input): Remove all references to SEXT7.
745 (OP_300, OP_400, OP_500, OP_380, OP_480, OP_501): Displacement
746 is zero extended for sst/sld instructions.
747 * v850_sim.h (SEX7): Delete. It's no longer needed (and it
748 was incorrect anyway).
752 * Makefile.in: Get rid of srcroot. Set all INSTALL macros via
754 * gencode.c (write_opcodes): Pad operands field to account for
756 * simops.c: Include errno.h. Exclude SYS_chown, since MSVC
757 doesn't support it. (Why is this here in the first place?!?)
758 * v850_sim.h: Get rid of 64 bit defs. Also, get rid of #elif's.
759 Change number of operands in struct simops from 9 to 6. Define
760 SIGTRAP and SIGQUIT for MSVC.
764 * interp.c (MEM_SIZE): It's now bytes, not a power of 2.
765 * (map): Add support for external mem in the 1->2 meg range.
766 Also, abort() when memory access is way out of bounds. (Better to
767 die than to give wrong result. (This will be fixed later.))
768 * (sim_size): MEM_SIZE is now bytes, not shift factor.
772 * simops.c (trace_input): Swapped order of operands for output
773 output of OP_IMM_REG. Changed the fetching of the operands for
774 OP_LOAD32, and OP_STORE32 to work like op-function.
778 * interp.c: Move includes of remote-sim.h and callback.h to
780 * (lookup_hash): Add PC to report of hash failure.
781 * (map load_mem store_mem): New memory subsystem. Models V851
783 * (sim_write sim_read): Use new memory subsystem.
784 * (sim_resume): Don't load and save PC into EIPC anymore. Needed
785 to make user-defined traps work right.
786 * simops.c (OP_*): Use new memory subsystem.
787 * (OP_14007E0 (reti)): Implement reti.
788 * (OP_14996E0 (trap)): Implement user-defined traps. Move I/O to
789 trap 31. Use new memory subsystem.
790 * v850_sim.h: Prototypes for load_mem, store_mem and map. Use
791 load_mem in RLW macro.
795 * gencode.c (write_opcodes): Output hex values for opcode mask
797 * interp.c (sim_resume): Save and restore PC from the appropriate
799 * (sim_fetch_register sim_store_register): Fix byte-order problem
800 with reading and writing registers.
801 * simops.c (OP_FFFF): Implement pseudo-breakpoint insn.
805 * simops.c (trace_input): Fix thinko.
809 * simops.c (exec_bfd): Rename from sim_bfd.
810 (trace_input): Ditto.
814 * simops.c (trace_input): Use find_nearest_line to print line
815 number, function name or file name of PC.
819 * simops.c: Add tracing support. Use SEXTxx macros instead of
820 doing hardwired shifts.
822 * configure.in (--enable-sim-cflags): Add switch to add additional
823 flags to simulator buld. If --enable-sim-cflags=trace, turn on
825 * configure: Regenerate.
827 * Makefile.in: Don't require a VPATH capable make if configuring
828 in the same directory. Don't use CFLAGS for configuration flags.
829 Add flags from --enable-sim-cflags. Support canadian cross
830 builds. Rebuild whole simulator if include files change.
832 * interp.c (v850_debug): New global for debugging.
833 (lookup_hash,sim_size,sim_set_profile): Use
834 printf_filtered callback, instead of calling printf directly.
835 (sim_{open,trace}): Enable tracing if -t and compiled for tracing.
837 * v850_sim.h: Use limits.h to set the various sized types.
838 (SEXT{5,7,16,22}): New macros.
842 * interp.c (hash): Make this an inline function
843 when compiling with GCC. Simplify.
844 * simpos.c: Explicitly include "sys/syscall.h". Remove
845 some #if 0'd code. Enable more emulated syscalls.
849 * interp.c: Fix sign bit handling for add and sub instructions.
853 * gencode.c: Fix various indention & style problems.
854 Remove test code. Remove #if 0 code.
855 * interp.c: Provide prototypes for all static functions.
856 Fix minor indention problems.
857 (sim_open, sim_resume): Remove unused variables.
858 (sim_read): Return type is "int".
859 * simops.c: Remove unused variables.
860 (divh): Make result of divide-by-zero zero.
861 (setf): Initialize result to keep compiler quiet.
862 (sar instructions): These just clear the overflow bit.
863 * v850_sim.h: Provide prototypes for put_byte, put_half
866 * interp.c: OP should be an array of 32bit operands!
867 (v850_callback): Declare.
868 (do_format_5): Fix extraction of OP[0].
869 (sim_size): Remove debugging printf.
870 (sim_set_callbacks): Do something useful.
871 (sim_stop_reason): Gross hacks to get c-torture running.
872 * simops.c: Simplify code for computing targets of bCC
873 insns. Invert 's' bit if 'ov' bit is set for some
874 instructions. Fix 'cy' bit handling for numerous
875 instructions. Make the simulator stop when a halt
876 instruction is encountered. Very crude support for
877 emulated syscalls (trap 0).
878 * v850_sim.h: Include "callback.h" and declare
879 v850_callback. Items in the operand array are 32bits.
883 * interp.c (sim_resume): Fix code to check for a format 3
885 * simops.c: bCC insns only argument is a constant, not a
886 register value (duh...)
890 * simops.c: Fix "not1" and "set1".
892 * simops.c: Don't forget to initialize temp for
895 * interp.c: Remove various debugging printfs.
897 * simops.c: Fix satadd, satsub boundary case handling.
899 * interp.c (hash): Fix.
900 * interp.c (do_format_8): Get operands correctly and
901 call the target function.
902 * simops.c: Rough cut at "clr1", "not1", "set1", and "tst1".
906 * interp.c (do_format_4): Get operands correctly and
907 call the target function.
908 * simops.c: Rough cut at "sld.b", "sld.h", "sld.w", "sst.b",
909 "sst.h", and "sst.w".
911 * v850_sim.h: The V850 doesn't have split I&D spaces. Change
912 accordingly. Remove many unused definitions.
913 * interp.c: The V850 doesn't have split I&D spaces. Change
915 (get_longlong, get_longword, get_word): Deleted.
916 (write_longlong, write_longword, write_word): Deleted.
917 (get_operands): Deleted.
918 (get_byte, get_half, get_word): New functions.
919 (put_byte, put_half, put_word): New functions.
920 * simops.c: Remove unused functions. Rough cut at
921 "ld.b", "ld.h", "ld.w", "st.b", "st.h", "st.w" insns.
923 * v850_sim.h (struct _state): Remove "psw" field. Add
925 (PSW): Remove bogus definition.
926 * simops.c: Change condition code handling to use the psw
927 register within the sregs array. Handle "ldsr" and "stsr".
929 * simops.c: Handle "satadd", "satsub", "satsubi", "satsubr".
931 * interp.c (do_format_5): Get operands correctly and
932 call the target function.
933 (sim_resume): Don't do a PC update for format 5 instructions.
934 * simops.c: Handle "jarl" and "jmp" instructions.
936 * simops.c: Fix minor typos. Handle "cmp", "setf", "tst"
937 "di", and "ei" instructions correctly.
939 * interp.c (do_format_3): Get operands correctly and call
941 * simops.c: Handle bCC instructions.
943 * simops.c: Add condition code handling to shift insns.
944 Fix minor typos in condition code handling for other insns.
946 * Makefile.in: Fix typo.
947 * simops.c: Add condition code handling to "sub" "subr" and
950 * interp.c (hash): Update to be more accurate.
951 (lookup_hash): Call hash rather than computing the hash
953 (do_format_1_2): Handle format 1 and format 2 instructions.
954 Get operands correctly and call the target function.
955 (do_format_6): Get operands correctly and call the target
957 (do_formats_9_10): Rough cut so shift ops will work.
958 (sim_resume): Tweak to deal with format 1 and format 2
959 handling in a single funtion. Don't update the PC
960 for format 3 insns. Fix typos.
961 * simops.c: Slightly reorganize. Add condition code handling
962 to "add", "addi", "and", "andi", "or", "ori", "xor", "xori"
963 and "not" instructions.
964 * v850_sim.h (reg_t): Registers are 32bits.
965 (_state): The V850 has 32 general registers. Add a 32bit
966 psw and pc register too. Add accessor macros
968 * Makefile.in, interp.c, v850_sim.h: Bring over endianness
969 changes from the d10v simulator.
971 * simops.c: Add shift support.
973 * simops.c: Add multiply & divide support. Abort for system
976 * simops.c: Add logicals, mov, movhi, movea, add, addi, sub
977 and subr. No condition codes yet.
981 * ChangeLog, Makefile.in, configure, configure.in, v850_sim.h,
982 gencode.c, interp.c, simops.c: Created.