Let autoconf determine if host is big endian or not
[binutils-gdb.git] / sim / ppc / ChangeLog
1 Tue Nov 28 13:38:26 1995 Michael Meissner <meissner@tiktok.cygnus.com>
2
3 * sim-endian.h: Look at WORDS_BIGENDIAN to determine if the host
4 is big endian or little endian. For SWAP_n, use htonl/htons if
5 host is little endian, not big endian and if WITH_NTOH is defined.
6
7 * configure{,.in} (--enable-sim-model-issue): Instead of defining
8 0/1, define it to be MODEL_ISSUE_{PROCESS,IGNORE}. Add
9 AC_C_BIGENDIAN to determine if the host is big endian or not.
10 * config.in: Regenerate.
11
12 * std-config.h (WITH_MODEL_ISSUE): Default to 0.
13 (CURRENT_MODEL_ISSUE): Reference WITH_MODEL_ISSUE, and if that is
14 0, use current_model_issue.
15 (MODEL_ISSUE_{PROCESS,IGNORE}): Define as -1/1.
16
17 * psim.c (current_model_issue): New global variable.
18
19 * cpu.c (cpu_create): Use CURRENT_MODEL_ISSUE > 0 instead of
20 WITH_MODEL_ISSUE.
21 (cpu_{init,halt}): Ditto.
22 * mon.c (mon_print_info): Ditto.
23 * ppc-instructions (PPC_INSN_* macros, branch handling): Ditto.
24
25 * mon.c (mon_print_info): Print instructions/second if verbose > 0,
26 rather than > 1.
27
28 * main.c (main): Set current_model_issue to MODEL_ISSUE_PROCESS if
29 the -I switch is used.
30 * sim_calls (sim_open): Ditto.
31
32 * ppc-instructions (model support): Add support for determining
33 when we don't have enough writeback slots. Add tracing for the
34 beginning of each cycle.
35
36 Mon Nov 27 17:46:33 1995 Michael Meissner <meissner@tiktok.cygnus.com>
37
38 * mon.c: Check for whether to include sys/types.h and sys/time.h.
39
40 * configure.in: Check for include files sys/types.h and
41 sys/time.h.
42 * configure: Regenerate.
43 * config.in: Regenerate.
44
45 * cpu.h (CONST_ATTRIBUTE): Define as __attribute__((__const__)) if
46 not already defined.
47 (cpu_system): Use CONST_ATTRIBUTE, so that when we're not inlining
48 the world, the optimizer has a fair chance of CSE'ing function
49 calls.
50 (cpu_{monitor,nr,registers,model}): Ditto.
51
52 * std-config.h (MODEL_INLINE): If not defined, define as 1 if
53 DEFAULT_INLINE is non-zero, 0 otherwise, rather than just the
54 value of DEFAULT_INLINE.
55
56 Fri Nov 24 11:24:34 1995 Michael Meissner <meissner@tiktok.cygnus.com>
57
58 * lf.h (__attribute__): If not GCC and at least 2.7.0, define as
59 nothing.
60 (lf_printf): Add printf __attribute__, so the compiler will
61 automatically check the format string.
62
63 * configure{,.in} (--enable-sim-icache): If argument is define,
64 add -R to flags passed to igen.
65
66 * igen.c (stdlib.h): Include if the system supplies one.
67 (semantics_use_cache_struct): New global for -R flag to say
68 semantics is to use the cache structure directly rather than
69 putting the values into local variables.
70 (first_undef, last_undef): New structures to remember names to
71 #undef if -R.
72 (lf_print_c_extraction): If -R and this is semantics, emit names
73 as #defines pointing to the cache structure, rather than loading
74 the values into local variables.
75 (lf_print_c_semantic_function): If -R, #undef all of the names
76 defined in lf_print_c_extraction.
77 (main): Recognize -R.
78
79 * idecode_fields.h (SPR_*): Redefine spr_* macros as SPR_* to
80 avoid a name confict if -R passed to igen.
81
82 * ppc-instructions (mfspr, mtspr): Rename spr field to SPR.
83 (model_data): Add field to count the various # of CRs that the
84 mtcrf instruction used.
85 (model_mon_info): Return structures counting the # of CRs that the
86 mtcrf instruction used.
87 (branches, sync instructions): Do not call model functions if
88 WITH_MODEL_ISSUE is 0.
89
90 * mon.c (stdlib.h): Include if the system supplies one.
91 (mon_sort_instruction_names): New function to sort instruction
92 names alphabetically.
93 (mon_print_info): Call qsort with mon_sort_instruction_names to
94 sort instruction names. Don't abort if WITH_MODEL_ISSUE is 0.
95
96 * debug.h (ITRACE): Make printf_filtered arguments type correct.
97 * idecode_expression.h (CR0_COMPARE): Ditto.
98 * psim.c (psim_read_register): Ditto.
99
100 * igen.c (lf_print_my_prefix): Use __attribute__((__unused__)) to
101 silence compiler warnings about unused automatically generated
102 variables.
103 (lf_print_c_extraction): Ditto.
104 * idecode_expression.h (FPSCR_BEGIN): Ditto.
105
106 * ppc-cache-rules: Define rules for making a bitmask for all
107 registers.
108
109 * ppc-instructions: Rewrite model specific functions to use the
110 bitmask of the register number, instead of using the register
111 pointer to get the register number, and then making the bitmask.
112
113 Wed Nov 22 15:24:27 1995 Michael Meissner <meissner@tiktok.cygnus.com>
114
115 * ppc-instructions (model_branches): Add conditional argument to
116 count the number of times each type of conditional branch is used.
117 (conditional branches): Pass B0 or -1 to model_branches.
118 (model_mon_info): Print out conditional branch counts.
119 (model-data): Add support for printing out conditional branch
120 types.
121
122 Tue Nov 21 16:31:25 1995 Michael Meissner <meissner@tiktok.cygnus.com>
123
124 * igen.c (insn_table_load_insns): Add support for model-static for
125 internal functions that should not be inlined.
126 (lf_print_c_semantic): Remove model_cleanup.
127 (gen_model_{c,h}): Ditto.
128
129 * ppc-instructions: Redo model specific support once again. Add
130 floating point support to the model specific information. Flesh
131 out all of the floating mutiply add/subtract instructions. Add
132 better tracing support to the model specific information.
133
134 Sun Nov 19 23:00:52 1995 Michael Meissner <meissner@tiktok.cygnus.com>
135
136 * ppc-instructions (model data, model_busy): Rather than using a
137 bit mask for the busy units, just use a char array. Also, only
138 support 2 function units an insn can use, rather than a loop.
139
140 Fri Nov 17 14:08:08 1995 Michael Meissner <meissner@tiktok.cygnus.com>
141
142 * table.c (table_entry_read): Move setting entry->line_nr to after
143 the model specific fields so the line numbers for the annex are
144 correct.
145
146 * cpu.c (cpu_{create,init,halt}): Check for WITH_MODEL_ISSUE
147 before calling the model functions.
148
149 * debug.c (trace_descriptor): Add trace_model support.
150 * debug.h (trace_options): Ditto.
151
152 * igen.c (gen_icache_h): Create type idecode_cache as void if not
153 caching instructions.
154 (gen_model_{c,h}): Drop model_issue support. Add support for
155 model_cleanup.
156 (lf_print_my_prefix): Initialize a const itable_index with the
157 current index.
158 (lf_print_c_semantic): Call model_cleanup at the end of the
159 function to check for instructions that aren't supported yet by
160 the scheduling code.
161
162 * mon.h (count_type): New type for counters.
163 * mon.c: Use count_type instead of unsigned.
164
165 * ppc-instructions: Redo scheduling code once again. Make it all
166 inline friendly. Instead of having general code emitted by igen,
167 go the route of having each semantic routine call the appropriate
168 module.
169
170 Thu Nov 16 09:52:26 1995 Michael Meissner <meissner@tiktok.cygnus.com>
171
172 * table.c (table_entry_read): Allow the annex to have blank lines.
173
174 * ppc-instructions: Change lines in model stuff that just have a
175 tab to just newline. Add 601 support. Document most instructions
176 in terms of model specific timing information. Drop 'FUNCTION'
177 from PPC_FUNCTION_UNIT_xxx enums. Change PPC_UNIT_UNKNOWN ->
178 PPC_UNIT_BAD. Add TRACE(trace_tbd) for all data cache
179 instruction.s. Signal illegal instruciton if data cache block
180 invalidate is issued from problem state.
181
182 * igen.c (max_model_fields_len): New static to keep track of the
183 max size for the model specific fields.
184 (model_c_insn): Use max_model_fields_len to size fields.
185 (insn_table_insert_insn): Set max_model_fields_len.
186 (model_table_insert): Ditto.
187 (gen_model_{c,h}): Model_issue is now called with a processor
188 argument.
189
190 * debug.c (trace_description): Add support for trace_tbd.
191
192 * mon.c (mon_issue): Pass processor argument to model_issue.
193
194 * Makefile.in: Delete all function unit support, since the newer
195 table driven model support replaces it.
196 * cpu.{c,h}: Ditto.
197 * mon.c: Ditto.
198 * inline.{c,h}: Ditto.
199 * std-config.h: Ditto.
200 * options.c: Ditto.
201 * configure{,.in}: Ditto.
202 * Makefile.in: Ditto.
203 * psim.c: Ditto.
204 * function_unit.{c,h}: Delete these now usused files.
205
206 * std-config.h (WITH_MODEL_ISSUE): Add new macro on whether to
207 trace instructions in a model specific manor.
208 * options.c (print_options): Print it out.
209 * configure{,.in}: Add --enable-sim-model-issue option.
210 * Makefile.in: Add --enable-sim-model-issue flags.
211 * igen.c (lf_print_c_semantic): Add call to mon_issue here. Check
212 for WITH_MODEL_ISSUE.
213 * mon.c (mon_issue): Remove call to mon_issue_here.
214
215 * ppc-instructions: Move branch tracing to the actual branch
216 instructions, rather than testing it in model_issue. Add code to
217 code successful/unsuccessful branch predictions, and the number of
218 conditional branches that fell through.
219
220 Wed Nov 15 17:32:13 1995 Michael Meissner <meissner@tiktok.cygnus.com>
221
222 * cpu.h (cpu_model): Add declaration.
223
224 * cpu.c (struct _cpu): Add model_ptr to hold model specific
225 information.
226 (cpu_model): Return the model internal pointer.
227 (cpu_{create,init,halt}): Call the appropriate model function.
228
229 * inline.c (mon.c): Move include of mon.c after model.c.
230
231 * mon.c (_cpu_mon): Add fields to count unaligned memory
232 references.
233 (mon_issue): Call model_issue, not function_unit_issue.
234 (mon_{read,write}): Count # of unaligned memory accesses.
235 (mon_print_info): Switch to calling model_mon_info and
236 model_mon_info_free instead of function_unit version. Print out
237 number of unaligned reads/writes.
238
239 * {ppc-instructions,igen.c}: More global changes to add model
240 specific features.
241
242 * inline.{c,h}: Provide for inlining options.c.
243 * options.{c,h}: Ditto.
244 * std-config.h: Add OPTIONS_INLINE.
245
246 Tue Nov 14 04:47:25 1995 Michael Meissner <meissner@tiktok.cygnus.com>
247
248 * Makefile.in (devices.o, main.o): Update dependency.
249
250 * igen.c (gen_model_h): Use correct variable in loop.
251 (gen_model_c): Use strcmp, strcasecmp.
252 (gen_model_c): Use EXTERN_MODEL for arrays.
253 (gen_model_h): Use STATIC_MODEL for arrays.
254 (lf_print_c_semantic_function_header): Delete unused function.
255
256 * main.c (cpu.h): Include cpu.h to get model.h.
257
258 * inline.h ({EXTERN,STATIC}_MODEL): Define.
259
260 Mon Nov 13 09:14:13 1995 Michael Meissner <meissner@tiktok.cygnus.com>
261
262 * igen.c ({insn,model}_table_fields): Spell mnemonic correctly.
263 (gen_itable_h,itable_c_insn): Ditto.
264 (model support): Move model support around, add support for
265 model-data, model-internal. Use annex field for model-macros
266 now.
267
268 * configure.in (--enable-sim-inline): If --enable-sim-inline=no,
269 also define INLINE as nothing.
270 * configure: Regenerate.
271
272 * std-config.h (INLINE): Rather than nuking INLINE, only define it
273 as __inline__ if any of the INLINE flags are non-zero.
274
275 * options.c (print_options): Print out WITH_XOR_ENDAIN.
276
277 Mon Nov 13 23:03:45 1995 Andrew Cagney <cagneyhighland.com.au>
278
279 * ppc-instructions (rfi): Add missing code.
280
281 * cpu.c (cpu_get_time_base): Fix calculation of current value of
282 time base register.
283
284 * ppc-spr-table (TBL, TBU): Fix TBL/TBU entries - was confusing
285 m[tf]tb with m[tf]spr.
286
287 * ppc-instructions (mtspr, mfspr): Fix mttbl - wasn't storing
288 lower word.
289
290 Mon Nov 13 21:35:37 1995 Andrew Cagney <cagneyhighland.com.au>
291
292 * std-config.h (INLINE, STATIC_INLINE): Was being set to static
293 inline.. Only problem being that with ppc-opcode-simple this gave
294 it the chance to inline all the idecode functions with potentially
295 disasterous results on a 16mb PC. For moment hobble INLINE.
296
297 * configure.in, std-config.h (WITH_SMP): Make that 5 processors by
298 default ...
299
300 * configure.in: Tweek flags passed to gcc for --with-sim-warnings.
301 Firstly make them errors and secondly remove the options gcc-245
302 doesn't reconize.
303
304 Mon Nov 13 17:57:24 1995 Andrew Cagney <cagney@highland.com.au>
305
306 * misc.c (zalloc), cpu.c (cpu_init), devices
307 (console_io_read_buffer_callback, icu_io_read_buffer_callback,
308 vm_io_read_buffer_callback), main.c (zalloc), mon.c (memset),
309 sim_calls.c (zalloc) : replace bzero() with memset().
310
311 * emul_netbsd.c (write_direntries), psim.c (psim_read_register,
312 psim_write_register): replace bcopy() with memcpy().
313
314 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
315
316 * configure.in: for --disable-sim-inline (--enable-sim-inline=no),
317 force DEFAULT_INLINE to 0 rather then trusting the std
318 configuration.
319
320 Sun Nov 12 20:55:41 1995 Andrew Cagney <cagneyhighland.com.au>
321
322 * igen.c (lf_print_idecode_table, idecode_table_leaf): Fix
323 generation of switch entries in tables - treat the same as
324 cracking/semantic functions.
325
326 * igen.c (idecode_switch_end, idecode_switch_leaf): Fix generation
327 of a boolean switch statement (field zero or non-zero).
328
329 * ppc-opcode-test-1, ppc-opcode-test-2: New files. These test the
330 switch/table generation ability of igen.
331
332 * igen.c (idecode_switch_leaf): Fix code output when a switch
333 statement needs to look up a table.
334
335 * igen.c (idecode_declare_if_switch): New function called from
336 gen_idecode_c - need to declare any idecode switch functions
337 before they are used in idecode tables.
338
339 * igen.c (lf_print_c_cracker_function, idecode_crack_leaf,
340 idecode_crack_insn): Add is_inline_function argument to code
341 printing cracker functions which indicates if STATIC_IDECODE or
342 STATIC_INLINE_IDECODE should be used for definition. For
343 idecode_crack_insn (which implies not duplicating/expanding) don't
344 declare function as inline - we assume that the only time this is
345 code is generated is when things are being tested. For
346 idecode_crack_leaf, make static (instead of INLINE) if the
347 instructions parent is a table as function will always be called
348 via a table.
349
350 * igen.c (idecode_expand_if_switch): Declare as STATIC_IDECODE not
351 STATIC_INLINE_IDECODE. Only the outermost idecode switch will be
352 called directly, all others are called via a table.
353
354 * igen.c (lf_print_semantic_function_header, semantics_h_leaf,
355 semantics_h_insn, semantics_h_function,
356 lf_print_c_semantic_function, semantics_c_function): Add
357 is_inline_function argument to lf_print_semantic_function_header
358 to indicate if an inline or static function declaration/definition
359 should be output. Depending on situtation call accordingly:
360 functions (not instruction semantic routines) are always inline;
361 Semantic routines are made inline when there is no icache (cache
362 will contain the function address) and are duplicating (see above)
363 and the parent of the instruction is a switch statement.
364
365 * igen.c (opcode_field_new): Delete. Code changed to use ZALLOC
366 and moved to insn_table_find_opcode_field.
367
368 * table.c (table_open): Fix typo (nr_model_fields vs nr_fields).
369
370 * igen.c (model_c_insn): Suggestion - document the name of the
371 instruction on each line of the instruction model table.
372
373 Fri Nov 10 00:44:38 1995 Andrew Cagney <cagneyhighland.com.au>
374
375 * emul_netbsd.c (do_ioctl): Cleanup compilation.
376
377 * sim_callbacks.h (__attribute__): Only define if not defined (was
378 already defined on NetBSD host).
379
380 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
381
382 * std-config.h (WITH_XOR_ENDIAN), configure.in, Makefile.in: New
383 macro, indicates if the PowerPC's horrible XOR endian mode should
384 be suported. Add to configure and make.
385
386 * vm_n.h (vm_data_map_read_N, vm_data_map_write_N), vm.c
387 (vm_instruction_map_read): If XOR endian, xor the address
388 with a value from an xor table (indexed by size of access).
389
390 * vm.c (vm_synchronize_context), cpu.c (cpu_synchronize_context):
391 set up xor table to xor if there is a conflict between the
392 CURRENT_TARGET_ENDIAN and the endian indicated in the MSR. Move
393 check of suported change of endian mode from cpu.c to vm.c.
394
395 * vm.c (vm_data_map_write_buffer, vm_data_map_read_buffer):
396 Hopefully added correct hack to handle XOR endian mode.
397
398 FIXME: If NONSTRICT alignment and XOR ENDIAN and MSR indicates
399 little endian mode, the model accepts miss aligned transfers.
400
401 FIXME: Need to create an `init' device that, during
402 initializatioin for XOR mode, it mushes (XOR address) all the dma
403 data before passing it on to the core for storage. Just like the
404 real thing really.
405
406 Wed Nov 8 21:49:52 1995 Andrew Cagney <cagneyhighland.com.au>
407
408 * devices.c (halt_io_write_buffer_callback): Use value written to
409 halt device to determine exit status. Thus allowing
410 success/failure of OEA tests.
411
412 Wed Nov 8 00:10:38 1995 Andrew Cagney <cagneyhighland.com.au>
413
414 * ppc-instructions (icbi): If icache present flush it.
415
416 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
417
418 * devices.c (htab_init_callback): Add code to create htab/pte.
419
420 * devices.c (dma_file, file_init_callback, htab_init_callback):
421 New function - Dma the named file into memory at the specified
422 address. Use.
423
424 * device_tree.h, device_tree.c (scand_*): New functions.
425
426 Tue Nov 7 23:36:31 1995 Andrew Cagney <cagneyhighland.com.au>
427
428 * filter_filename.c, Makefile.in: Change so that only dependant on
429 a very limited nr of files. Stops an unnecessary dependency.
430
431 Tue Nov 7 15:44:33 1995 Andrew Cagney <cagney@highland.com.au>
432
433 * core.c (core_map_find_mapping): Use cpu_halt rather than error
434 to abort an access to an undefined address.
435
436 Sun Nov 12 07:58:09 1995 Michael Meissner <meissner@tiktok.cygnus.com>
437
438 * igen.c (model_table_insert_{macro,function}): New functions.
439 (insn_table_load_insns): Call them.
440 (gen_model_h): Move section emiting model-macros to be first.
441 (model_{c,h}_function): New functions cloned from semantic
442 functions to print out the prototype and function for
443 model-functions.
444 (gen_model_{c,h}): Print out model-functions.
445
446 * ppc-instructions (model_{start,halt,print_info}): Add dummy
447 model-functions.
448
449 * options.c (print_options): Print out WITH_{,DEFAULT_}MODEL, not
450 WITH_PPC_{,DEFAULT_}_MODEL.
451 (options_ppc): Delete now unused function.
452 (cpu.h): Include cpu.h, not just basics.h.
453
454 * std-config.h (WITH_{,DEFAULT_}MODEL): Define.
455
456 * igen.c (model_macros, last_model_macro): New statics to keep
457 track of macros to go in model.h.
458 (insn_table_load_insns): Add model-macros to model_macros linked
459 list.
460 (model_table_fields): Add field for printable name.
461 (gen_model_h): If there are model macros defined, print them out.
462 Print out DEFAULT_MODEL as the first model if there any models
463 specified, otherwise MODEL_NONE. Print out external decl for
464 current_model. Print out decl for model_set.
465 (gen_model_c): Add function model_set. Switch to use printable
466 name for the model, not the internal identifier used.
467
468 * psim.c (current_model): New global variable.
469
470 * ppc-instructions: Add macros for flag defines. Switch first
471 model so 604 is first.
472
473 * main.c (main): Call model_set, not function_unit_model.
474 * sim_calls.c (sim_open): Ditto.
475 * sim_calls.c, Makefile.in: sim_calls.c now includes cpu.h.
476
477 Sat Nov 11 07:27:41 1995 Michael Meissner <meissner@tiktok.cygnus.com>
478
479 * mon.h (mon_events): New enumeration for other events we want to
480 handle.
481 (mon_event): Add declaration for function.
482
483 * mon.c (mon_event): New function.
484 (mon_print_info): Print icache misses.
485
486 * psim.c (run_until_stop): Monitor icache misses.
487
488 * configure.in (--enable-sim-inline): Fix typos in handling comma
489 separated inline options.
490 (--enable-sim-icache): Echo icache size.
491 * configure: Regenerate.
492
493 * igen.c (semantics_h_print_function): Emit STATIC_SEMANTICS
494 instead of INLINE_SEMANTICS so that the compiler won't keep all of
495 the semantic functions as inline RTL, given that the address of
496 the function is taken which forces outline calls anyway.
497 (lf_print_c_semantic_function_header): Ditto.
498 (gen_semantics_h): Define STATIC_SEMANTICS as nothing if not
499 defined.
500 (lf_print_c_cracker_function): Emit STATIC_IDECODE instead of
501 STATIC_INLINE_IDECODE.
502 (gen_idecode_c): Define STATIC_IDECODE if not defined.
503 (gen_model_h): Use #ifdefs to define types to hold model units,
504 cycles, and flags.
505 (model_table_insert): Add a sentinel functional unit at the end to
506 simplify loop processing.
507 (model_c_insn): Use <function-unit>_SENTINAL instead of 0 for any
508 instruction not specifing a function unit for the current model.
509 (gen_model_{c,h}): Provide bounds for model_time_mapping.
510
511 * inline.h (STATIC_SEMANTICS): Define to be static if
512 SEMANTICS_INLINE is defined.
513 (STATIC_IDECODE): Define to be static if IDECODE_INLINE is
514 defined.
515
516 * options.c (print_options): Fix typo.
517
518 Fri Nov 10 06:39:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
519
520 * configure.in (--enable-sim-{opcode,config}): Use $srcdir when
521 check for the existence of files.
522 * configure: Regenerate.
523
524 * table.c (table): New field nr_model_fields.
525 (table_open): New parameter nr_model_fields.
526 (table_entry_read): Parse model fields that begin with a '*' after
527 each instruction.
528 * igen.c, dgen.c: Change callers of table_open.
529
530 * igen.c: Add support for dumping model specific information in
531 model.h and model.c.
532 (insn_field_name): Delete unused array.
533 (global variables): Make global variables static, so we can tell
534 when they are no longer used.
535 (cache_semantic_actual): Delete unused variable.
536 (insn_table_load_insns): If the insn is really a machine model,
537 call model_table_insert instead of other processing.
538 (model_table_insert): New function to handle defining the
539 functional units of a particular machine model.
540 (insn_table): Add last_function field so we can add functions at
541 the end.
542 (insn_table_insert_function): Use last_function field when
543 appending new function.
544
545 * ppc-instructions: Add a few model specific information for 603,
546 603e, and 604 for testing purposes.
547
548 * table.h (table_model_entry): New linked list to hold model
549 specific information, one per line.
550 (table_entry): Add model_first, model_last fields.
551
552 * configure.in (--enable-sim-inline): If gcc is found and
553 --enable-sim-inline is not specified, defaine DEFAULT_INLINE to 1,
554 not 2.
555 (--enable-sim-reserved-bits): New switch to check whether reserved
556 bits are set in the instruction.
557 (--enable-sim-opcode): Make complex the default.
558 (all switches): Add appropriate checks and error messages.
559 * configure: Regenerate.
560
561 * Makefile.in (RESERVED_CFLAGS): New variable set by
562 --enable-sim-reserved-bits.
563 (CONFIG_CFLAGS): Include RESERVED_CFLAGS.
564 (BUILT_SRC): igen now generates model.c and model.h.
565 (LIB_OBJ): Include table.o.
566 (tmp-igen): Add -m/-M options to write model.c/model.h.
567 (model.o): New object.
568 (CPU_H): Include model.h.
569
570 * cpu.h: Include model.h.
571
572 * std-config.h (WITH_RESERVED_BITS): Define.
573 (MODEL_INLINE): Ditto.
574
575 * options.c (print_options): Print out WITH_RESERVED_BITS.
576
577 Thu Nov 9 12:22:15 1995 Michael Meissner <meissner@tiktok.cygnus.com>
578
579 * configure.in: If --silent, don't output information messages.
580 * configure: Regenerate.
581
582 * configure.in (--enable-sim-alignment): Fix typo in specifing non
583 strict alignment.
584 (--enable-sim-switch): Make default on.
585 (--enable-sim-duplicate): Make default on.
586 (--enable-sim-smp): Make default 0.
587 (--enable-sim-mon): Don't set sim_float if not set.
588 (--enable-sim-inline): If gcc is found and --enable-sim-inline is
589 not specified, define DEFAULT_INLINE to be 2.
590 (all --enable-sim-* rules): Echo rules set to non empty to file
591 descriptor 6.
592 * configure: Regenerate.
593
594 * options.c (options_env): Fix typo if WITH_ENV is 0.
595 (print_options): Print GCC compiler version if available and
596 date/time options was compiled. If OPCODE_RULES, IGEN_FLAGS,
597 and/or DGEN_FLAGS are defined, print them.
598
599 * Makefile.in (all link actions): Pass SIM_CFLAGS as well as
600 CFLAGS.
601 (options.o): Compile options.o with OPCODE_RULES, IGEN_FLAGS, and
602 DGEN_FLAGS defined, so they can be printed out.
603
604 * igen.c (lf_print_c_validate): Check for WITH_ASSERT, so that
605 this test can be compiled away if the user really wants a fast
606 simulator by not doing assertion failures.
607
608 Wed Nov 8 13:19:47 1995 Michael Meissner <meissner@tiktok.cygnus.com>
609
610 * options.c: New file to print out all of the WITH_ options.
611 * options.h: New include file to declare print_options.
612 * debug.h (trace_options): Add trace_opts to call print_options.
613 * debug.c (trace_description): Add trace_opts support.
614 * main.c (main): If user requested options, print them.
615 * sim_calls.c (sim_open): Ditto.
616
617 * igen.c (opcode_field_new): Add void to make it a proper prototype.
618
619 * emul_generic.c (emul_enter_call): Make printf_filtered arguments
620 type correct.
621 * emul_netbsd.c (do_kill): Ditto.
622 * registers.c (registers_dump): Ditto.
623 * vm.c (om_translate_effective_to_real): Ditto.
624 * vm_n.h (vm_data_map_read_N): Ditto.
625 (vm_data_map_write_N): Ditto.
626 * devices.h (DTRACE_INIT): Ditto.
627 (DTRACE_{ATTACH,DETACH}_ADDRESS): Ditto.
628 (DTRACE_IO_{READ,WRITE}_BUFFER): Ditto.
629 (DTRACE_DMA_{READ,WRITE}_BUFFER): Ditto.
630 * devices.c (update_for_binary_section): Ditto.
631 (write_stack_arguments): Ditto.
632 (stack_ioctl_callback): Ditto.
633 * device_tree.c (device_tree_add_passthrough): Ditto.
634 (device_tree_{add,find}_device): Ditto.
635 (device_tree_{add,find}_integer): Ditto.
636 (device_tree_find_{string,boolean}): Ditto.
637 (device_tree_init{,_device}): Ditto.
638 (device_tree_dump): Ditto.
639 * sim_calls.c (sim_{read,write}): Ditto.
640 (sim_{fetch,store}_register): Ditto.
641 (sim_stop_reason): Ditto.
642
643 * sim_callbacks.h (printf_filtered): Declare with attribute
644 printf, so we can enable format checks.
645
646 * devices.c (console_io_{read,write}_buffer_callback): Cast swtich
647 argument to int, since ANSI doesn't allow long switch values.
648 * emul_netbsd.c (do___sysctl): Ditto.
649
650 * emul_netbsd.c (do___sysctl): Fix up printf call.
651
652 * corefile.c (core_translate): Don't do arithmetic with void *
653 pointers. Cast to char * first.
654
655 * function_unit.c (FUNC_{LOAD,STORE}): Rename from {LOAD,STORE}
656 and change all uses.
657
658 * Makefile.in ({FUNC,MODEL,WARNING}_CFLAGS): New flags set by
659 configure --enable switches.
660 (CONFIG_CFLAGS): Include FUNC_CFLAGS and MODE_CFLAGS.
661 (.c.o): Include WARNING_CFLAGS.
662 (CPU_H): Include function_unit.h.
663 (LIB_OBJ): Include function_unit.o.
664 (BUILT_SRC_WO_CONFIG): Split from BUILT_SRC and do not include
665 config.h or ppc-config.h.
666 (BUILT_SRC): Include BUILT_SRC_WO_CONFIG, config.h and
667 ppc-config.h.
668 (filter_filename.o): Include config.h/ppc-config.h dependencies.
669 (idecode.o, semantics.o, psim.o): Specify CC line without
670 WARNING_CFLAGS so that we don't get all of the unused variable
671 warnings that are generated.
672 (function_unit.o): Add rule to build.
673 (main.o, sim_calls.o): Add function_unit.h, itable.h dependencies.
674 (mon.o): Include mon.c dependency.
675 (TAGS): Depend on BUILT_SRC.
676 (clean): Don't delete config.h or ppc-config.h
677
678 * basics.h (sim_callbacks.h): Move include after the include of
679 config.h and ppc-config.h.
680
681 * bits.{h,c} (ROTL32,ROTL64): Move these functions to bits.c. Add
682 support for BITS_INLINE to inline these. Add declarations to
683 bits.h.
684
685 * configure.in (--enable-sim-warnings): Add new option to specify
686 compiler warnings for all modules except idecode.o and semantics.o
687 which have lots of unused variables because they are machine
688 generated.
689 (--enable-sim-function-unit): New switch to configure whether
690 function unit support is compiled in or not.
691 (--enable-sim-{,default-}mode): New switches to control which cpu
692 model is used.
693 * configure: Regenerate.
694
695 * corefile.c (core_attach_address_callback): Delete unused
696 variable device_address.
697
698 * cpu.c (struct _cpu): Add function unit pointer field func_unit.
699 (cpu_create): If WITH_FUNCTION_UNIT, call function_unit_create.
700 (cpu_init): If WITH_FUNCTION_UNIT, call function_unit_init.
701 (cpu_halt): If WITH_FUNCTION_UNIT, call function_unit_halt.
702 (cpu_function_unit): New function to return func_unit field.
703
704 * cpu.h (function_unit.h): Include new include file.
705 (cpu_function_unit): Declare.
706
707 * debug.c (stdlib.h): Test HAVE_STDLIB_H, not HAVE_STDLIB.
708 (config.h): Include config.h.
709
710 * devices.c (icu_io_write_buffer_callback): Delete unused variable
711 system.
712
713 * emul_generic.c (emul_exit_call): Print out status value.
714
715 * emul_netbsd.c (do_read): Delete unused variable nr_moved.
716
717 * filter_filename.h (includes): Include config.h, ppc-config.h,
718 not basics.h.
719
720 * inline.c: Include bits.c if BITS_INLINE. Include
721 function_unit.c if FUNCTION_UNIT_INLINE.
722
723 * inline.h (INLINE_BITS): Define if BITS_INLINE.
724 (INLINE_FUNCTION_UNIT): Define if FUNCTION_UNIT_INLINE.
725
726 * interrupts.c (instruction_storage_interrupt): Delete unused
727 variable nia.
728
729 * lf.h (config.h): Include config.h.
730
731 * main.c (includes): Include function_unit.c. If HAVE_UNISTD_H,
732 include unistd.h.
733 (usage): Update for -m model, -i, and -I options.
734 (main): Delete unused variables stack_pointer and i. Add support
735 for -i, -m model arguments. Call psim_print_info with verbose ==
736 1 if -i, and verbose == 2 if -I.
737
738 * mon.c (stdio.h): Include stdio.h to pick up sprintf prototype.
739 (mon_issue): Call function_unit_issue if function units are
740 supported.
741 (mon_print_info): Take psim * argument. Print out information
742 from function_unit if available. Move read/write stats to always
743 print, instead of printing if verbose > 1. Fix up plural
744 vs. singular usage.
745
746 * mon.h (mon_print_info): Update prototype.
747
748 * psim.c (current_ppc_model): Add global variable.
749 (psim_print_info): Pass system argument to mon_print_info.
750
751 * sim_calls.c (function_unit.h): Include.
752 (sim_open): Add support for -i and -m model options. If -i call
753 psim_print_info with verbose == 1, if -I, with verbose == 2.
754 (sim_resume): Delete unused variable program_counter.
755
756 * std-config.h (WITH_FUNCTION_UNIT): Define.
757 (ppc_model): Add enumeration giving all PowerPC models currently
758 known about.
759 ({WITH,CURRENT}_PPC_MODEL): Define.
760 (FUNCTION_UNIT_INLINE): Define.
761
762 * table.c (config.h): Include config.h.
763
764 * vm.c (om_virtual_to_real): Print pte_word_{0,1} so the compiler
765 doesn't complain that they're unused.
766
767 * vm_n.h (vm_data_map_read_N): Delete unused variable rval.
768
769 Mon Nov 6 23:15:54 1995 Andrew Cagney <cagney@highland.com.au>
770
771 * sim-endian.c (ppc-endian.c), sim-endian.h (ppc-endian.h):
772 renameed. These files are target independant.
773 * Makefile.in, basics.h: update for new name.
774
775 * sim-endian.h (SWAP_N), sim-endian.c (_SWAP_1): Rename existing
776 SWAP_<N> to _SWAP_<N> so that sim-endian.h can contain SWAP_N
777 macro's as required.
778
779 * sim-endian.c, sim-endian-n.h (new file): Move endian code into a
780 debugable header file.
781
782 * ppc-instructions (Byte-Reverse): Enable byte reverse
783 instructions using SWAP_N macros.
784
785 Mon Nov 6 10:39:28 1995 Michael Meissner <meissner@tiktok.cygnus.com>
786
787 * Makefile.in (config.status): Remove references to config.make
788 and config.hdr.
789
790 * config.{make,hdr}: Delete, no longer used.
791 * build-psim: Ditto.
792
793 Mon Nov 6 20:49:56 1995 Andrew Cagney <cagney@highland.com.au>
794
795 * sim_calls.c (sim_open): Fix parsing of `target sim' options.
796
797 * device_tree.c (device_tree_add_string): Wasn't saving the value
798 of the string being entered into the tree.
799
800 * psim.c (create_filed_device_tree): Not terminating string device
801 names with a null.
802
803 * psim.c (psim_create): Use `env' instead of
804 `environment-architecture' to be consistent with configure.
805 Reconize user/uea, virtual/vea and operating/oea.
806
807 Sat Nov 4 12:29:45 1995 Fred Fish <fnf@cygnus.com>
808
809 * core.c: Rename to corefile.c
810 * core.h: Rename to corefile.h
811 * inline.c: Include corefile.h, renamed from core.h.
812 * cpu.h: Include corefile.h, renamed from core.h
813 * vm.c: Include corefile.h, renamed from core.h
814 * corefile.c: Include corefile.h rather than core.h
815 * README.psim (KNOWN PROBLEMS): Change core.* references to corefile.*
816 references.
817 * Makefile.in (CPU_H): Change core.h to corefile.h
818 (vm.o): Change dependency to corefile.h
819 (LIB_SRC): Change core.c to corefile.c.
820 (LIB_OBJ): Change core.o to corefile.o.
821 (corefile.o): Change dependencies to corefile.c, corefile.h.
822
823 Fri Nov 3 11:37:24 1995 Michael Meissner <meissner@tiktok.cygnus.com>
824
825 * ppc-instructions (data cache instructions): Make all data cache
826 instructions nops instead of invalid instructions.
827
828 * Makefile.in (CONFIG_CFLAGS): Add ALIGNMENT_CFLAGS and
829 TIMEBASE_CFLAGS which weren't included.
830
831 Thu Nov 2 08:54:04 1995 Michael Meissner <meissner@tiktok.cygnus.com>
832
833 * Makefile.in: Uncomment built file dependencies.
834
835 * configure.in: Rewrite --enable-sim switch handling to use the
836 autoconf builtins so it works correctly if the configure or
837 Makefile.in files are modified and make decides to rebuild
838 Makefile. Also document all of the --enable-sim switches
839 supported. Check whether getrusage and sys/resource.h are
840 supported.
841 * config.in: Regenerate.
842 * configure: Regenerate.
843 * Makefile.in: Add support for all of the variables set with
844 --enable-sim switches.
845
846 * Makefile.in (clean): make clean now removes all built sources as
847 well.
848
849 * cpu.c: Use HAVE_STRING_H, HAVE_STRINGS_H, HAVE_UNISTD_H,
850 HAVE_TIME_H, HAVE_SYS_TIMES_H, HAVE_SYS_RESOURCE_H defined in
851 the generated config.h.
852 * debug.c: Ditto.
853 * device_tree.c: Ditto.
854 * devices.c: Ditto.
855 * dgen.c: Ditto.
856 * emul_netbsd.c: Ditto.
857 * igen.c: Ditto.
858 * lf.c: Ditto.
859 * misc.c: Ditto.
860 * psim.c: Ditto.
861 * registers.c: Ditto.
862 * sim_calls.c: Ditt.
863 * table.c: Ditto.
864
865
866 * main.c (main): Call psim_print_info with verbose == 2.
867
868 * mon.c (mon_print_info): Align the cpu number and number of
869 instructions fields. Do not print an instruction category if the
870 CPU did not execute any of those instructions. Print out number
871 of reads and writes. If getrusage is supported, print out number
872 of simulated instructins per second.
873
874 * configure.in: Add support for --enable-sim-opcode=stupid.
875 * configure: Regenerate.
876
877 Wed Nov 1 23:46:59 1995 Andrew Cagney <cagney@highland.com.au>
878
879 * std-config (INLINE_DEVICE_TREE): Don't inline either of
880 device_tree.c or devices.c. There is no significant gain.
881
882 * configure.in, Makefile.in: add --enable-sim-icache=[0-9]* and
883 IGEN_ICACHE macro.
884
885 Wed Nov 1 23:46:59 1995 Andrew Cagney <cagney@highland.com.au>
886
887 * igen.c (main), misc.h (target_a2i, i2target), misc.c: Add
888 functions to convert between target and igen internal bit numbers.
889 Make IO go through these functions. Add -b (bit size) and -h (high
890 bit nr) options to igen. Typical usage would be: ./igen -b 16 -h
891 15 for a 16 bit instruction format with the msb given a number 15.
892
893 Wed Nov 1 22:17:32 1995 Andrew Cagney <cagney@highland.com.au>
894
895 * dgen.c (main): Was outputting optarg even when it was NULL.
896
897 Tue Oct 31 23:48:33 1995 Andrew Cagney <cagney@highland.com.au>
898
899 * vm_n.h (vm_data_map_load_N, vm_data_map_store_n), debug.h,
900 debug.c: Add tracing of load/store unit (virtual) with -t
901 load-store.
902
903 Tue Oct 31 21:44:01 1995 Andrew Cagney <cagney@highland.com.au>
904
905 * std-config.h (WITH_ENVIRONMENT): Add USER_ENVIRONMENT which does
906 not include things such as the time base and events.
907
908 * interrupt.c, sim_calls.c, cpu.h, vm.c, configure.in: Add UEA to
909 all environment switches for above.
910
911 * psim.c (psim_create): ditto - new device tree node name is
912 /options/environment-architecture with values user, virtual and
913 operating.
914
915 Tue Oct 31 21:31:32 1995 Andrew Cagney <cagney@highland.com.au>
916
917 * ppc-opcode-stupid: Third example of use of opcode table - this
918 one expands all mtspr/mfspr and branch instructions. Appears to
919 give about a 10% gain in performance if everything enabled. Also
920 takes about 150mb of swap to build.
921
922 Wed Nov 1 10:49:48 1995 Michael Meissner <meissner@tiktok.cygnus.com>
923
924 * emul_netbsd.c (do_exit): Print arguments and close parenthesis
925 if tracing, since exit doesn't go through emul_exit_call.
926 (do_read): Print arguments if tracing.
927 (do_write): Ditto.
928 (do_open): Ditto.
929 (do_break): Ditto.
930 (do_kill): Ditto.
931 (do_dup): Ditto.
932 (do_sigprocmask): Replace trace with printing arguments if
933 tracing.
934 (do_ioctl): Print arguments if tracing.
935 (do_umask): Ditto.
936 (do_dup2): Ditto.
937 (do_fcntl): Ditto.
938 (do_gettimeofday): Ditto.
939 (do_getrusage): Ditto.
940 (do_fstatfs): Ditto.
941
942 * filter_filename.c: New file to provide filter_filename to strip
943 the directory prefix from a file.
944 * filter_filename.h: New include file to declare filter_filename.
945
946 * debug.h: Include filter_filename.h.
947 (TRACE,DTRACE,ERROR): Use filter_filename on __FILE__.
948
949 * misc.h: Include filter_filename.h.
950 (ASSERT): Use filter_filename on __FILE__.
951
952 * igen.c (lf_print_my_prefix): Use filter_filename on the filename
953 argument.
954
955 * Makefile.in: Add filter_filename support.
956
957 * ppc-instructions (dcbi, icbi): Make these NOPs rather than
958 invalid instructions.
959
960 * configure.in: Add support for more --enable-sim-* switches.
961 Use config.make and config.hdr to write to Makefile and config.h
962 respectively. Don't rewrite Makefile, just append to it.
963 * configure: Regenerate.
964 * config.{make,hdr}: New shell scripts.
965
966 * Makefile.in: Remove all variables set by configure.in.
967 (psim.o): Depend on $(BUILT_SRC) also.
968
969 * emul_netbsd.c (do_gettimeofday,do_getrusage): When comparing an
970 integer, use 0, not NULL.
971
972 Tue Oct 31 15:20:04 1995 Michael Meissner <meissner@tiktok.cygnus.com>
973
974 * configure.in: Add support for --enable-sim-inline,
975 --enable-sim-bswap, --enable-sim-cflags, --enable-sim-complex,
976 --enable-sim-switch, --enable-sim-duplicate, --enable-sim-filter,
977 and --enable-sim-endian switch to control various Makefile
978 variables.
979 * configure: Regenerate from configure.in.
980 * Makefile.in: Add various Make variables that the various
981 switches alter.
982
983 * std-config.h (DEFAULT_INLINE): Don't set this to 2 if using GCC
984 and optimizing by default.
985
986 Fri Oct 27 19:26:27 1995 Andrew Cagney <cagney@highland.com.au>
987
988 * bits.h (ROTL32, ROTL64): Were functions, made them macros, now
989 make them functions again. Appears 2.6.3 is confused by just a
990 macro.
991
992 Thu Oct 26 18:31:58 1995 Andrew Cagney <cagney@highland.com.au>
993
994 * ppc-endian.c (SWAP_8): Fix 8 byte swap!
995
996 * psim.c (psim_create): Not correctly checking that runtime
997 configuration of things like ENDIAN, ENVIRONMENT and ALIGNMENT
998 matched the compiled in ones.
999
1000 * debug.h (ITRACE), igen.c: Tidy up more tracing flags -
1001 trace_semantics is now different to trace_idecode, the former
1002 checks the cache.
1003
1004 Tue Oct 24 21:54:13 1995 Andrew Cagney <cagney@highland.com.au>
1005
1006 * ppc-instructions (mtsrin): Missing instruction
1007 * ppc-instructions (mfsrin): Missing instruction
1008 * ppc-instructions (eieio): Missing instruction
1009
1010 Tue Oct 24 20:55:29 1995 Andrew Cagney <cagney@highland.com.au>
1011
1012 * build-psim: New shell script - see internals for usage,
1013 simplifies the process of building custom simulators.
1014
1015 Mon Oct 23 23:48:59 1995 Andrew Cagney <cagney@highland.com.au>
1016
1017 * std-config.h (SEMANTICS_INLINE): Tidy up notes on each of the
1018 INLINE macros. Make SEMANTICS_INLINE == 1 if DEFAULT_INLINE == 2.
1019 Don't use DEFAULT_INLINE to define REGISTERS_INLINE DEVICES_INLINE
1020 DEVICE_TREE_INLINE or INTERRUPTS_INLINE as none of these are on
1021 the instruction or data critical paths.
1022
1023 * FIXME: need to set up OS_EMUL_INLINE/EMUL_GENERIC_INLINE but
1024 not on critical path.
1025
1026 * FIXME: devices.c/emul_netbsd.c would benefit (slightly) from
1027 the inclusion of device_tree.c/emul_generic.c.
1028
1029 Mon Oct 23 00:31:50 1995 Andrew Cagney <cagney@highland.com.au>
1030
1031 * os_emul.[hc], emul_generic.[hc], emul_netbsd.[hc]: replace
1032 system.[hc]. Start of suport for multiple emulations and
1033 emulation state (os_emul object).
1034
1035 * emul_generic.[hc]: Start of code to implement proper system call
1036 tracing (from spy).
1037
1038 Sun Oct 22 21:33:51 1995 Andrew Cagney <cagney@highland.com.au>
1039
1040 * cpu.h, cpu.c (cpu_init): New function, zero the registers before
1041 the processor is started. Fixes problem of registers being
1042 undefined when restarting from within gdb.
1043
1044 * cpu.h, cpu.c (cpu_flush_icache): New function, flushes the
1045 instruction cache (if present). Fixes problem of cpu caching gdb
1046 breakpoint instructions.
1047
1048 FIXME: PSIM sometimes aborts calling error(), it should instead
1049 call sim_error() say which takes care of housekeeping such as
1050 saving the CIA before calling error.
1051
1052 * NOTE: cpu_flush_cache() instead of cpu_synchronize_context() is
1053 used when restarting a simulation because the latter has the
1054 unwanted side effect (well I as a kernel hacker think it is) of
1055 performing an isync when the instruction stream doesn't contain
1056 one.
1057
1058 Sun Oct 22 19:27:48 1995 Andrew Cagney <cagney@highland.com.au>
1059
1060 * mon.h (new), mon.c (new), std-config.h (WITH_MON): Performance
1061 monitoring module. Counts both instructions issued and
1062 load/stores.
1063
1064 * NOTE: mon does not contain to count instruction loads as this
1065 information is already available from the mon_issue() hook.
1066
1067 * FIXME: mon doesn't have access to register usage information.
1068 This is needed if the user wants to monitor things like register
1069 stalls.
1070
1071 * igen.c (lf_print_c_semantic), vm_n.h: Add counting code.
1072
1073 * psim.h, psim.c (psim_create), cpu.h, cpu.c (cpu_create): Attach
1074 a common monitor to each of the cpus. Delete
1075 cpu_increment_number_of_insns() and cpu_get_number_of_insns()
1076 replaced by copied code in mon.[hc].
1077
1078 Sun Oct 22 18:42:45 1995 Andrew Cagney <cagney@highland.com.au>
1079
1080 * sim_calls.c, main.c, psim.c (psim_create): always create
1081 `WITH_SMP' cpus. The actual number of CPU's active in a
1082 simulation run is taken from the device node: /init/smp (an
1083 integer). WITH_SMP changed to 2 (remember to put it back to 0).
1084
1085 Fri Oct 20 17:26:54 1995 Andrew Cagney <cagney@highland.com.au>
1086
1087 * system.c: More system call emulation. If code appears NetBSD
1088 specific, make conditional to being compiled on a NetBSD system
1089 (sigh).
1090
1091 Wed Oct 18 23:02:20 1995 Andrew Cagney <cagney@highland.com.au>
1092
1093 * Makefile.in, gen.c(delete), igen.c(new), dgen.c(new),
1094 lf.[ch](new), table.[ch](new): Split into two generators - igen
1095 that outputs the instruction tables and dgen that outputs the spr
1096 tables. Add -f (filter out) flag to igen to filter out certain
1097 instructions (ex 64 bit ones) from the created tables. Include
1098 $(LIBIBERTY_LIB) in link options in case host lacks some libc
1099 functions.
1100
1101 * NOTE: igen, since it was originally written for the
1102 PowerPC/RS6000, things the MSB is 0 and the LSB is 63{31}.
1103
1104 * Makefile.in, std-config.h, ppc-cache-rules(new),
1105 ppc-opcode-complex(new), ppc-opcode-simple(new): (for igen) Create
1106 cache-rule and opcode-rule tables from macros found std-config.h.
1107 Delete corresponding macro's from std-config.h.
1108
1109 * FIXME: under this new igen scheme, when playing around with igen
1110 options, you'll find that depenencies don't work very well.
1111
1112 * igen.c (gen_itable_c, gen_itable_h), Makefile.in: code to output
1113 an table of all the instructions. Code to output a type
1114 enumerating all the instructin names.
1115
1116 * igen.c(lf_print_c_semantic): Move call to increment instruction
1117 counter so that it occures _after_ the instruction has been fully
1118 validated, was double counting illegal/invalid instructions. Add
1119 conditional so only compiled in when WITH_PROFILE enabled (enabled
1120 by default).
1121
1122 * igen.c, cpu.h, cpu.c(cpu_increment_number_of_insns): Include
1123 itable.h, count individual instruction types not just total,
1124 adjust reporting functions to output this.
1125
1126 * ppc-instructions (64 bit Load Doubleword with Update Indexed):
1127 Had 32./ instead of 31./
1128
1129 * ppc-instructions (64 bit Store Double Word Conditional Indexed):
1130 bitrot - updated to use newer CR register operators.
1131
1132 * ppc-instructions (64bit Floating Convert from Integer
1133 Doubleword): Correct call to Round_Float().
1134
1135 Mon Oct 16 00:31:20 1995 Andrew Cagney <cagney@highland.com.au>
1136
1137 * basics.h: #include "sim_callbacks.h" earlier so that its
1138 prototypes are declared in all other header files.
1139
1140 * bits.h, bits.c, idecode_expression.h (ROTL32, ROTL64): Update
1141 doc in bits.h, remove dead code in bits.c, move ROTL32/ROTL64 into
1142 bits.h.
1143
1144 * FIXME: the bits.h/bits.c macro's should be replaced with
1145 (inline) c functions.
1146
1147 * cpu.c(cpu_add_commas), device_tree.h, device_tree.c(scand_*):
1148 Add size of buffer argument to functions writing a string into a
1149 buffer. Check for buffer overflow.
1150
1151 Sun Oct 15 22:16:11 1995 Andrew Cagney <cagney@highland.com.au>
1152
1153 * devices.h, devices.c, debug.h, debug.c: add macro's for tracing
1154 of each device. Make parameter names consistent so macros work.
1155 Use macro's in device functions.
1156
1157 * device_tree.c, devices.h, devices.c: include path to device in a
1158 devices node when creating it.
1159
1160 * device_tree.c, debug.h, debug.c: Add tracing of `device-tree'.
1161
1162 * core.c: add tracing of core-device, adjust parameter names in
1163 core functions to be consistent with those in devices*.
1164
1165 Sun Oct 15 20:33:20 1995 Andrew Cagney <cagney@highland.com.au>
1166
1167 * debug.h, debug.c (trace_option): New function. Parses the trace
1168 option, updating the trace array.
1169
1170 * debug.h, debug.c (trace_usage): New function. Outputs the list
1171 of all possible trace options.
1172
1173 * sim_calls.c (sim_open), main.c (main): Use new trace_option() to
1174 parse trace options specified with the simpler -t flag. Adjust
1175 usage.
1176
1177 * FIXME: basic parsing of command line options is still duplicated
1178 by main.c and sim_calls.c
1179
1180 Thu Oct 26 10:42:28 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1181
1182 * Makefile.in (clean): Delete *.i and *.out files.
1183
1184 * ppc-endian.c (SWAP_n): Add SET argument to allow use of SWAP
1185 macros for either assignment or return. Fix SWAP_8 to use a
1186 union, and two SWAP_4's. Delete SWAP_N, since nobody uses it now.
1187 (ENDIAN_N): Add SET argument to SWAP_n calls. Delete macro defs
1188 that hardwired swapping on/off, let optimizer delete dead code.
1189
1190 * main.c (main): Add printf that we caught a signal and print out
1191 the failing address.
1192
1193 Thu Oct 19 21:43:39 1995 Fred Fish <fnf@fishfood.amigalib.com>
1194
1195 * Makefile.in: Remove tabs from otherwise empty line.
1196 Confuses many non-GNU versions of "make".
1197
1198 Wed Oct 18 08:51:25 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1199
1200 * Makefile.in (clean): Delete files produced by gen.
1201
1202 Mon Oct 16 17:34:24 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1203
1204 * gen.c (lf_print_c_semantic_function): Move counting # of
1205 instructions here so it works with caching.
1206 (gen_idecode_c): Move from here.
1207
1208 Wed Oct 11 17:13:15 1995 Andrew Cagney <cagney@highland.com.au>
1209
1210 * gen.c, ppc-instructions, psim.c: Fix code for generating
1211 cracking instruction cache. Delete the code that cached just the
1212 result from doing an instruction lookup - this ran slower than no
1213 cache at all.
1214
1215 Fri Oct 13 09:58:43 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1216
1217 * Makefile.in (gen.o): Include $(INLINE_CFLAGS).
1218
1219 * debug.h (ppc_trace): Rename from trace, to avoid a conflict with
1220 TCL when gdb is linked with the simulator.
1221 * debug.c (ppc_trace): Ditto.
1222 * sim_calls.c (sim_open): Change trace -> ppc_trace.
1223 * main.c (main): Ditto.
1224
1225 * cpu.c (cpu_add_commas): Remove extra static.
1226
1227 Thu Oct 12 11:35:53 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1228
1229 * Makefile.in (psim.o): Now that inlines are turned on, make
1230 psim.o depend on all sources.
1231
1232 * cpu.c (cpu_add_commas): New function to format a long with
1233 commas.
1234 (cpu_print_info): Use it to print number_of_insns.
1235
1236 * ppc-endian.c (SWAP_n): New macros to speed up byte swapping for
1237 2, 4, and 8 bytes.
1238 (ENDIAN_N): If both target and host byte orders are known, don't
1239 bother testing CURRENT_{TARGET,HOST}_BYTE_ORDER.
1240
1241 * ppc-endian.h (target specific H2T_n/T2H_n macros): Remove #if 0
1242 to allow target specific H2T_n/T2H_n macros to be used.
1243 (htonl, ntohl): If compiled on a 486 by GCC and WITH_BSWAP is
1244 non-zero, redefine the htonl/ntohl macros to use the BSWAP instead
1245 of the 3 instruction sequence that runs on 386s.
1246
1247 * std-config.h (WITH_{HOST,TARGET}_BYTE_ORDER): Don't override if
1248 specified on the compile line.
1249 (WITH_BSWAP): If not defined, define as 0.
1250
1251 * Makefile.in (INLINE_CFLAGS): Add -DDEFAULT_INLINE=2 to add
1252 default inline support. Pass INLINE_CFLAGS when compiling.
1253
1254 * devices.{h,c} (unimp_device_ioctl): Use STATIC_DEVICES, not
1255 INLINE_DEVICES since GCC doesn't like inline functions that
1256 accept variable arguments.
1257 (stack_ioctl_callback): Make function just static because GCC
1258 doesn't like inline functions that accept variable arguments.
1259
1260 * devices.h (STATIC_DEVICES): Define as empty if not defined.
1261
1262 * inline.c: Correct pathnames of included C files to match current
1263 implementation.
1264
1265 * inline.h (STATIC_DEVICES): If DEVICES_INLINE is defined to be
1266 non-zero, define STATIC_DEVICES to be static.
1267
1268 * std-config.h (INLINE): If GNU C and optimizing, define this as
1269 __inline__.
1270 (DEFAULT_INLINE): If not defined, define as 0.
1271 (ENDIAN_INLINE): If not defined, define as DEFAULT_INLINE.
1272 ({CORE,VM,CPU,EVENTS,REGISTERS,INTERRUPTS}_INLINE): Ditto.
1273 ({SPREG,IDECODE}_INLINE): Ditto.
1274
1275 Wed Oct 11 17:13:15 1995 Andrew Cagney <cagney@highland.com.au>
1276
1277 * ppc-instructions: Initial cut of floating point suport added.
1278 Of note include - use of host IEEE floating point instructions,
1279 use of PowerPC manual pseudo code to handle the FPSCR. It is not
1280 currently a pretty sight.
1281
1282 * memory_map.h, memory_map.c, memory_map_n.h, core.h, core.c:
1283 merge into core.h, core.c, core_n.h. The type memory_map replaced
1284 with core_map. This removes a level of pointer indirection when
1285 translating an address.
1286
1287 * memory_map.h, memory_map.c, memory_map_n.h: delete.
1288
1289 * Makefile.in et.al (sorry): tweek to use new core, core_map and
1290 core.h.
1291
1292 Wed Oct 11 12:10:26 1995 Andrew Cagney <cagney@highland.com.au>
1293
1294 * sim_calls.c, main.c: Add -g (trace_gdb) option, add tracing to
1295 most of the other functions in sim_calls.c.
1296
1297 * basics.h (CONCAT3), memory_map.c, memory_map_n.h, Makefile.in:
1298 Add macros to better cover up `generic' code. Makes it possible
1299 to step through the generic code!
1300
1301 * vm.c, vm_n.h, Makefile.in: ditto
1302
1303 Tue Oct 10 15:42:59 1995 Andrew Cagney <cagney@highland.com.au>
1304
1305 * devices.h, devices.c, memory_map.h, memory_map.c: Changed
1306 callback interface so that there is a read/write buffer but no
1307 read/write_word. VEA default memory read/write handler sometimes
1308 couldn't resolve an access and of those some were for a memory
1309 fault and some were because gdb was making a bogus request.
1310
1311 * devices.h, devices.c, memory_map.h, memory_map.c, vm.h, vm.c:
1312 eliminate transfer_mode (raw or cooked) parameter from read/write
1313 buffer.
1314
1315 Fri Oct 6 20:23:56 1995 Andrew Cagney <cagney@highland.com.au>
1316
1317 * ppc-instructions (fmul, fmuls): correct instruction format - had
1318 FRB instead of FRC.
1319
1320 Wed Oct 4 17:31:12 1995 Andrew Cagney <cagney@highland.com.au>
1321
1322 * psim.c, device_tree.h, device_tree.c, devices.c (printd_*,
1323 scand_*): new functions to parse/print fields in device names
1324 while hiding any machine dependency.
1325
1326 * devices.c, psim.c: Change the stack init code so that it is
1327 handled by a device. Arguments passed across using a device ioctl
1328 (hack).
1329
1330 * devices.h, devices.c: device ioctl callback changed to allow a
1331 variable number of arguments. This gives greater flexability and
1332 greater chance of bugs.
1333
1334 Tue Oct 3 22:01:56 1995 Andrew Cagney <cagney@highland.com.au>
1335
1336 * main.c (printf_filtered, error): Missing va_end() to close off
1337 variable argument use.
1338
1339 * Makefile.in (tmp-gencode): comment out hack to get around some
1340 versions of make not handling files being created as side-effects.
1341
1342 * gen.c (lf_open): Add -n (real_file_name) option. Specifies an
1343 alternative file name to use in output files for things like #line
1344 macros.
1345
1346 Makefile.in (tmp-gencode): Use gen -n so that debug info is
1347 correct.
1348
1349 * Makefile.in (TARGETLIB): Use this instead of libsim.a in the
1350 Makefile.
1351
1352 Sat Oct 7 22:40:59 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1353
1354 * sim_calls.c (sim_set_callbacks): Define new function.
1355
1356 Fri Oct 6 17:23:10 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1357
1358 * psim.c (psim_print_info): Print exit status or signal number.
1359
1360 Mon Oct 2 11:46:37 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1361
1362 * cpu.c (struct _cpu): Add number_of_insns field to trace how many
1363 instructions are executed.
1364 (cpu_increment_number_of_insns): New function to increment the
1365 number of instructions issued.
1366 (cpu_get_number_of_insns): New function to return the number of
1367 instructions issued.
1368 (cpu_print_info): New function to print cpu related information.
1369 At present, print the number of instructions executed.
1370
1371 * gen_idecode_c: Emit call to cpu_increment_number_of_insns within
1372 idecode_issue.
1373
1374 * psim.c (psim_print_info): New function to iterate over each of
1375 the CPU's calling cpu_print_info.
1376
1377 * psim.h,cpu.h: Add new declarations.
1378
1379 * sim_calls.c (sim_open): Add argument processing to add the same
1380 switches main.c accepts for the standalone processor.
1381 (sim_close): Call psim_print_info if -I.
1382
1383 * main.c (main): Add comment saying to update sim_calls.c when
1384 adding switches. Add -I to call psim_print_info when done.
1385 (usage): Update usage message.
1386
1387 Sun Oct 1 13:52:59 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1388
1389 * main.c (printf_filtered): Correct to match new prototype.
1390
1391 Sat Sep 30 20:47:05 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1392
1393 * sim_callbacks.h (printf_filtered): Correct prototype.
1394
1395 Thu Sep 21 16:26:49 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1396
1397 * device_tree.c (OEA_MEMORY_SIZE): Define if not defined to
1398 0x100000.
1399 (clayton_memory_size): Define as OEA_MEMORY_SIZE.
1400
1401 * std-config.h (WITH_TRACE): Default to 1 now.
1402
1403 * psim.c (write_stack_arguments): Don't write any stack arguments
1404 if OEA.
1405
1406 * main.c (main): Switch to using getopt. Make -p also set
1407 trace_semantics. Make -a turn on all trace flags. Make -C turn
1408 on console tracing.
1409
1410 * device_tree.c (create_option_device_node): Assume a program is
1411 OEA if the start address is < 4096, not just == 0.
1412
1413 Wed Sep 20 13:36:06 1995 Ian Lance Taylor <ian@cygnus.com>
1414
1415 * Makefile.in (maintainer-clean): New synonym for realclean.
1416
1417 Sun Sep 10 10:23:56 1995 Michael Tiemann <tiemann@axon.cygnus.com>
1418
1419 * registers.c (register_description): Add gdb synonyms for cr
1420 (cnd) and msr (ps).
1421
1422 Fri Sep 8 13:16:10 1995 Ian Lance Taylor <ian@cygnus.com>
1423
1424 * Makefile.in (install): Don't install in $(tooldir).
1425
1426 * configure.in: Call AC_CONFIG_HEADER. Don't try to use
1427 bfd/hosts/*.h file or bfd/config/*.mh file. Call AC_PROG_CC and
1428 AC_PROG_RANLIB. Substitute in values for CFLAGS, HDEFINES, AR,
1429 and CC_FOR_BUILD. Call AC_CHECK_HEADERS for various header files.
1430 Touch stamp.h if creating config.h.
1431 * configure: Rebuild.
1432 * config.in: New file, created by autoheader.
1433 * Makefile.in (AR): Define as @AR@.
1434 (CC): New variable, defined as @CC@.
1435 (CFLAGS): Define as @CFLAGS@.
1436 (CC_FOR_BUILD): New variable, defined as @CC_FOR_BUILD@.
1437 (RANLIB): Define as @RANLIB@.
1438 (HDEFINES, TDEFINES): New variables.
1439 (@host_makefile_frag@): Remove.
1440 (mostlyclean): Make the same as clean, not distclean.
1441 (clean): Remove config.log.
1442 (distclean): Remove config.h and stamp-h.
1443 (Makefile): Don't depend upon @frags@. Just rebuild Makefile when
1444 invoking config.status.
1445 (config.h, stamp-h): New targets.
1446 (gen, gen.o): Build with CC_FOR_BUILD, not CC.
1447 (ppc-config.h): Rename from old config.h build.
1448 * (basics.h,gen.c,ppc-endian.c,psim.c): Include ppc-config.h.
1449
1450 Fri Sep 8 09:51:03 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1451
1452 * configure{,.in}: Don't include sysdep.h from bfd, since bfd no
1453 longer provides it.
1454 * basics.h (sysdep.h): Don't include it.
1455 * Makefile.in (BASICS_H): Remove sysdep.h.
1456
1457 Wed Sep 6 13:25:42 1995 Andrew Cagney <cagney@highland.com.au>
1458
1459 * core.c (core_add_data): First growth of bss was being put at
1460 wrong address (0) instead of &end.
1461
1462 * core.c (core_add_stack, core_add_data): Was not handling case
1463 where bss/stack is grown across the current end-of-{bss,stack}.
1464
1465 Wed Sep 6 00:46:10 1995 Andrew Cagney <cagney@highland.com.au>
1466
1467 * system.c (system_call): Fix SYS_break - was aligning bss to a
1468 page boundary instead of just an 8 byte one; On first call sbrk(0)
1469 != sbrk(0).
1470
1471 Thu Aug 24 14:48:54 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1472
1473 * Makefile.in (install): Fix install rule.
1474
1475 Tue Aug 22 09:31:18 1995 Michael Meissner <meissner@tiktok.cygnus.com>
1476
1477 * system.c (system_call): Add read support.
1478
1479 * main.c (main): -t sets trace_device_tree. Correct usage message
1480 to current reality.
1481
1482 * device_tree.c (update_memory_node_for_section): Make tracing
1483 output line up. If not code or readonly, assume that the section
1484 is a data section and has read/write permissions. Add readonly
1485 support.
1486
1487 * core.c (create_core_from_addresses): Print end address in traces
1488 and make tracing output line up.
1489
1490 * Makefile.in: Rewrite from Makefile to work with the Cygnus
1491 environment, and support compiling in a different directory than
1492 the sources reside in.
1493
1494 * ppc-endian.h: Rename from endian.h so that it doesn't get
1495 confused with /usr/include/sys/endian.h on Linux. Add Linux
1496 endian support.
1497
1498 * ppc-endian.c: Rename to be consistant with ppc-endian.h.
1499 Include ppc-endian.h, not endian.h.
1500
1501 * basics.h (sysdep.h): Include sysdep.h that configure makes.
1502 Include ppc-endian.h, not endian.h.
1503
1504 * std-config.h: Rename from ppc-config. Put #ifndefs around most
1505 configuration macros, so they can be overridden via CFLAGS. By
1506 default, turn off tracing.
1507
1508 * configure.in: Clone from other simulator targets.
1509 * configure: Generate via autoconf from configure.in.
1510
1511 Sat Aug 19 09:05:32 1995 Andrew Cagney <cagney@highland.com.au>
1512
1513 * ppc-instructions: fix srawi (was geting XER[CA] real wrong).
1514
1515 * interrupts.c (data_storage_interrupt): allow stack to grow by
1516 upto one MB per increment.
1517
1518 * ppc-instructions: divw was computing rA / rA not rA / rB
1519
1520 * main.c (main): really stupid. Wasn't exiting with correct status
1521
1522 Fri Aug 18 00:38:01 1995 Andrew Cagney <cagney@highland.com.au>
1523
1524 * system.c (system_call): add system calls kill(2) and getpid(2).
1525
1526 * main.c (main): Check/return exit status when simulation
1527 finishes.
1528
1529 Thu Aug 17 14:29:18 1995 Andrew Cagney <cagney@highland.com.au>
1530
1531 * device_tree.c (create_option_device_node): Alignment rules (at
1532 least for the moment) now are for strict alignment only for LE OEA
1533 mode. (Because of compiler problems).
1534
1535 * system.c (system_call) SYS_exit: Wasn't exiting with correct status.
1536
1537 Thu Aug 17 01:16:38 1995 Andrew Cagney <cagney@highland.com.au>
1538
1539 * vm.c (DEFINE_VM_DATA_MAP_WRITE_N): For miss aligned transfer
1540 forgot to return.
1541
1542 * system.c (system_call): didn't page align break argument before
1543 determining increment break increment.
1544
1545 * psim/ppc: Re-arange entire directory structure so that
1546 everything lives in the one directory. While a pain for cleaning,
1547 makes building across multiple architectures much simpler.
1548
1549 * devices.c, device_tree.c: Added code that provides a simple
1550 illustration of how an interrupt control device could be
1551 implemented.
1552
1553 * devices.c: Added code so that the dumb console device can read
1554 (from stdin) as well as write to stdout.
1555