From 89d0973831b0930f621b6a5e666760dc1b684ed6 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 28 Oct 1997 07:10:36 +0000 Subject: [PATCH] Add support for 16 byte quantities to sim-endian macro H2T. Add model-filter field to option, include, model anf function igen records --- sim/common/ChangeLog | 5 ++++ sim/common/sim-endian.h | 13 +++++---- sim/common/sim-n-core.h | 5 ++++ sim/igen/ChangeLog | 28 ++++++++++++++++++ sim/igen/ld-insn.h | 77 ++++++++++++++++++++++++++++++++----------------- sim/mips/ChangeLog | 4 +++ sim/mips/mips.igen | 52 ++++++++++++++++----------------- sim/tic80/ChangeLog | 4 +++ sim/tic80/insns | 32 ++++++++++---------- sim/v850/ChangeLog | 8 +++++ 10 files changed, 153 insertions(+), 75 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 2694cd8..1bf1dcc 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,10 @@ Tue Oct 28 12:29:22 1997 Andrew Cagney + * sim-endian.h (H2T): Handle 16 byte variables. + + * sim-n-core.h (sim_core_read_unaligned_N): Return a dummy when an + error. + * sim-core.c: Do not generate sim_core_*_word. * sim-n-core.h (sim_core_trace_N): Add line_nr argument. diff --git a/sim/common/sim-endian.h b/sim/common/sim-endian.h index 1dca5e7..5efba30 100644 --- a/sim/common/sim-endian.h +++ b/sim/common/sim-endian.h @@ -133,12 +133,13 @@ INLINE_SIM_ENDIAN(void*) offset_16(unsigned_16 *x, unsigned ws, unsigned w); #define H2T(VARIABLE) \ do { \ - switch (sizeof(VARIABLE)) { \ - case 1: VARIABLE = H2T_1(VARIABLE); break; \ - case 2: VARIABLE = H2T_2(VARIABLE); break; \ - case 4: VARIABLE = H2T_4(VARIABLE); break; \ - case 8: VARIABLE = H2T_8(VARIABLE); break; \ - /*case 16: VARIABLE = H2T_16(VARIABLE); break;*/ \ + void *vp = &(VARIABLE); \ + switch (sizeof (VARIABLE)) { \ + case 1: *(unsigned_1*)vp = H2T_1(*(unsigned_1*)vp); break; \ + case 2: *(unsigned_2*)vp = H2T_2(*(unsigned_2*)vp); break; \ + case 4: *(unsigned_4*)vp = H2T_4(*(unsigned_4*)vp); break; \ + case 8: *(unsigned_8*)vp = H2T_8(*(unsigned_8*)vp); break; \ + case 16: *(unsigned_16*)vp = H2T_16(*(unsigned_16*)vp); break; \ } \ } while (0) diff --git a/sim/common/sim-n-core.h b/sim/common/sim-n-core.h index 0184b1d..b7bc631 100644 --- a/sim/common/sim-n-core.h +++ b/sim/common/sim-n-core.h @@ -178,6 +178,11 @@ sim_core_read_unaligned_N(sim_cpu *cpu, sim_engine_abort (CPU_STATE (cpu), cpu, cia, "internal error - %s - bad switch", XSTRING (sim_core_read_unaligned_N)); + /* to keep some compilers happy, we return a dummy */ + { + unsigned_N val[1] = { }; + return val[0]; + } } } diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index b535133..200e1e0 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,3 +1,31 @@ +Tue Oct 28 10:50:35 1997 Andrew Cagney + + * gen-icache.c (print_icache_extraction): Force result of atol to + unsigned. + + * ld-insn.c (parse_function_record): Separate handling of old and + ney fynction records. + (load_insn_table): For %s record, hack function name & type after + it has been parsed. + + * filter.h (filter_is_subset): Reverse argument names, wrong + order. + + * ld-insn.c (load_insn_table): Move include code to. + (parse_include_record): New function. Check for filtering of + include statement by both flags and models. + (load_insn_table): Check for model filtering of cache and model + records. + (parse_model_data_record): Check for model & flag filtering of + model data records. + (parse_function_record): Check for model & flag filtering of + function records. + + * ld-insn.h: Define record_filter_models_field. Add filter-models + field to all but instruction records. + (struct _function_entry, struct _cache_entry): Add models field. + (nr_function_fields): Make parm field mandatory. + Mon Oct 27 15:14:26 1997 Andrew Cagney * igen.c (main): Change -I option to -I. Add optional diff --git a/sim/igen/ld-insn.h b/sim/igen/ld-insn.h index be6f4be..e5bec1d 100644 --- a/sim/igen/ld-insn.h +++ b/sim/igen/ld-insn.h @@ -25,12 +25,21 @@ typedef unsigned64 insn_uint; /* Common among most entries: + All non instruction records have the format: + + <...> ::= + ":" + ":" + ":" + ":" ... + */ enum { record_type_field = 1, old_record_type_field = 2, record_filter_flags_field = 2, + record_filter_models_field = 3, }; @@ -41,6 +50,7 @@ enum { ::= ":" "include" ":" + ":" ":" ; @@ -48,8 +58,8 @@ enum { */ enum { - include_record_filename_field = 3, - nr_include_record_fields = 4, + include_filename_field = 4, + nr_include_fields, }; @@ -62,6 +72,7 @@ enum {