Implment backup PC shadowing of CR6.
[platform/upstream/binutils.git] / sim / m32r / ChangeLog
1 Mon Feb 23 12:27:52 1998  Nick Clifton  <nickc@cygnus.com>
2
3         * m32r.c (m32r_h_cr_set, m32r_h_cr_get): Shadow control register 6
4         in the backup PC register.
5 start-sanitize-m32rx
6         * m32rx.c (m32r_h_cr_set, m32r_h_cr_get): Shadow control register 6
7         in the backup PC register.
8 end-sanitize-m32rx
9 Thu Feb 19 16:39:35 1998  Doug Evans  <devans@canuck.cygnus.com>
10
11         * m32r.c (do_lock,do_unlock): Delete.
12         * cpu.[ch],decode.[ch],extract.c,model.c: Regenerate.
13         * sem.c,sem-switch.c: Regenerate.
14 start-sanitize-m32rx
15         * cpux.[ch],decodex.[ch],readx.c,semx.c: Regenerate.
16 end-sanitize-m32rx
17
18 Tue Feb 17 18:18:10 1998  Doug Evans  <devans@seba.cygnus.com>
19
20         * Makefile.in (M32R_OBJS): Add cpu.o.
21         (cpu.o): Add rule for.
22         (NL_TARGET): Define.
23         * configure.in: Add AC_CHECK_PROG(SCHEME).
24         * cpu.c: New file.
25         * cpuall.h,cpu.h,decode.c,decode.h,extract.c,model.c: Regenerate.
26         * sem-switch.c,sem.c: Regenerate.
27         * mloop.in (execute): Update call to semantic fn.
28 start-sanitize-m32rx
29         (M32RX_OBJS): Add cpux.o.
30         (cpux.o): Add rule for.
31         cpux.c: New file.
32         * cpux.h,decodex.c,decodex.h,modelx.c,readx.c,semx.c: Regenerate.
33         * m32rx.c (m32rx_h_accums_{get,set}): Rewrite.
34         (m32rx_h_cr_{get,set}): New functions.
35         (m32rx_h_accums_{get,set}): New functions.
36         * mloopx.in: Rewrite main loop.
37 end-sanitize-m32rx
38
39         * m32r.c (do_trap): Move from here.
40         * sim-if.c (do_trap): To here, and rewrite to use CB_SYSCALL support.
41         (sim_create_inferior): Use h_pc_set.
42         (h_pc_{get,set}): New functions.
43         (h_gr_{get,set}): New functions.
44         (syscall_{read,write}_mem): New functions.
45         * sim-main.h (h_{gr,pc}_{get,set}): Declare.
46
47 Tue Feb 17 12:44:38 1998  Andrew Cagney  <cagney@b1.cygnus.com>
48
49         * sim-if.c (sim_store_register, sim_fetch_register): Pass in
50         length parameter.  Return -1.
51         (sim_create_inferior): Pass 4 sim_store_register.
52
53 Wed Feb 11 19:53:48 1998  Doug Evans  <devans@canuck.cygnus.com>
54
55         * sim-main.h (CIA_GET,CIA_SET): Provide dummy definitions for now.
56
57         * decode.c, decode.h, sem.c, sem-switch.c, model.c: Regenerate.
58 start-sanitize-m32rx
59         * cpux.c, decodex.c, decodex.h, readx.c, semx.c, modelx.c: Regenerate.
60 end-sanitize-m32rx
61
62 Mon Feb  9 19:41:54 1998  Doug Evans  <devans@canuck.cygnus.com>
63
64         * decode.c, sem.c: Regenerate.
65 start-sanitize-m32rx
66         * cpux.h, decodex.c, readx.c, semx.c: Regenerate.
67         * m32rx.c (m32rx_h_accums_set): New function.
68         (m32rx_model_mark_[gs]et_h_gr): New function.
69         * mloopx.in: Rewrite.
70         * Makefile.in (mloopx.o): Build with -parallel.
71         * sim-main.h (_sim_cpu): Delete member `par_exec'.
72         * tconfig.in (WITH_SEM_SWITCH_FULL): Define as 0 for m32rx.
73 end-sanitize-m32rx
74
75 Thu Feb  5 12:44:31 1998  Doug Evans  <devans@seba.cygnus.com>
76
77         * Makefile.in (m32r.o): Depend on cpu.h
78         (extract.o): Pass -DSCACHE_P.
79         * mloop.in (extract{16,32}): Update call to m32r_decode.
80         * arch.h,cpu.h,cpuall.h,decode.[ch]: Regenerate.
81         * extract.c,model.c,sem-switch.c,sem.c: Regenerate.
82         * sim-main.h: #include "ansidecl.h".
83         Don't include cpu-opc.h, done by arch.h.
84 start-sanitize-m32rx
85         * Makefile.in (M32RX_OBJS): Build m32rx support now.
86         (m32rx.o): New rule.
87         * m32r-sim.h (m32rx_h_cr_[gs]et): Define.
88         * m32rx.c (m32rx_{fetch,store}_register): Update {get,set} of PC.
89         (m32rx_h_accums_get): New function.
90         * mloopx.in: Update call to m32rx_decode.  Rewrite exec loop.
91         * cpux.h,decodex.[ch],modelx.c,readx.c,semx.c: Regenerate.
92 end-sanitize-m32rx
93
94 Sun Feb  1 16:47:51 1998  Andrew Cagney  <cagney@b1.cygnus.com>
95
96         * configure: Regenerated to track ../common/aclocal.m4 changes.
97
98 Sat Jan 31 18:15:41 1998  Andrew Cagney  <cagney@b1.cygnus.com>
99
100         * configure: Regenerated to track ../common/aclocal.m4 changes.
101
102 start-sanitize-m32rx
103 Thu Jan 29 11:22:00 1998  Doug Evans  <devans@canuck.cygnus.com>
104
105         * Makefile.in (M32RX_OBJS): Comment out until m32rx port working.
106         * arch.h (HAVE_CPU_M32R{,X}): Delete, moved to m32r-opc.h.
107         * arch.c (machs): Check ifdef HAVE_CPU_FOO for each entry.
108
109 end-sanitize-m32rx
110 Tue Jan 20 14:16:02 1998  Nick Clifton  <nickc@cygnus.com>
111
112         * cpux.h: Fix duplicate definition of h_accums field for
113         fmt_53_sadd structure.
114
115 start-sanitize-m32rx
116 Tue Jan 20 01:42:17 1998  Doug Evans  <devans@seba.cygnus.com>
117
118         * Makefile.in: Add m32rx objs, and rules to build them.
119         * cpux.h, decodex.h, decodex.c, readx.c, semx.c, modelx.c: New files.
120         * m32rx.c, mloopx.in: New files.
121
122 end-sanitize-m32rx
123 Mon Jan 19 22:26:29 1998  Doug Evans  <devans@seba>
124
125         * configure: Regenerated to track ../common/aclocal.m4 changes.
126
127 Mon Jan 19 14:13:40 1998  Doug Evans  <devans@seba.cygnus.com>
128
129         * arch.c, arch.h, cpuall.h: New files.
130         * arch-defs.h: Deleted.
131         * mloop.in: Renamed from mainloop.in.
132         * Makefile.in: Update.
133         * sem-ops.h: Deleted.
134         * mem-ops.h: Deleted.
135 start-sanitize-cygnus
136         Add cgen support for generating files.
137 end-sanitize-cygnus
138         (arch): Renamed from CPU.
139         * cpu.h: New file.
140         * decode.c: Redone.
141         * decode.h: Redone.
142         * extract.c: Redone.
143         * model.c: Redone.
144         * sem-switch.c: Redone.
145         * sem.c: Renamed from semantics.c, and redone.
146         * m32r-sim.h (PROFILE_COUNT_FILLNOPS): Update.
147         (GETTWI,SETTWI,BRANCH_NEW_PC): Define.
148         * m32r.c (WANT_CPU,WANT_CPU_M32R): Define.
149         (m32r_{fetch,store}_register): New functions.
150         (model_mark_{get,set}_h_gr): Prefix with m32r_.
151         (m32r_model_mark_{busy,unbusy}_reg): Prefix with m32r_.
152         (h_cr_{get,set}): Prefix with m32r_.
153         (do_trap): Fetch state from current_cpu, not current_state.
154         Call sim_engine_halt instead of engine_halt.
155         * sim-if.c (alloc_cpu): New function.
156         (free_state): New function.
157         (sim_open): Call sim_state_alloc, and malloc space for selected cpu
158         type.  Call sim_analyze_program.
159         (sim_create_inferior): Handle selected cpu type when setting PC.
160 start-sanitize-m32rx
161         (sim_resume): Handle m32rx.
162 end-sanitize-m32rx
163         (sim_stop_reason): Deleted.
164         (print_m32r_misc_cpu): Update.
165 start-sanitize-m32rx
166         (sim_{fetch,store}_register): Handle m32rx.
167 end-sanitize-m32rx
168         (sim_{read,write}): Deleted.
169         (sim_engine_illegal_insn): New function.
170         * sim-main.h: Don't include arch-defs.h,sim-core.h,sim-events.h.
171         Include arch.h,cpuall.h.  Include cpu.h,decode.h if m32r.
172 start-sanitize-m32rx
173         Include cpux.h,decodex.h if m32rx.
174 end-sanitize-m32rx
175         (_sim_cpu): Include member appropriate cpu_data member for the cpu.
176         (M32R_MISC_PROFILE): Renamed from M32R_PROFILE.
177         (sim_state): Delete members core,events,halt_jmp_buf.
178         Change `cpu' member to be a pointer to the cpu's struct, rather than
179         record inside the state struct.
180         * tconfig.in (WITH_DEVICES): Define here.
181         (WITH_FAST,WITH_SEM_SWITCH_{FULL,FAST}): Define for the cpu.
182
183 Fri Jan 16 12:16:56 1998  Nick Clifton  <nickc@cygnus.com>
184
185         * arch-defs.h (INSN_NAME): Fix typo.
186
187 Mon Dec 15 23:17:11 1997  Andrew Cagney  <cagney@b1.cygnus.com>
188
189         * configure: Regenerated to track ../common/aclocal.m4 changes.
190         * config.in: Ditto.
191
192 Thu Dec  4 09:21:05 1997  Doug Evans  <devans@canuck.cygnus.com>
193
194         * m32r-sim.h (MSPR_ADDR): New macro.
195         (m32r_mspr_device): Declare.
196         (struct _device): Define.
197         * m32r.c (m32r_mspr_device): New global.
198         (device_{io_{read,write}_buffer,error}): New functions.
199         * mem-ops.h (SETMEM*): Use sim_core_write_map, not read map.
200         * sim-if.c: Delete redundant inclusion of cpu-sim.h.
201         (sim_open): Attach device to handle MSPR register.
202         * sim-main.h (WITH_DEVICES): Define as 1.
203         Include cpu-sim.h.
204
205         * configure: Regenerated to track ../common/aclocal.m4 changes.
206
207 Wed Dec  3 18:08:44 1997  Doug Evans  <devans@canuck.cygnus.com>
208
209         * configure.in (SIM_AC_OPTION_ENVIRONMENT): Call.
210         * configure: Regenerated.
211
212 Wed Nov 19 12:17:08 1997  Doug Evans  <devans@canuck.cygnus.com>
213
214         * mem-ops.h: Rename SIM_SIG{ACCESS,ALIGN} to SIM_SIG{SEGV,BUS}.
215         * sim-if.c (sim_open): Call sim_config.
216         (sim_stop_reason): Update call to sim_signal_to_host.
217
218 Tue Nov 18 15:33:48 1997  Doug Evans  <devans@canuck.cygnus.com>
219
220         * Makefile.in (SIM_OBJS): Use $(SIM_NEW_COMMON_OBJS).
221
222 Fri Oct 31 18:46:46 1997  Andrew Cagney  <cagney@b1.cygnus.com>
223
224         * sim-if.c (sim_open): Delete dead call to sim_core_attach.
225
226 Mon Oct 27 12:43:54 1997  Doug Evans  <devans@canuck.cygnus.com>
227
228         * sem-ops.h (U{DIV,MOD}[BHSD]I): Use unsigned division.
229
230 Fri Oct  3 09:28:00 1997  Andrew Cagney  <cagney@b1.cygnus.com>
231
232         * configure: Regenerated to track ../common/aclocal.m4 changes.
233
234 Wed Sep 24 17:38:57 1997  Andrew Cagney  <cagney@b1.cygnus.com>
235
236         * configure: Regenerated to track ../common/aclocal.m4 changes.
237
238 Tue Sep 23 11:04:38 1997  Andrew Cagney  <cagney@b1.cygnus.com>
239
240         * configure: Regenerated to track ../common/aclocal.m4 changes.
241
242 Tue Sep 23 10:19:51 1997  Andrew Cagney  <cagney@b1.cygnus.com>
243
244         * Makefile.in (SIM_ENDIAN, SIM_HOSTENDIAN, SIM_SCACHE,
245         SIM_DEFAULT_MODEL): Delete, moved to common.
246         (SIM_EXTRA_CFLAGS): Update.
247         
248 Mon Sep 22 11:46:20 1997  Andrew Cagney  <cagney@b1.cygnus.com>
249
250         * configure.in (sim_link_links): Configure non-strict memory
251         alignment.
252
253         * configure: Regenerated to track ../common/aclocal.m4 changes.
254
255 Fri Sep 19 17:45:25 1997  Andrew Cagney  <cagney@b1.cygnus.com>
256
257         * configure: Regenerated to track ../common/aclocal.m4 changes.
258
259 Wed Sep 17 17:44:40 1997  Andrew Cagney  <cagney@b1.cygnus.com>
260
261         * sim-if.c (sim_open): Allocate memory under sim-memopt module
262         using sim_do_commandf.
263         (sim_open): Set magic-number at the start.
264         (sim_do_command): Implement.
265
266         * sim-main.h (sim_engine_halt): Map onto engine_halt.
267
268 Mon Sep 15 17:36:15 1997  Andrew Cagney  <cagney@b1.cygnus.com>
269
270         * configure: Regenerated to track ../common/aclocal.m4 changes.
271
272 Thu Sep  4 17:21:23 1997  Doug Evans  <dje@seba>
273
274         * configure: Regenerated to track ../common/aclocal.m4 changes.
275
276 Fri Sep  5 10:21:48 1997  Andrew Cagney  <cagney@b1.cygnus.com>
277
278         * Makefile.in (SIM_OBJS): Add sim-memopt.o module.
279
280 Thu Sep  4 10:30:02 1997  Andrew Cagney  <cagney@b1.cygnus.com>
281
282         * sim-if.c (sim_open): Pass zero modulo arg to sim_core_attach.
283
284 Wed Aug 27 18:13:22 1997  Andrew Cagney  <cagney@b1.cygnus.com>
285
286         * configure: Regenerated to track ../common/aclocal.m4 changes.
287         * config.in: Ditto.
288
289 Tue Aug 26 10:39:42 1997  Andrew Cagney  <cagney@b1.cygnus.com>
290
291         * sim-if.c (sim_kill): Delete.
292         (sim_create_inferior): Add ABFD argument.
293         (sim_load): Move setting of PC from here.
294         (sim_create_inferior): To here.
295         (sim_load): Delete, use sim-hload.c instead.
296
297         * Makefile.in (SIM_OBJS): Add sim-hload.o module.
298
299 Mon Aug 25 17:50:22 1997  Andrew Cagney  <cagney@b1.cygnus.com>
300
301         * configure: Regenerated to track ../common/aclocal.m4 changes.
302         * config.in: Ditto.
303
304 Mon Aug 25 15:54:08 1997  Andrew Cagney  <cagney@b1.cygnus.com>
305
306         * sim-if.c (sim_open): Add ABFD argument.
307
308 Tue Jul 22 10:16:16 1997  Doug Evans  <dje@canuck.cygnus.com>
309
310         * sim-main.h (M32R_DEFAULT_MEM_SIZE): New macro.
311         * sim-if.c (sim_open): Use it.
312
313 Wed Jun  4 12:48:12 1997  Andrew Cagney  <cagney@b1.cygnus.com>
314
315         * sim-main.h (WITH_ENGINE): Disable the common engine for now.
316
317 Tue May 27 14:15:44 1997  Andrew Cagney  <cagney@b1.cygnus.com>
318
319         * sim-if.c (sim_read): Pass NULL cpu to sim_core_read_buffer.
320         (sim_write): Ditto for write.
321
322         * m32r.c (do_trap): Ditto for read/write.
323
324 Tue May 20 10:18:25 1997  Andrew Cagney  <cagney@b1.cygnus.com>
325
326         * sim-if.c (sim_open): Add callback argument.
327         (sim_set_callbacks, sim_callback): Delete.
328         (sim_load): Set STATE_LOADED_P.
329
330 Mon May 19 12:55:42 1997  Andrew Cagney  <cagney@b1.cygnus.com>
331
332         * Makefile.in (SIM_OBJS): Link in sim-abort.o as a stub for
333         sim_engine_abort.
334
335 Mon May  5 12:45:28 1997  Andrew Cagney  <cagney@b1.cygnus.com>
336
337         * sim-if.c (sim_open): Update to reflect changes to core in
338         ../common/.
339         * mem-ops.h (GETMEMQI, GETMEMHI, GETMEMSI, GETMEMDI, GETMEMUQI,
340         GETMEMUHI, GETMEMUSI, GETMEMUDI, SETMEMQI, SETMEMHI, SETMEMSI,
341         SETMEMDI, SETMEMUQI, SETMEMUHI, SETMEMUSI, SETMEMUDI): Ditto.
342
343 Sat May  3 08:38:55 1997  Doug Evans  <dje@seba.cygnus.com>
344
345         * decode.c (decode): Add computed goto support.
346
347 Fri May  2 16:30:26 1997  Andrew Cagney  <cagney@b1.cygnus.com>
348
349         * mem-ops.h: Stub additional core read/write arguments.
350
351         * sim-main.h: Declare sim_cia - type SI.
352         (struct _sim_cpu): Move base type to end per common.
353         (struct _sim_state): Ditto.
354
355 Thu May  1 11:15:34 1997  Doug Evans  <dje@canuck.cygnus.com>
356
357         Merge from branch into devo.  CGEN generic files moved to common
358         directory.  K&R C support is no longer provided.
359
360 Thu Apr 24 00:39:51 1997  Doug Evans  <dje@canuck.cygnus.com>
361
362         * configure: Regenerated to track ../common/aclocal.m4 changes.
363
364 Sat Apr 12 12:57:33 1997  Felix Lee  <flee@yin.cygnus.com>
365
366         * Makefile.in, seman-cache.c: new file, for wingdb build.
367         * sim-alloca.h: fixed for wingdb.
368         
369 Mon Apr  7 13:33:29 1997  Doug Evans  <dje@seba.cygnus.com>
370
371         * decode.c (*): m32r_cgen_insn_table renamed to ..._entries.
372         * mainloop.in: Use CGEN_INSN_INDEX instead of CGEN_INSN_TYPE.
373         * simdefs.h (INSN_NAME): m32r_cgen_insn_table renamed to ..._entries.
374
375 Fri Apr  4 19:23:12 1997  Doug Evans  <dje@canuck.cygnus.com>
376
377         * cgen-utils.in (ex_illegal): Fill in abuf->length, abuf->addr.
378         (exc_illegal): Likewise.
379         * decode.c (decode_vars): Add decode_illegal.
380         * genmloop.sh: #include "cpu-opc.h".
381         * sem-switch.c (case_INSN_ILLEGAL): Declare.
382         (labels): Add case_INSN_ILLEGAL.
383         (SWITCH): Add INSN_ILLEGAL case.
384
385 Wed Mar 26 12:34:00 1997  Doug Evans  <dje@canuck.cygnus.com>
386
387         * model.c (model_module): Use 0 not NULL.
388
389         * genmloop.sh (sim_main_loop): Handle k&r c.
390
391         * sem-switch.c: Regenerate to get k&r c support.
392         * semantics.c: Likewise.
393
394         * m32r.c (ADD_{OV,CA}_SI,SUB_{OV,CA}_SI): Renamed to {ADD,SUB}[OC]FSI.
395         (ADDCSI,SUBCSI): New functions.
396         * sem-switch.c (addv,addv3,addx,subv,subx): Fix carry bit handling.
397         * semantics.c (addv,addv3,addx,subv,subx): Fix carry bit handling.
398
399         * simcache.c (simcache_{install,init,uninstall}): Use
400         DECLARE_MODULE_INSTALL_HANDLER.
401         (simcache_option_handler): Use DECLARE_OPTION_HANDLER.
402
403         * utils.c: #include "semops.h".
404
405 Tue Mar 11 14:30:26 1997  Doug Evans  <dje@seba.cygnus.com>
406
407         * profile.c (profile_print_simcache): Fix thinko in printf text.
408
409         * simdefs.h (struct argbuf): Add member to fmt_20 so it's not empty.
410
411 Mon Mar 10 11:06:29 1997  Doug Evans  <dje@seba.cygnus.com>
412
413         * m32r.c (h_cr_get): Rewrite.
414         (h_cr_set): Rewrite.
415         * sem-switch.c (rte): bcarry renamed to bcond.
416         * semantics.c (rte): Likewise.
417         * simdefs.h (CPU_STATE): Likewise.
418
419         * config.in (HAVE_SYS_TIME_H): Add.
420         * configure.in: Check for sys/time.h.
421         * configure: Regenerated.
422         * utils.c: Include sys/time.h if present.
423
424         * common.c (sim_parse_args): Account for NULL terminating entry
425         in long_options table.
426
427         * genmloop.sh (RUN_FAST_P): Don't run fast if tracing.
428         Always use cache if configured in.
429         * mainloop.in (do_extract_insn{16,32}): New functions.
430         (normal,fast): Call them.  Handle starting in left slot.
431         * simcache.c (simcache_option_handler): Disallow -c0.
432         * sem-switch.c (TRACE_RESULT): Redefine so no tracing.
433
434         * profile.c (profile_print_simcache): Fix percentage calc.
435
436         * Makefile.in (INCLUDE_DEPS): Delete simcommon.h.
437
438 Sun Mar  9 20:42:17 1997  Doug Evans  <dje@seba.cygnus.com>
439
440         * Makefile.in (COMMON_{PRE,POST}_CONFIG_FRAG): Add delimiters for.
441         (M32R_INCLUDE_DEPS): Use cpu-sim.h instead of m32r-sim.h.
442         Add mod-list.h.
443         (mrun.o): Don't depend on M32R_INCLUDE_DEPS.
444         (sim-if.o,m32r.o,utils.o): Likewise.
445         (common.o): Don't explicitly depend on mod-list.h.
446         (mainloop.c): Pass CPU to genmloop.sh.
447         (stamp-modules): Depend on configure.
448         (decode.o): Depend on decode,h, memops.h, semops.h, cpu-opc.h.
449         (extract.o): Depend on decode.h, memops.h, semops.h.
450         (semantics.o,seman-cache.o): Likewise.
451         (model.o,ops.o): Depend on memops.h.
452         (extr-cache.o): Disable building for the moment.
453
454         * simcommon.h: Delete, move contents into cgen-sim.h.
455         * cgen-sim.h: Don't include ansidecl.h,bfd.h,simfns.h.
456         (UINT,CGEN_CAT3): Define.
457         ({extract,semantic}_fn_t): Renamed to {EXTRACT,SEMANTIC}_FN.
458         (decode_t): Renamed to DECODE.
459
460         * simfns.h: Delete, contents moved to memops.h,semops.h.
461         * memops.h: New file.
462         * semops.h: New file.
463         * decode.h: Renamed from semantics.h.
464
465         * sim-argv.h: New file.
466         * Makefile.in (memory.o,trace.o,profile.o,simcache.o,common): Add
467         dependency of sim-argv.h.
468
469         * sim-alloca.h: New file.
470         * common.c: Include it.
471         * Makefile.in (common.o): Add dependency.
472
473         * config.in (HAVE_TIME_H,HAVE_SYS_RESOURCE_H): Add.
474         (HAVE_GETRUSAGE,HAVE_TIME): Add.
475         * configure.in: sinclude ../common/aclocal.m4.
476         Check for headers time.h, sys/resource.h.
477         Check for functions time, getrusage.
478         (sim_link_{files,links}): Add link cpu-opc.h.
479         (sim_profile): Add simcache.
480         (SIM_AC_PROFILE): Add simcache, profile.o.
481         (simcache module): Delete extr-cache.o for now.
482         (--enable-sim-cache): Allow specification of default cache size.
483         * configure: Regenerated.
484
485         * decode.c: #include cgen-sim.h,memops.h,semops.h,decode.h,
486         cpu-sim.h,cpu-opc.h.  Don't include m32r-sim.h.
487         Regenerate.
488
489         * extract.c: #include cgen-sim.h,decode.h,cpu-sim.h.
490         Don't include m32r-sim.h.
491         (*): Define/Undef FLD macro.  Use it to reference ARGBUF.
492         Simplify profiling test with PROFILE_MODEL_P.
493         (mvfc,mvtc): Fix access of control registers.
494         * semantic.c: #include cgen-sim.h,memops.h,semops.h,decode.h,cpu-sim.h.
495         Don't include m32r-sim.h.
496         (*): Define/Undef FLD macro.  Use it to reference ARGBUF.
497         Simplify profiling test with PROFILE_MODEL_P.
498         (mvfc,mvtc): Fix access of control registers.
499
500         * sem-switch.c: New file, for GCC computed goto support.
501
502         * genmloop.sh: Add #include's of bfd.h,callback.h,cgen-sim.h,
503         memops.h,semops.h,trace.h,cpu-sim.h.
504         (RUN_FAST_P): Change default to run fast if cache size > 0
505         and not profiling.
506         (sim_main_loop): Record execution time.
507         Record instruction count even in fast mode.
508         (init): Allow cpu to provide init code in mainloop.in.
509         (FAST): Define as 0 or 1 depending on fast mode.
510         * mainloop.in (normal): Combine with fast case.
511         Add support for GCC computed gotos.  Count simcache hits/misses.
512         (init): Initialize "switch" labels if GNUC.
513
514         * cgen-utils.in: Don't include opcode/cgen.h.
515         Include cgen-sim.h, cpu-opc.h.
516         * common.c: Don't include simcommon.h,mod-list.h.  Include cgen-sim.h.
517         * m32r-sim.h: Don't include mod-list.h
518         (RUN_FAST_P): Delete.
519         * m32r.c: Don't include profile.h.  #include ansidecl.h,cgen-sim.h,
520         semops.h,memory.h,trace.h
521         (h_cr_get,h_cr_set): New functions.
522         * memory.c: #include cgen-sim.h,callback.h.
523         * ops.c: Don't include profile.h,m32r-sim.h.
524         Include cgen-sim.h,memops.h,cpu-sim.h.
525         (MEMOPS_DEFINE_INLINE): Renamed from SIMFNS_DEFINE_INLINE.
526         * trace.c: Include cgen-sim.h,cpu-opc.h.
527         * trace.h (trace_insn_{init,fini}): Declare.
528
529         * model.c: Don't include signal.h,stdlib.h,m32r-sim.h.
530         Include cgen-sim.h,cpu-sim.h,cpu-opc.h.
531         Regenerate to get new insn aliases.
532
533         * mrun.c: #include "ansidecl.h".
534         (STATE): Use struct sim_state instead.
535
536         * profile.c: Surround #include <stdlib.h> with HAVE_STDLIB_H.
537         Don't include simcommon.h.  Include cgen-sim.h,cpu-opc.h.
538         (PROFILE_{READ,WRITE}_MASK): Replace with PROFILE_MEMORY_MASK.
539         (profile_print_simcache): New function.
540         (profile_print): Call it.  Print simulator speed stats.
541         * profile.h (PROFILE_{READ,WRITE}_MASK): Replace with
542         PROFILE_MEMORY_MASK.
543         (MODULE_PROFILE_SIMCACHE_P): Define.
544         (PROFILE_SIMCACHE_MASK): Define.
545         (PROFILE_COUNT): New members total_insn_count,exec_time.
546         New members simcache_hits,simcache_misses.
547         (PROFILE_SIMCACHE_{HITS,MISSES}): Define.
548         (PROFILE_MODEL_P): New macro.
549         (PROFILE_COUNT_SIMCACHE_{HIT,MISS}): New macros.
550
551         * sim-if.c: Surround #include <stdlib.h> with HAVE_STDLIB_H.
552         Don't include simcommon.h,m32r-sim.h.  Include cgen-sim.h,cpu-sim.h.
553         (sim_resume): Use USING_SIMCACHE_P instead of RUN_FAST_P.
554         (sim_info): Pass verbose to profile_print.
555
556         * simcache.c: Include cgen-sim.h,callback.h.
557         (USING_SIMCACHE_P): Replace with SIMCACHE_P.
558         (simcache_option_handler): Ensure cache size at least 2.
559         Allow config time specification of default cache size.
560         * simcache.h (struct simcache): Support GCC computed gotos.
561         (SIMCACHE_DEFAULT_CACHE_SIZE): USe CONFIG_SIM_CACHE_SIZE if defined.
562         (USING_SIMCACHE_P): New macro.
563
564         * simdefs.h: Don't include m32r-opc.h.
565         (CGEN_MAX_SIM_INSNS): Define.
566         (CPU_STATE): Regenerate.
567         (ARGBUF): Regenerate.
568         (extract,semantic handler decls): Delete, moved to decode.h.
569
570         * tconfig.in: Don't include cgen-sim.h,m32r-sim.h.
571         (USE_SEM_SWITCH): Define.
572
573         * utils.c: Include bfd.h,time.h,sys/resource.h.
574         (sim_time_get,sim_time_elapsed): New functions.
575         * cgen-sim.h (SIM_TIME,sim_time_get,sim_time_elapsed): Declare.
576
577 Fri Jan 31 20:25:06 1997  Doug Evans  <dje@canuck.cygnus.com>
578
579         * configure.in (AC_CHECK_HEADERS): Handle i386-windows.
580         * configure: Regenerated.
581         * model.c: #include <stdlib.h>.
582         * simcache.c: #include "libiberty.h".
583         * simcommon.h (alloca): Handle i386-windows.
584
585         * common.c: #include libiberty.h.
586         (sim_signal_to_host): Return 5 if wingdb.
587
588 Mon Jan 27 15:22:49 1997  Doug Evans  <dje@seba.cygnus.com>
589
590         * configure.in (sim_cache): Enabled by default now, pass default
591         cache size to --enable-sim-cache.
592         * simcache.c (simcache_option_handler): Allow -c 0.
593
594         * simdefs.h,simfns.h: Regenerate
595         * decode.c,extract.c,model.c,ops.c,semantics.c: Regenerate.
596
597 Tue Jan 21 16:21:01 1997  Doug Evans  <dje@seba.cygnus.com>
598
599         Add model profiling support.
600         * configure.in: Handle --enable-sim-model.
601         (sim_profile): Add model.
602         * Makefile.in (model.o): Add rule.
603         * cgen-sim.h (UNIT,INSN_TIMING,MACH,MODEL): New types.
604         * extract.c (*): Add model profiling support.
605         * m32r.c (model_mark_{get,set}_h_gr): New functions.
606         (model_mark_{busy,unbusy}_reg): New functions.
607         * profile.c (profile_option_handler): Recognize --profile model.
608         (profile_print_model): New function.
609         (profile_print): Call it.
610         * profile.h (MODULE_profile_model,MODULE_PROFILE_MODEL_P): Define.
611         (PROFILE_MODEL_MASK,PROFILE_LABEL_WIDTH): Define.
612         (PROFILE_COUNT): New members cycle_count,cti_stall_count,
613         load_stall_count,taken_count,untaken_count.
614         * semantics.c (*): Add model profiling support.
615         * simcommon.h (struct sim_state): New members mach,model.
616         * simdefs.h (CPU_PROFILE,MODEL_TYPE,UNIT_TYPE): New type.
617         (MAX_MODELS,MAX_UNITS): Define.
618         * tconfig.in (STATE_EXTRA_MEMBERS): Add cpu_profile.
619
620         * Makefile.in (INCLUDE_DEPS): Add $(SIM_MODULES_HDRS).
621         (stamp-modules): Depend on genmodlist.sh.
622         * common.c (standard_options): Add --max-insns.
623         (copy_argv): New function.
624         * tconfig.in (SIM_HAVE_MAX_INSNS): Define.
625         * genmloop.sh: Allow mainloop.in to contain support code.
626         * mainloop.in: Move do_insn16,do_insn32 here.
627         * m32r.c (do_trap): Handle SYS_argvlen,SYS_argv,SYS_read.
628         * sim-if.c (sim_open): Don't set max insn count.
629         (sim_create_inferior): Save argv,envp.
630         * simcommon.h (struct sim_state): New members argv,envp.
631         * simdefs.h ([GS]ETTWI,[GS]ETTUWI,[GS]ETTAI): Define.
632         ([GS]ETMEMWI,[GS]ETMEMUWI,[GS]ETMEMAI): Define.
633         (ARGBUF): New members h_gr_get, h_gr_set.
634         * trace.c (trace_insn_init,trace_insn_fini): New functions.
635         (trace_printf): Print to buffer, output later by trace_insn_fini.
636         * trace.h (TRACE_INSN_{INIT,FINI}): Define.
637
638 Thu Dec 19 16:01:59 1996  Doug Evans  <dje@canuck.cygnus.com>
639
640         * configure.in (AC_FUNC_ALLOCA): Call.
641         * configure: Regenerate.
642         * config.h (HAVE_ALLOCA_H): Add.
643         * simcommon.h: Add alloca support.
644         (DECLARE_MODULE_INSTALL_HANDLER): Define.
645         (DECLARE_OPTION_HANDLER): Define.
646         (MEM_FN): Declare using PARAMS.
647         (DECLARE_MEM_FN): Define.
648         * trace.c (trace_result): Tweak for !STDC.
649         * cgen-sim.h (UDI_FN_SUPPORT): Define if ! HAVE_LONGLONG.
650         * cgen-utils.in (disasm_sprintf): Fix va_arg call in !STDC case.
651         * common.c (sim_print_help_fn): Use PARAMS.
652         (standard_option_handler): Fix decl for !STDC systems.
653         * memory.c: #include <stdio.h>
654         (mem_flat_{install,init,uninstall}): Fix decl for !STDC systems.
655         (mem_flat_{read,write},mem_flat_option_handler): Likewise.
656         * profile.c (profile_install): Likewise.
657         (profile_option_handler): Likewise.
658
659 Thu Dec 19 11:06:19 1996  Doug Evans  <dje@seba.cygnus.com>
660
661         * semantics.c (*): Don't suffix big unsigned numbers with "U".
662         Prefix them with 0x instead.
663
664         * cgen-sim.h (DI_FN_SUPPORT): Define if ! HAVE_LONGLONG.
665         (SLADI,SRADI,CONVSIDI,CONVDISI): Delete, moved to simfns.h.
666         * semantics.c (machi,maclo,macwhi,macwlo,mulhi,mullo): Implement.
667         (mulwhi,mulwlo,mvtachi,mvtaclo,rac,rach): Implement.
668         * simfns.h: Add decls for functional DI,UDI,SF,DF,XF,TF support.
669         Add support for boolean and/or.
670         * utils.c: Redo naming of DI functional support.
671         (ANDDI,ORDI,ADDDI,MULDI,GEDI,LEDI,CONVHIDI): New functions.
672
673 Tue Dec 17 12:57:48 1996  Doug Evans  <dje@seba.cygnus.com>
674
675         * Directory created.