3 * Makefile.in (gencode.o): New rule.
4 (gencode): Call LINK_FOR_BUILD.
8 * configure: Regenerate.
12 * configure.ac (AC_CONFIG_MACRO_DIRS): Replace common with m4.
13 * aclocal.m4, configure: Regenerate.
17 * configure.ac: Replace sinclude with AC_CONFIG_MACRO_DIRS.
18 * aclocal.m4, configure: Regenerate.
22 * configure: Regenerate.
26 * config.in, configure: Regenerate.
27 * interp.c, simops.c: Delete HAVE_STRING_H, HAVE_STRINGS_H,
28 HAVE_STDLIB_H, HAVE_TIME_H, and strings.h include.
32 * configure: Regenerate.
36 * configure.ac (SIM_AC_OPTION_WARNINGS): Pass "no".
37 * configure: Regenerate.
41 * configure: Regenerate.
45 * configure: Regenerate.
49 * configure: Regenerate.
53 * gencode.c: Include libiberty.h.
54 (conflict_warn): Use ARRAY_SIZE.
55 * interp.c (init_dsp): Likewise.
59 * interp.c (dmul): Split into dmul_s and dmul_u. Use explicit integer
60 width types and simplify implementation.
61 * gencode.c (dmuls.l, dmulu.l): Use new functions dmul_s and dmul_u.
65 * interp.c (sim_memory_size): Default init to 30.
66 (parse_and_set_memory_size): Adjust upper bound to 31.
70 * config.in, configure: Regenerate.
74 * configure: Regenerate.
78 * configure.ac (SIM_AC_OPTION_ENVIRONMENT): Delete call.
79 * configure: Regenerate.
83 * configure: Regenerate.
87 * configure: Regenerate.
91 * configure.ac (SIM_AC_OPTION_INLINE): Delete call.
92 * configure: Regenerate.
96 * configure: Regenerate.
100 * configure: Regenerate.
104 * config.in, configure: Regenerate.
108 * interp.c (sim_open): Mark argv const.
109 (sim_create_inferior): Mark argv and env const.
113 * configure: Regenerate.
117 * interp.c (sim_open): Update sim_parse_args comment.
121 * interp.c (count_argc): Delete.
122 (trap): Change count_argc to countargv.
126 * configure.ac (SIM_AC_OPTION_HOSTENDIAN): Delete.
127 * configure: Regenerate.
128 * interp.c (host_little_endian): Change CURRENT_HOST_BYTE_ORDER
133 * configure: Regenerate.
134 * interp.c (target_little_endian): Change LITTLE_ENDIAN to
136 (host_little_endian): Likewise.
140 * wrapper.c (sim_store_register): Rename to ...
141 (sh_reg_store): ... this.
142 (sim_fetch_register): Rename to ...
143 (sh_reg_fetch): ... this.
144 (sim_open): Call CPU_REG_FETCH/CPU_REG_STORE.
148 * Makefile.in (SIM_OBJS): Delete sim-hload.o.
152 * config.in, configure: Regenerate.
156 * gencode.c (tab): Pass sd into trap calls.
157 * interp.c (prog_argv, callback): Delete.
158 (parse_and_set_memory_size): Add SIM_DESC arg.
159 (trap): Declare callback and prog_argv.
160 (sim_resume): Declare callback.
161 (sim_info): Change callback->printf_filtered calls to sim_io_printf.
162 (sim_open): Delete callback assignment. Pass sd to
163 parse_and_set_memory_size.
164 (parse_and_set_memory_size): Change callback->printf_filtered call
166 (sim_create_inferior): Delete prog_argv assignment.
167 (sim_do_command): Change callback->printf_filtered calls to
168 sim_io_printf. Pass sd to parse_and_set_memory_size.
172 * Makefile.in (SIM_OBJS): Delete sim-stop.o.
176 * interp.c (sim_close): Delete.
180 * configure: Regenerate.
184 * configure: Regenerate.
188 * configure: Regenerate.
192 * sim-main.h (SIM_CPU): Delete.
196 * sim-main.h (sim_cia): Delete.
200 * sim-main.h (CIA_GET, CIA_SET): Delete.
204 * interp.c (sh_pc_get, sh_pc_set): New functions.
205 (sim_open): Call CPU_PC_FETCH & CPU_PC_STORE for all cpus.
209 * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
210 * sim-main.h (STATE_CPU): Delete.
214 * configure: Regenerate.
218 * Makefile.in (SIM_OBJS): Delete sim-engine.o.
222 * config.in, configure: Regenerate.
226 * Makefile.in (SIM_RUN_OBJS, SIM_EXTRA_CFLAGS): Delete.
227 (SIM_OBJS): Change to $(SIM_NEW_COMMON_OBJS).
228 * interp.c: Delete run-sim.h include. Include sim-main.h, sim-base.h,
230 (SEXT, SEXT32): Undefine.
231 (sim_write): Delete prototype.
232 (regstacktype, saved_state_type): Move to sim-main.h.
233 (target_little_endian): Replace with CURRENT_TARGET_BYTE_ORDER.
234 (host_little_endian): Replace with CURRENT_HOST_BYTE_ORDER.
235 (sim_kind, myname, tracing, sim_stop, sim_trace, sim_set_profile,
236 sim_set_profile_size, sim_load, sim_set_callbacks,
237 sim_complete_command): Delete.
238 (sim_size): Mark static.
239 (init_pointers): Delete host_little_endian setup.
240 (sim_resume): Delete tracing check.
241 (free_state): New cleanup function.
242 (sim_open): Rewrite to use new common logic.
243 (sim_create_inferior): Call init_dsp.
244 * sim-main.h: New file.
245 * tconfig.h: Delete file.
249 * gencode.c (ppi_gensim): Convert old style prototype with ppi_insn.
250 * interp.c: Include ctype.h and run-sim.h.
251 [HAVE_TIME_H]: Include time.h
252 [HAVE_SYS_TIME_H]: Include sys/time.h
253 [!_WIN32]: Include utime.h and sys/wait.h.
254 (set_fpscr1, raise_exception, raise_buserror, get_dr, set_dr, set_sr,
255 do_rdat, do_wdat, process_wlat_addr, process_wwat_addr,
256 process_wbat_addr, process_rlat_addr, process_rwat_addr,
257 process_rbat_addr, IOMEM, get_now, now_persec, swapout, swapout16,
258 ptr, strswaplen, strnswap, dmul, macw, macl, get_loop_bounds_ext,
259 get_loop_bounds, sim_size, init_dsp, init_pointers, dump_profile,
260 gotcall, sim_stop, sim_write, sim_read, sim_store_register,
261 sim_fetch_register, sim_trace, sim_stop_reason, sim_info,
262 sim_set_profile, sim_set_profile_size, sim_open,
263 parse_and_set_memory_size, sim_close, sim_load, sim_create_inferior,
264 sim_do_command, sim_set_callbacks): Convert old style prototype.
265 (fail): Delete unused function.
266 (wlat_fast, wwat_fast, wbat_fast, rlat_fast, rwat_fast, rbat_fast):
267 Delete unused prototypes.
268 (wlat_fast, wwat_fast, wbat_fast, rlat_fast, rwat_fast, rbat_fast,
270 Convert old style prototype and move INLINE before the type.
271 (trap): Convert old style prototype. Add casts to wait and sim_write
273 (div1): Convert old style prototype. Change return to void.
274 (do_long_move_insn, do_blog_insn, fsca_s, fsrra_s, mcalloc): Mark
276 (sim_resume): Convert old style prototype. Align printf format and
281 * gencode.c (ppi_gensim): Add missing */. Change case 4 to case 5.
285 * Makefile.in (gencode): Add $(BUILD_CFLAGS), $(BUILD_LDFLAGS),
287 * gencode.c: Include ctype.h, stdlib.h, string.h, and unistd.h.
288 (struct op): Mark members const.
290 (nibble_type_list): Mark const.
291 (arg_type_list): Mark const.
292 (make_enum_list): Delete unused func.
293 (qfunc, expand_opcode, dumptable, expand_ppi_code): Convert old
294 style prototype and mark args const.
295 (sorttab, gengastab, conflict_warn, filltable, expand_ppi_movxy,
296 gensim, ppi_filltable): Convert old style prototype.
297 (gensim_caselist): Convert old style prototype. Mark local
298 variables s and r const.
299 (gendefines): Convert old style prototype. Mark s const. Move
300 tolower call into printf statement.
301 (ppi_gensim): Convert old style prototype. Mark local variable
303 (main): Convert old style prototype. Change printf %d to %zu.
307 * config.in, configure: Regenerate.
308 * configure.ac: Call SIM_AC_OPTION_ENDIAN, SIM_AC_OPTION_ALIGNMENT,
309 SIM_AC_OPTION_HOSTENDIAN, SIM_AC_OPTION_ENVIRONMENT,
310 SIM_AC_OPTION_INLINE, SIM_AC_OPTION_WARNINGS.
314 * config.in, configure: Regenerate.
315 * tconfig.in: Rename file ...
316 * tconfig.h: ... here.
320 * Makefile.in (SIM_EXTRA_CFLAGS): Set to
321 -DSIM_USE_DEPRECATED_RUN_FRONTEND.
322 (SIM_RUN_OBJS): Set to run.o.
326 * configure.ac (AC_CHECK_HEADERS): Delete.
327 * aclocal.m4, configure: Regenerate.
331 * gencode.c (fabs, fneg): Implement as integer operation
332 instead of using the FP_UNARY macro.
336 * configure: Regenerate.
340 * configure: Regenerate.
341 * config.in: Regenerate.
345 * interp.c (parse_and_set_memory_size): Add const to str.
346 (sim_do_command): Add const to cmd and sms_cmd.
350 * interp.c (sim_load): Add const to prog.
355 * interp.c (control_c): Delete.
356 (sim_resume): Delete signal(SIGINT) handling.
360 * configure: Regenerate.
364 * aclocal.m4, configure: Regenerate.
368 * config.in, configure: Regenerate.
372 * aclocal.m4, config.in, configure: Regenerate.
376 * interp.c (MA): Adjust cast to avoid warning on 64-bit hosts.
378 * interp.c (sim_store_register, sim_fetch_register): Return
383 * aclocal.m4: New file.
384 * configure: Regenerate.
388 * configure.ac: Change include to common/acinclude.m4.
392 * configure.ac: Change AC_PREREQ to 2.64. Delete AC_CONFIG_HEADER
393 call. Replace common.m4 include with SIM_AC_COMMON.
394 * configure: Regenerate.
398 * interp.c (sim_complete_command): New stub function.
402 * interp.c (sim_write): Add const to buffer arg.
406 * interp.c: Don't include sysdep.h.
407 Include stdio.h and errno.h.
408 Include string.h strings.h stdlib.h sys/stat.h if present.
412 * configure: Regenerate.
416 * config.in: Regenerate.
417 * configure: Likewise.
419 * configure: Regenerate.
423 * configure: Regenerate to track ../common/common.m4 changes.
430 * configure: Regenerate.
434 * interp.c (macl): Fix non-portable implementation.
438 * gencode.c (tab): Add RAISE_EXCEPTION_IF_IN_DELAY_SLOT to the
439 definition of PC relative 'mov.l'/'mov.w' and also 'mova'.
443 * gencode.c (tab): Correct pre-decrement instructions when m == n.
447 * acconfig.h: Remove.
448 * config.in: Regenerate.
452 * configure: Regenerated.
456 * configure: Regenerated.
460 * configure: Regenerated.
464 * interp.c (sim_memory_size): Use same amount of memory on Windows as
469 * interp.c (<sys/mman.h>): Include.
470 (mcalloc): New function / macro.
472 (sim_size): Use mcalloc and mfree.
476 * interp.c (strswaplen): Add one for '\0' delimiter.
480 * gencode.c (tab): Avoid lvalue casts. Suggested by
485 * gencode.c (tab): Avoid inserting code before variables all declared.
489 * configure: Regenerate.
493 * configure.ac: Sinclude aclocal.m4 before common.m4. Add
494 explicit call to AC_CONFIG_HEADER.
495 * configure: Regenerate.
499 * configure.ac: Update to use ../common/common.m4.
500 * configure: Re-generate.
504 * configure: Regenerated to track ../common/aclocal.m4 changes.
508 * configure.ac: Rename configure.in, require autoconf 2.59.
509 * configure: Re-generate.
513 * configure: Regenerate for ../common/aclocal.m4 update.
518 * gencode.c (movua.l): Compensate for endianness.
522 * interp.c (RAISE_EXCEPTION_IF_IN_DELAY_SLOT): New macro.
523 (in_delay_slot): New flag variable.
524 (Delay_Slot): Set in_delay_slot.
525 (sim_resume): Reset in_delay_slot after leaving code switch.
526 * gencode.c (op tab): Call RAISE_EXCEPTION_IF_IN_DELAY_SLOT for all
527 instructions not allowed in delay slots.
532 Introduce SH2a support.
533 * interp.c: Change type of jump table to short. Add various macros.
534 (sim_load): Save the bfd machine code.
535 (sim_create_inferior): Ditto.
536 (union saved_state_type): Add tbr, ibnr and ibcr registers.
537 Move bfd_mach to end of struct. Add regstack pointer.
538 (init_dsp): Don't swap contents of sh_dsp_table any more. Instead
539 use it directly in its own switch statement. Allocate space for 512
541 (do_long_move_insn): New function.
542 (do_blog_insn): Ditto.
543 (trap): Use trap #13 and trap #14 to set ibnr and ibcr.
544 * gencode.c: Move movx/movy insns into separate switch statement.
545 (op tab): Add sh2a insns. Reject instructions that are disabled
547 (gensim_caselist): Generate default case here instead of in caller.
548 (gensim): Generate two separate switch statements. Call
549 gensim_caselist once for each (for movsxy_tab and for tab).
550 Add tokens for r15 and multiple regs.
551 (conflict_warn, warn_conflicts): Add for debugging.
555 * gencode.c (tab): For shad snd shld, fix result for
556 (op1 < 0 && shift_amount == 0).
560 * gencode.c (movua.l): Set thislock to 0, not n.
564 * gencode.c (table): Change from char to short.
565 (dumptable): Change generated table from char to short.
566 * interp.c (sh_jump_table, sh_dsp_table, ppi_table): char to short.
567 (init_dsp): Compute size of sh_dsp_table.
568 (sim_resume): Change jump_table from char to short.
572 * gencode.c: (op tab): Some refs and defs fixes.
573 "fsrra" -> "fsrra <FREG_N>".
574 "sleep": replace array ref with array addr.
576 Comment and whitespace clean-ups.
580 * gencode.c: Whitespace cleanup.
583 * gencode.c: Replace 'Hitachi' with 'Renesas'.
584 (op tab): Add new instructions for sh4a, DBR, SBR.
585 (expand_opcode): Add handling for new movxy combinations.
586 (gensym_caselist): Ditto.
587 (expand_ppi_movxy): Remove movx/movy expansions,
588 now handled in expand_opcode.
589 (gensym): Add some helpful macros.
590 (expand_ppi_code): Flatten loop for simplicity, tweak for 12-bit
591 instead of 8-bit table (some insns are ambiguous to 8 bits).
592 (ppi_gensim, main): Generate 12-bit instead of 8-bit ppi table.
594 * interp.c: Replace 'Hitachi' with 'Renesas'.
595 (union saved_state_type): Add dbr, sgr, ldst.
596 (get_loop_bounds_ext): New function.
597 (init_dsp): Add bfd_mach_sh4al_dsp.
598 (sim_resume): Handle extended loop bounds.
602 * gencode.c (expand_opcode): Simplify and reorganize.
603 Eliminate "shift" parameter. Eliminate "4 bits at a time"
604 assumption. Flatten switch statement to a single level.
605 Add "eeee" token for even-numbered registers.
607 (fsca): Use "eeee" token.
608 (ppi_moves): Rename to "expand_ppi_movxy". Do the ddt
609 [movx/movy] expansion here, as well as the ppi expansion.
610 (gensim_caselist): Accept 'eeee' along with 'nnnn'.
614 * interp.c (fsca_s, fsrra_s): New functions.
615 * gencode.c (tab): Add entries for fsca and fsrra.
616 (expand_opcode): Allow variable length n / m fields.
620 * syscall.h (SYS_truncate, SYS_ftruncate): Define.
621 * interp.c (trap): Add support for SYS_ftruncate and SYS_truncate.
624 * sim/sh/gencode.c ( tab[] ): Addition of MAC.L handler and
625 correction for MAC.W handler
626 * sim/sh/interp.c ( macl ): New Function. Implementation of
631 * gencode.c (expand_ppi_code): Comment spelling fix.
635 * gencode.c (pshl): Change < to <= (shift by 16 is allowed).
636 Cast argument of >> to unsigned to prevent sign extension.
637 (psha): Change < to <= (shift by 32 is allowed).
641 * gencode.c: Fix typo in comment.
645 * gencode.c: A few more fix-ups of refs and defs.
646 (frchg): Raise SIGILL if in double-precision mode.
647 (ldtlb): We don't simulate cache, so this is a no-op.
648 (movsxy_tab): Correct a few bit pattern errors.
652 * gencode.c (prnd): Clear LSW of result to zeros.
653 * gencode.c (pmuls): Expression is mis-parenthesized.
654 * gencode.c (ppi_gensim): For a conditional ppi insn, if the
655 condition is false, we want to return (not break). A break
656 will take us to the end of the function where registers will
657 be updated, whereas the desired outcome is for nothing to change.
661 * gencode.c (movs): Fix a couple of text transpositions.
665 * gencode.c (op tab): Some fix-ups of refs and defs.
666 (ocbi, ocbp): Cache not simulated, but may cause memory fault.
667 (gensym_caselist): Add default case to switch statement.
668 (expand_ppi_code): Add default case to switch statement.
669 * gencode.c (op tab): Implement movca.l.
670 * gencode.c (op movsxy_tab): Fix an error in the bit pattern.
671 * gencode.c (gensim_caselist): The movy instructions use
672 registers R6 and R7 (not R4 and R5 like the movx insns).
676 * gencode.c (op movsxy_tab): Fix up some copy/paste errors
677 in name: s/REG_x/REG_y/.
679 * gencode.c (op tab): Move misplaced semicolon.
683 * interp.c (init_dsp, sim_open, sim_create_inferior): Rename _bfd
688 * interp.c (trap): Return int. Take extra parameter for address
689 of the trap instruction. Changed all callers.
690 Add case 33 for profiling.
691 * gencode.c (trapa): Handle trap 33 using the trap function.
692 Add read of vector for generic traps.
696 * Makefile.in (interp.o): Depend on $(srcroot)/include/gdb/sim-sh.h.
697 * interp.c: Include "gdb/sim-sh.h".
698 (sim_store_register, sim_fetch_register): Use constants defined there.
702 * interp.c (sim_resume): Fix setting of bus error for
707 * configure: Regenerated to track ../common/aclocal.m4 changes.
711 * interp.c: Include "gdb/callback.h" and "gdb/remote-sim.h".
715 * interp.c (sim_create_inferior): Record program arguments for
716 later inspection by the trap handler.
717 (count_argc): New function.
718 (prog_argv): Declare static.
719 (sim_write): Declare.
720 (trap): Implement argc, argnlen and argn system calls. Do not
721 abort on unknown system calls--simply return -1.
722 * syscall.h (SYS_argc, SYS_argnlen, SYS_argn): Define.
726 * interp.c (trap): Implement time.
730 * gencode.c (tab): Delimit strings with commas where applicable.
734 * configure: Regenerated to track ../common/aclocal.m4 changes.
738 sh-dsp support, simulator speedup by using host byte order:
740 * Makefile.in (interp.o): Depends on ppi.c .
742 * gencode.c (printonmatch, think, genopc): Deleted.
743 (MAX_NR_STUFF): Now 42.
744 (tab): Add SH-DSP CPU instructions.
745 Amalgamate ldc / stc / lds / sts instructions with similar
746 bit patterns. Fix opcodes of stc Rm_BANK,@-<REG_N>.
747 Fix semantics of lds.l @<REG_N>+,MACH (no sign extend).
748 (movsxy_tab): New array.
749 For movs, change MMMM field to GGGG, and mmmm field to MMMM.
750 Added entries for movx, movy and parallel processing insns.
751 (ppi_tab): New array.
752 (qfunc): Stabilize sort.
753 (expand_opcode): Handle [01][01]NN, [01][01]xx and [01][01]yy.
754 Handle 'M', 'G' 's' 'X', 'a', 'Y' and 'A'.
755 (dumptable): Now takes three arguments. Changed all callers.
756 Emit just one contigous jump table.
757 (filltable): Now takes an argument. Changed all callers.
759 (ppi_moves, expand_ppi_code, ppi_filltable, ppi_gensim): New functions.
760 (gensim_caselist): New function, broken out of gensim.
761 Handle opcode fields 'x', 'y', 's', 'M', 'G', 'X', 'a', and 'Y'.
763 (gensim): Handle 'N' in code field and '8' in refs field.
764 Call gensim_caselist - twice.
765 (ppi_index): New static variable.
766 (main): Unsupport default action.
767 Add dsp support for -x / -s option. Add -p option.
768 * interp.c (sh_jump_table, sh_dsp_table, ppi_table): Declare.
769 (saved_state_type): Rearrange to allow amalgamated ldc / stc /
770 lds / sts to work efficiently.
771 (target_dsp): New static variable.
772 (GBR, VBR, SSR, SPC, MACH, MACL): Reflect saved_state_type change.
773 (FPUL, Rn_BANK, SET_Rn_BANK, M, Q, S, T, SR_BL, SR_RB): Likewise.
774 (SR_MD, SR_RC, SET_SR_BIT, GET_SR, SET_RC, GET_FPSCR): Likewise.
775 (RS, RE, MOD, MOD_ME, DSP_R): Likewise.
776 (set_fpscr1): Likewise. Use target_dsp to check for dsp.
777 (MOD_MSi, SIG_BUS_FETCH): Deleted.
778 (CREG, SREG, PR, SR_MASK_DMY, SR_MASK_DMX, SR_DMY): New macros.
779 (SR_DMX, DSR, MOD_DELTA, GET_DSP_GRD): Likewise.
780 (SET_MOD): Reflect saved_state_type change. Set MOD_DELTA instead
781 of MOD_MS, and encode SR_DMY / SR_DMX into high word of MOD_ME.
782 (set_sr): Reflect saved_state_type change. Fix SR_RB handling.
784 (MA, L, TL, TB): Now controlled by ACE_FAST.
785 (SEXT32): Just cast to int.
786 (SIGN32): Fixed to only shift by 31.
787 (CHECK_INSN_PTR): SIGBUS at insn fetch now represented by insn_end 0.
790 (init_dsp): Set target_dsp. When it changes, switch end of
791 sh_jump_table with sh_dsp_table.
792 (sim_resume) Don't declare sh_jump_table0. Use sh_jump_table instead.
793 Don't Declare PR if it's #defined.
794 Fix single-stepping (Was broken in Mar 6 16:59:10 patch).
795 (sim_store_register, sim_read_register): Translate accesses to
796 reflect saved_state_type change.
798 * interp.c (set_sr): Set sr.
799 (SET_RC, MOD, MOD_MS, MOD_ME, SET_MOD, MOD_MS, MOD_ME): New macros.
800 (set_fpscr1): Don't bank-switch fpu registers when simulating sh-dsp.
801 (DSP_R): Fix definition.
802 (sim_resume): Remove outdated SET_SR use.
804 * interp.c (saved_state): New members for struct member asregs:
805 rs, re, insn_end, xram_start, yram_start.
806 (struct loop_bounds): New struct.
807 (SKIP_INSN): New macro.
808 (get_loop_bounds): New function.
809 (endianw): Renamed to global_endianw.
810 (maskw): negated bits.
812 (SR_MASK_RC, SR_RC_INCREMENT, SR_RC, RAISE_EXCEPTION): New macros.
813 (RS, RE, DSP_R, DSP_GRD, A1, A0, X0, X1, Y0, Y1, M0, A1G): Likewise.
814 (M1, A0G, RIAT, PT2H, PH2T, SET_NIP, CHECK_INSN_PTR): Likewise.
815 (SIG_BUS_FETCH): Likewise
816 (raise_exception, riat_fast): New functions.
817 (raise_buserror, sim_stop): Use raise_exception.
818 (PROCESS_SPECIAL_ADDRESS): Use xram_start / yram_start.
819 (BUSERROR, WRITE_BUSERROR, READ_BUSERROR):
820 Reverse sense of mask argument.
821 (FP_OP, set_dr): Use RAISE_EXCEPTION.
822 (wlat_fast, wwat_fast, wbat_fast, rlat_fast, rwat_fast, rbat_fast):
823 Declare. Remove redundant masking.
824 (wwat_fast, rwat_fast): Add argument endianw. Changed callers.
825 (MA): Updated for change pc -> PC.
826 (Delay_Slot): Use RIAT.
828 (trap): Remove argument little_endian. Add argument endianw.
829 Changed all callers. Use raise_exception.
830 (macw): Add argument endainw. Changed all callers.
831 (init_dsp): New function, extended after broken out of init_pointers.
832 (sim_resume): Replace pc with insn_ptr. Replace little_endian with
833 endianw. Replace nia with nip. Reverse sense of maskb / maskw /
834 maskl. Implement logic for zero-overhead loops. Don't try to
835 interpret garbage when getting a SIGBUS at insn fetch.
836 (sim_open): Call init_dsp.
837 * gencode.c (tab): Use SET_NIP instead of nia = . Use PH2T / PT2H /
838 RAISE_EXCEPTION where appropriate.
839 Add extra cycles for brai, braf , bsr, bsrf, jmp, jsr.
841 * interp.c (sim_store_register, sim_fetch_register):
842 Do proper endianness switch.
844 * interp.c (saved_state_type): New members for struct member asregs:
845 xymem_select, xmem, ymem, xmem_offset, ymem_offset.
846 (special_address): Delete.
847 (BUSERROR): Now a two-argument predicate.
848 (PROCESS_SPECIAL_ADDRESS, WRITE_BUSERROR, READ_BUSERROR): New macros.
849 (wlat_little, wwat_little, wbat_any, wlat_big, wwat_big): Delete.
850 (process_wlat_addr, process_wwat_addr): New functions.
851 (process_wbat_addr, process_rlat_addr, process_rwat_addr): Likewise.
852 (process_rbat_addr): Likewise.
853 (wlat_fast, wwat_fast, wbat_fast): Use WRITE_BUSERROR.
854 (rlat_little, rwat_little, rbat_any, rlat_big, rwat_big): Delete.
855 (rlat_fast, rwat_fast, rbat_fast): Use READ_BUSERROR.
856 (RWAT, RLAT, RBAT, WWAT, WLAT, WBAT): Delete SLOW versions.
857 (do_rdat, trap): Delete SLOW code.
858 (SEXT32, SIGN32): New macros.
859 (swap, swap16): Now integer in - integer out. Changed all callers.
860 (strswaplen, strnswap): Delete SLOW versions.
861 (init_pointers): Initialize dsp memory selection (preliminary).
862 (sim_store_register, sim_fetch_register): Use swap instead of
863 big / little endian read / write functions.
865 * interp.c (maskl): Deleted.
866 (endianw, endianb): New variables.
867 (special_address): Now inline.
868 (bp_holder): Put raising of buserror there, rename to:
870 (BUSERROR): Now yields a value. Changed all users.
872 (wlat_fast, wwat_fast, wbat_fast): New functions.
873 (rlat_fast, rwat_fast, rbat_fast): Likewise.
874 (RWAT, RLAT, RBAT, WWAT, WLAT, WBAT): Use new functions.
875 (do_rdat, do_wdat): Likewise. Take maskl argument instead of
876 little_endian one. Changed caller macros.
877 (swap, swap16): Use w[rw]lat_big / w[rw]lat_little directly.
878 (strswaplen, strnswap): New functions.
879 (trap): Use them to fix up endian mismatches;
880 disable SYS_execve and SYS_execv; fix double address translation for
881 SYS_pipe and SYS_stat.
882 (sym_write, sym_read): Add endianness translation.
883 (sym_store_register, sym_fetch_register): Add maskl local variable.
884 (sim_open): Set endianw and endianb.
888 * configure: Regenerated to track ../common/aclocal.m4 changes.
892 * gencode.c (fcnvds <DR_N>,FPUL): Rewrite to use a local anonymous
893 union type, instead of casting to an int* then a float*.
894 (fcnvsd FPUL,<DR_N>): Likewise.
895 (flds <FREG_N>,FPUL): Likewise.
896 (fsts FPUL,<FREG_N>): Likewise.
900 * configure: Regenerated to track ../common/aclocal.m4 changes.
904 * interp.c (POLL_QUIT_INTERVAL): Define. Used to tweak the
905 frequency at which the poll_quit callback is called.
906 (sim_resume): Use POLL_QUIT_INTERVAL instead of a
911 * interp.c (saved_state.asregs): Add new member pad_dummy.
912 (sim_store_register, sim_fetch_regsiter): Add 1 to rn for use
913 as index into saved_state.asints.
917 * interp.c (sim_open): set endianness based on the ABFD if a -E
918 option is not present and we have an ABFD.
922 * configure: Regenerated to track ../common/aclocal.m4 changes.
924 Sun Apr 26 15:31:55 1998 Tom Tromey <tromey@creche>
926 * configure: Regenerated to track ../common/aclocal.m4 changes.
931 * acconfig.h: New file.
932 * configure.in: Reverted change of Apr 24; use sinclude again.
934 Fri Apr 24 14:16:40 1998 Tom Tromey <tromey@creche>
936 * configure: Regenerated to track ../common/aclocal.m4 changes.
941 * configure.in: Don't call sinclude.
945 * configure: Regenerated to track ../common/aclocal.m4 changes.
949 * configure: Regenerated to track ../common/aclocal.m4 changes.
953 * configure: Regenerated to track ../common/aclocal.m4 changes.
957 * configure: Regenerated to track ../common/aclocal.m4 changes.
961 * interp.c (sim_fetch_register, sim_store_register): Pass in
962 length parameter. Return -1.
966 * configure: Regenerated to track ../common/aclocal.m4 changes.
970 * configure: Regenerated to track ../common/aclocal.m4 changes.
972 Mon Jan 19 22:26:29 1998 Doug Evans <devans@seba>
974 * configure: Regenerated to track ../common/aclocal.m4 changes.
978 * configure: Regenerated to track ../common/aclocal.m4 changes.
983 * configure: Regenerated to track ../common/aclocal.m4 changes.
987 * interp.c (sim_load): Pass lma_p and sim_write args to
992 * configure: Regenerated to track ../common/aclocal.m4 changes.
996 * configure: Regenerated to track ../common/aclocal.m4 changes.
1000 * configure: Regenerated to track ../common/aclocal.m4 changes.
1004 * configure: Regenerated to track ../common/aclocal.m4 changes.
1008 * configure: Regenerated to track ../common/aclocal.m4 changes.
1012 * configure: Regenerated to track ../common/aclocal.m4 changes.
1016 * interp.c (sim_resume): poll_quit() at least once per call;
1017 otherwise gdb can loop sim_resume() uninterruptably.
1019 Thu Sep 4 17:21:23 1997 Doug Evans <dje@seba>
1021 * configure: Regenerated to track ../common/aclocal.m4 changes.
1025 * gencode.c (tab): Order instructions according to SH3 document.
1029 * configure: Regenerated to track ../common/aclocal.m4 changes.
1034 * interp.c (sim_kill): Delete.
1035 (sim_create_inferior): Add ABFD argument.
1036 (sim_load): Move setting of PC from here.
1037 (sim_create_inferior): To here.
1041 * configure: Regenerated to track ../common/aclocal.m4 changes.
1046 * interp.c (sim_open): Add ABFD argument.
1050 * interp.c (get_dr): Avoid SIGFPE by moving integers instead of
1056 * interp.c (XD, SET_XD): Delete.
1057 (XF, SET_XF, XD_TO_XF): Define, move around registers in either
1060 * gencode.c (fmov): Update.
1064 * interp.c (set_fpscr1): From J"orn Rennecke
1069 * interp.c (special_address): New function.
1070 (BUSERROR): Call it. Added parameters bits_written and data.
1071 Changed all callers.
1072 * gencode.c (tab): Fixed ocbwb and pref.
1076 * interp.c (do_wdat, do_wdat): Fix bug in register number calculation.
1080 * interp.c (sim_create_inferior): Clear registers each time an
1081 inferior is started.
1085 * interp.c (*FP, FP_OP, FP_CMP, FP_UNARY): Provide a hook for
1086 when a host doesn't support IEEE FP.
1087 (*DP): Provide alternative definition that supports 64bit floating
1089 (target_little_endian): Combine little_endian and little_endian_p.
1090 (saved_state_type): Make fpscr and sr simple integers.
1091 (SET_FPSCR, GET_FPSCR): Use macros to update fpscr register.
1092 (set_fpscr1): New function. Handle swapping when PR / FR bits
1093 changed. Call via *_FPSCR macro.
1094 (SET_SR*, GET_SR*): Use macro's to access the SR bits - avoids
1097 * gencode.c (tab): Update.
1101 * gencode.c (main): Perform basic checks on tab entries.
1103 * Makefile.in (gencode): Always compile with -g.
1107 * gencode.c (gensim): Move ref checking code to before `stuff'.
1108 For branches with delay slots refs were not being checked.
1110 * interp.c (sim_resume): Use nia to specify the next instruction
1111 address instead of overloading pc.
1112 (C): Delete definiton - refer to cycles directly.
1113 (SEXT12): New macro - sign extend a 12 bit quantity.
1114 (Delay_Slot): Rename from SL.
1116 * gencode.c (tab): Update/simplify.
1118 * gencode.c (gensim): Better formatting of output code.
1119 (gensim): Replace 10 with constant MAX_NR_STUFF- define as 15.
1120 (tab): Sort alphabetically. Break `stuff' into multiple lines.
1124 * gencode.c (braf, bsrf): Fix branch destination calculation to
1125 be in accordance with the documentation.
1129 * interp.c (init_pointers): Fix little endian test.
1133 * interp.c (init_pointers): SH4 hardware is always WORDS_BIT_ENDIAN.
1134 * gencode (fmov from/to memory): take endian_mismatch into account
1135 for 32 bit moves too.
1139 * gencode.c (swap.b): Fix treatment of high word.
1144 * interp.c: experimental SH4 support.
1145 DFmode moves are probaly broken for target little endian.
1149 * interp.c (sim_open): Add callback argument.
1150 (sim_set_callbacks): Delete SIM_DESC argument.
1154 * Makefile.in (SIM_EXTRA_CLEAN): Define.
1155 (clean targets): Delete.
1156 (sh-clean): New target.
1160 * configure: Regenerated to track ../common/aclocal.m4 changes.
1164 * tconfig.in: New file.
1165 * interp.c (sim_open): Handle missing arg to -E.
1169 * Makefile.in: Add clean targets.
1173 * interp.c: Include float.h and define SIGTRAP if _WIN32.
1175 * (trap): Do do SYS_chown for _WIN32.
1179 * interp.c (sim_resume): Fix argument to poll_quit.
1183 * interp.c (sim_stop): New function.
1184 (sim_resume): Use poll_quit for polling.
1188 * Makefile.in (SIM_OBJS): Add sim-load.o.
1189 * interp.c (target_byte_order): Delete.
1190 (sim_kind, myname, little_endian_p): New static locals.
1191 (init_pointers): Use little_endian_p instead of target_byte_order.
1192 (sim_resume): Likewise.
1193 (sim_open): Set sim_kind, myname. Set little_endian_p from -E arg.
1194 (sim_load): Return SIM_RC. New arg abfd. Call sim_load_file to
1195 load file into simulator. Set start address from bfd.
1196 (sim_create_inferior): Return SIM_RC. Delete arg start_address.
1200 * configure: Regenerated to track ../common/aclocal.m4 changes.
1205 * interp.c (sim_open): New arg `kind'.
1207 * configure: Regenerated to track ../common/aclocal.m4 changes.
1211 * configure: Regenerated to track ../common/aclocal.m4 changes.
1215 * interp.c (sim_do_command): Check for NULL command or empty
1216 string and handle it the same as a "help" command. Use callback
1217 to print error message for unrecognized commands. Replace
1218 hardcoded tab in literal string with a \t. Other minor code
1223 * configure: Regenerated to track ../common/aclocal.m4 changes.
1227 * configure: Re-generate.
1231 * configure: Regenerate to track ../common/aclocal.m4 changes.
1235 * interp.c (sim_open): New SIM_DESC result. Argument is now
1237 (other sim_*): New SIM_DESC argument.
1241 * Makefile.in (@COMMON_MAKEFILE_FRAG): Use
1242 COMMON_{PRE,POST}_CONFIG_FRAG instead.
1243 * configure.in: sinclude ../common/aclocal.m4.
1244 * configure: Regenerated.
1248 * configure configure.in Makefile.in: Update to new configure
1249 scheme which is more compatible with WinGDB builds.
1250 * configure.in: Improve comment on how to run autoconf.
1251 * configure: Re-run autoconf to get new ../common/aclocal.m4.
1252 * Makefile.in: Use autoconf substitution to install common
1257 * Makefile.in: Delete stuff moved to ../common/Make-common.in.
1258 (SIM_OBJS,SIM_EXTRA_LIBS): Define.
1259 * configure.in: Simplify using macros in ../common/aclocal.m4.
1260 Call AC_CHECK_HEADERS(unistd.h).
1261 * configure: Regenerated.
1262 * config.in: New file.
1263 * interp.c: #include "config.h". #include <unistd.h> if present.
1264 (trap): Fetch errno value with callback->get_errno.
1268 * interp.c: Don't include windows polling code if inside simluator.
1272 * interp.c: Minor formatting improvements.
1273 (saved_state_type): Add bank registers.
1274 (bp_holder): New function, use to break on when debugging BUSERROR.
1275 (BUSERROR): Call it if bus error occurs.
1279 * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir,
1280 INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set values.
1282 * configure.in (AC_PREREQ): autoconf 2.5 or higher.
1283 (AC_PROG_INSTALL): Added.
1284 * configure: Rebuilt.
1288 * interp.c (saved_state_type): Add memstalls field.
1290 (sim_resume): New local variable memstalls. Add it back in to
1291 saved_state at the end of the function.
1292 (sim_info): Report memstalls.
1293 * gencode.c (tab): Add MA() to the execution string of all
1294 instructions which access memory.
1298 * configure: Regenerate with autoconf 2.7.
1302 * gencode.c (mac.l): Don't abort GDB if executing mac.l
1303 instruction (which is unimplemented). Generate a SIGTRAP (in the
1304 simulated target) instead.
1308 * gencode.c (tab): Added several sh3 opcodes.
1309 (think): Added printonmatch for A_SSR and A_SPC.
1310 * interp.c (SSR, SPC): Added definitions.
1311 (saved_state_type): Added ssr and spc registers.
1315 * gencode.c (tab): In shad/shld definitions, negate R[m] before
1316 the and operation instead of after. For shad delete cast. For shld
1317 use UR instead of R and delete cast.
1321 * gencode.c (tab): Add explicit NaN support for ftrc instruction.
1325 * interp.c: Make target_byte_order be extern to prevent SGI cc from
1326 issuing warnings about the use of common symbols.
1330 * gencode.c: jsr, bsr and bsrf actually save pc+4 in pr, and rts
1335 * sh/interp.c (sim_stop_reason): Catch SIGQUIT and indicate
1337 (sim_get_quit_code): Delete.
1339 * gencode.c (gensim): Indicate SIGILL instead of calling abort for
1344 * interp.c (saved_state_type): Move FP registers to immediately
1349 * Makefile.in (BISON): Remove macro.
1353 * interp.c (trap, case SYS_utime): Cast second arg of utime to
1354 void * to avoid compiler error.
1356 * interp.c (callback): Remove last change. It is initialized by
1357 a sim_set_callbacks call.
1361 * interp.c (callback): Initialize to default callback.
1365 * run.c: Moved to ../common.
1366 * interp.c (trap): Use gdb's callback interface.
1367 * Makefile.in: Updated.
1371 * Makefile.in (maintainer-clean): New synonym for realclean.
1375 * run.c (sim_callback_write_stdout): New.
1376 * interp.c (trap): Call sim_callback_write_stdout when needed.
1380 * interp.c (trap): Remove useless code.
1384 * syscall.h: Copy from newlib.
1388 * gencode.c: Back up PC by 2 for breakpoints.
1389 * interp.c: Move fp regs beyond pc/pr/etc to avoid confusing GDB,
1390 which expect pc to immediately follow regs[].
1394 * configure.in: Define CC_FOR_BUILD. Don't call AC_PROG_INSTALL.
1395 * configure: Rebuild.
1396 * Makefile.in (INSTALL): Revert to using install.sh.
1397 (INSTALL_PROGRAM, INSTALL_DATA): Set to $(INSTALL).
1398 (INSTALL_XFORM, INSTALL_XFORM1): Restore.
1399 (CC_FOR_BUILD): Restore.
1400 (gencode): Build using $(CC_FOR_BUILD).
1401 (install): Don't install in $(tooldir).
1405 (Try to) Update to new bfd autoconf scheme.
1406 * run.c: Don't include sysdep.h.
1407 * Makefile.in (INSTALL{,_PROGRAM,_DATA}): Use autoconf computed value.
1408 (CC, CFLAGS, AR, RANLIB): Likewise.
1409 (HDEFINES, TDEFINES): Define.
1410 (CC_FOR_BUILD): Delete.
1411 (host_makefile_frag): Delete.
1412 (Makefile): Don't depend on frags.
1413 * configure.in (sysdep.h): Don't create symlink.
1414 (host_makefile_frag, frags): Deleted.
1415 (CC, CFLAGS, AR, RANLIB, INSTALL): Compute values.
1416 * configure: Regenerated.
1420 * interp.c: Include <math.h>.
1424 * Makefile.in (run): Link in math library too.
1425 * gencode.c (gensim): abort if an unknown opcode is encountered.
1426 * interp.c (FPSCR, FPUL): Define.
1427 (struct save_state): Add fields for floating point registers,
1429 (sim_resume): Add 'F' for accessing floating point registers
1430 in the save state structure.
1431 * gencode.c: Add sh3e opcodes.
1432 (gensym): Define a buffer for int<->fp conversions.
1436 * interp.c (trap): Use trap vector 34 for host system interface.
1437 * gencode.c: Add 34 to conditional which determines which traps
1438 will be handled by simulator.
1442 * run.c: Include <signal.h>. Define SIGQUIT if not defined.
1443 (main): New variables reason and sigrc. After simulator exits,
1444 check to see if it exited because of a signal, and if so, then
1445 use the signal number as the return value.
1449 * Update all FSF addresses except those in COPYING* files.
1451 Tue Jul 18 23:33:10 1995 Fred Fish <fnf@fishbowl>
1453 * interp.c (trap): Only use SYS_execv if defined. Might be
1454 implemented as execve(arg1,arg2,0), as with Unixware 2.0.
1455 (sim_resume): In sbit initializer, cast shifted arg to unsigned
1456 to avoid signed integer overflow.
1460 * Makefile.in (clean): Remove run, libsim.a.
1461 (distclean, mostlyclean, realclean): Remove Makefile and
1466 * Makefile.in, configure.in: converted to autoconf.
1467 * configure: New file, generated with autconf 2.4.
1471 * interp.c (sim_open): If argument supplied, interpret as
1472 desired memory size.
1473 (parse_and_set_memory_size): New function.
1474 (sim_do_command): New function.
1478 * interp.c (SYS_wait): Define as SYS_wait4 if available and
1479 SYS_wait is not already defined (SunOS 4.1.3 for example).
1480 (SYS_utime): Define as SYS_utimes if available and
1481 SYS_utime is not already defined.
1485 * interp.c: Don't include sys/times.h or sys/param.h
1489 * interp.c (SIGBUS, SIGTERM): Define if not.
1490 (sim_memory_size): default to 2^19 on PCs.
1491 (sim_resume): Poll for quits on win32.
1495 * gencode.c (op_tab): Add SH3 support.
1499 * gencode.c (tab): Add bsrf and braf.
1503 * configure.in: use ../../bfd/hosts/std-host.h, not
1504 ../bfd/hosts/std-host.h (which doesn't exist).
1508 * run.c: parse arguments with getopt().
1512 * configure.in: Use ../../bfd/hosts/std-host.h if specific
1517 * interp.c (macw): Sign extend MACH at bit 10 for non-saturating case.
1521 * gencode.c (op_tab): Make MAC.W call macw, not abort.
1522 * interp.c (macw): New function.
1527 * gencode.c (op_tab): New code for ADDV and SUBV.
1528 Make MAC.L abort sicne it is not implemented.
1530 * interp.c (dmul): Handle the signed case by adjusting after unsigned multiply.
1531 Get rid of __GNUC__ conditional.
1535 * gencode.c (op_tab): Also replace NEGC, and try again with SUBC.
1536 Change ADDC for symmetry.
1538 * gencode.c (op_tab): Replace code for ADDC and SUBC.
1542 * interp.c: Remove def of INLINE. This comes from bfd.h. Also,
1543 declare IOMEM before using it.
1547 * interp.c (BUSERROR): New macro.
1548 ([r|w][bwl]at[little|big]) New functions.
1549 (sim_resume): If GO32 check for interrupt every now
1550 and again. Decrement PC if SIGBUS seen.
1551 * run.c (main): Return result of simulated _exit.
1555 * Makefile.in (gencode): Allow build in different directory.
1559 * Makefile.in (gencode): Change $< to gencode.c for portability.
1563 * interp.c ([wr][bwl]at): New functions.
1564 (trap): Cope with both byte modes.
1568 * gencode.c (tab): Simulate T bit after a negc insn right.
1569 * interp.c (RSBAT): Sign extend the arg.
1570 (ACE_FAST): New macro.
1571 (sim_resume): Remove obsolete test of sim_timeout.
1575 * interp.c (IOMEM): New function, simulates very basic I/O area of
1577 (WBAT, RBAT) : Call I/O functions.
1578 * gencode.c (tab): Special case trapa #3.
1582 * run.c (main): Specify the file type again.
1586 * interp.c (trap): Fix irix incompatibility.
1587 * run.c (main): open without specifying file type.
1591 * interp.c (sim_*): Make result void where there isn't one.
1592 (sim_set_pc): Delete.
1593 (sim_info): Delete printf_fn arg, all callers changed.
1594 Call printf_filtered instead.
1595 (sim_close): New function.
1596 (sim_load): New function.
1597 (sim_create_inferior): Renamed from sim_set_args, all callers changed.
1598 * run.c: #include <varargs.h>, "remote-sim.h".
1599 (printf_filtered): New function.
1603 * gencode.c (table): Get direction of some opcodes right.
1604 (trapa, rte): Implement fully.
1605 * interp.c (trap): Make stat call more portable.
1609 * gencode.c (main, gendefines): New -d option prints table of defines.
1610 * interp.c (trap): Add a load of system calls.
1611 (sim_memory_size): Now default to 8Mbyte.
1612 (PARANOID): Keep vector of registers with undefined contents.
1616 * gencode.c: mova uses aligned addresses
1617 * interp.c (trap): Return results in r0.
1621 * Makefile.in (CSEARCH): Add -I$(srcdir)/../../gdb
1622 * interp.c: #include "remote-sim.h".
1623 (sim_resume): int result, new arg `siggnal'.
1624 (sim_write): Use SIM_ADDR for type of arg `addr'.
1625 (sim_read): Use SIM_ADDR for type of arg `addr'.
1626 Use unsigned char * for `buffer'.
1627 (sim_store_register): int result.
1628 (sim_fetch_register): Ditto.
1629 (sim_stop_reason): Renamed from sim_stop_signal. New arg `reason'.
1630 (sim_set_pc): int result, use SIM_ADDR for type of arg `x'.
1631 (sim_info): int result, new args `verbose', `printf_fn'.
1632 (sim_kill): int result.
1633 (sim_open): int result, new arg `name'.
1634 * run.c: #include <stdio.h>
1635 (main): Update call to sim_info.
1639 * interp.c (sim_stop_signal): Result is now enum sim_stop.
1643 * gencode.c (table): Becomes unsigned.
1644 * interp.c (trap): Get right breakpoint SIGnum. (sim_write,
1645 sim_read): Return number of bytes copied. (sim_store_register):
1646 Value passed by reference. (sim_kill, sim_open, sim_set_args): New functions.
1650 * interp.c (sim_info): Fix small typo in printf string.
1654 * interp.c (sim_resume): Set memory after pointers inited.
1658 * interp.c (get_now): Use time system call.
1659 * Makefile.in: install correctly.
1663 * run.c (main), interp.c (sim_set_timeout): Remove timeout
1666 Thu Jun 24 13:29:57 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
1668 * Makefile.in: don't run indent everytime; also add a space in the
1673 * gencode.c: Fix some opcodes.
1674 * interp.c: Support for profiling and portability fixes.
1675 * run.c (main): Get profiling args.
1679 * gencode.c (tab): Lint for sgi compiler
1680 * interp.c: Lint for sgi compiler.
1684 * run.c (main): Support for resizing simulated RAM.
1685 * Makefile.in: Support for broken makes.
1686 * interp.c, gencode.c: Lint.