From: Matthew Green Date: Fri, 14 Dec 2001 00:22:13 +0000 (+0000) Subject: * support sim-fpu.c for correct FP emulation. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d29d5195ca872bb2de549abd7fe2493764580054;p=binutils-gdb.git * support sim-fpu.c for correct FP emulation. * Makefile.in (LIB_OBJ): Add @sim_fpu@. (ICACHE_CFLAGS, SEMANTICS_CFLAGS): New variables. (icache.o, semantics.o): Add new ICACHE_FLAGS & SEMANTICS_FLAGS. (sim-fpu.o, sim-bits.o, tconfig.h): New targets. * configure.in: Rename INLINE_LOCALS to PSIM_INLINE_LOCALS. Add a check for sim/common/sim-fpu.c. Output sim_fpu and sim_fpu_cflags. * configure: Regenerate. * device.h (device_find_integer_array_property): Match function definition. * gen-icache.c (print_icache_internal_function_declaration): Rename INLINE_ICACHE to PSIM_INLINE_ICACHE. * gen-idecode.c (print_idecode_run_function_header): Rename INLINE_IDECODE to PSIM_INLINE_IDECODE. * gen-semantics.c (print_semantic_function_header): Rename EXTERN_SEMANTICS to PSIM_EXTERN_SEMANTICS. * gen-support.c (print_support_function_name): Rename INLINE_SUPPORT to PSIM_INLINE_SUPPORT. * igen.c (print_function_name): Also escape `(' and `)'. (gen_semantics_h): Rename EXTERN_SEMANTICS to PSIM_EXTERN_SEMANTICS. (gen_semantics_c): Likewise. Also output includes for "sim-fpu.h" * inline.h (INLINE_SIM_ENDIAN): Renamed INLINE_PSIM_ENDIAN. (EXTERN_SIM_ENDIAN): Renamed EXTERN_PSIM_ENDIAN. (STATIC_INLINE_SIM_ENDIAN): Renamed STATIC_INLINE_PSIM_ENDIAN. (INLINE_LOCALS): Renamed PSIM_INLINE_LOCALS. (EXTERN_SUPPORT): Renamed PSIM_EXTERN_SUPPORT. (INLINE_SUPPORT): Renamed PSIM_INLINE_SUPPORT. (EXTERN_SEMANTICS): Renamed PSIM_EXTERN_SEMANTICS. (INLINE_SEMANTICS): Renamed PSIM_INLINE_SEMANTICS. (EXTERN_IDECODE): Renamed PSIM_EXTERN_IDECODE. (INLINE_IDECODE): Renamed PSIM_INLINE_IDECODE. (EXTERN_ICACHE): Renamed PSIM_EXTERN_ICACHE. (INLINE_ICACHE): Renamed PSIM_INLINE_ICACHE. * options.c (options_inline): Fix names. * sim-endian-n.h: Change INLINE_SIM_ENDIAN to INLINE_PSIM_ENDIAN. * sim-endian.h: Likewise. * sim-main.h: New file. * std-config.h: Rename INLINE_LOCALS to PSIM_INLINE_LOCALS. --- diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 564666dd98a..dc5d004bb7e 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,42 @@ +2001-12-14 matthew green + + * Makefile.in (LIB_OBJ): Add @sim_fpu@. + (ICACHE_CFLAGS, SEMANTICS_CFLAGS): New variables. + (icache.o, semantics.o): Add new ICACHE_FLAGS & SEMANTICS_FLAGS. + (sim-fpu.o, sim-bits.o, tconfig.h): New targets. + * configure.in: Rename INLINE_LOCALS to PSIM_INLINE_LOCALS. Add a + check for sim/common/sim-fpu.c. Output sim_fpu and sim_fpu_cflags. + * configure: Regenerate. + * device.h (device_find_integer_array_property): Match function definition. + * gen-icache.c (print_icache_internal_function_declaration): Rename + INLINE_ICACHE to PSIM_INLINE_ICACHE. + * gen-idecode.c (print_idecode_run_function_header): Rename INLINE_IDECODE + to PSIM_INLINE_IDECODE. + * gen-semantics.c (print_semantic_function_header): Rename + EXTERN_SEMANTICS to PSIM_EXTERN_SEMANTICS. + * gen-support.c (print_support_function_name): Rename INLINE_SUPPORT to + PSIM_INLINE_SUPPORT. + * igen.c (print_function_name): Also escape `(' and `)'. + (gen_semantics_h): Rename EXTERN_SEMANTICS to PSIM_EXTERN_SEMANTICS. + (gen_semantics_c): Likewise. Also output includes for "sim-fpu.h" + * inline.h (INLINE_SIM_ENDIAN): Renamed INLINE_PSIM_ENDIAN. + (EXTERN_SIM_ENDIAN): Renamed EXTERN_PSIM_ENDIAN. + (STATIC_INLINE_SIM_ENDIAN): Renamed STATIC_INLINE_PSIM_ENDIAN. + (INLINE_LOCALS): Renamed PSIM_INLINE_LOCALS. + (EXTERN_SUPPORT): Renamed PSIM_EXTERN_SUPPORT. + (INLINE_SUPPORT): Renamed PSIM_INLINE_SUPPORT. + (EXTERN_SEMANTICS): Renamed PSIM_EXTERN_SEMANTICS. + (INLINE_SEMANTICS): Renamed PSIM_INLINE_SEMANTICS. + (EXTERN_IDECODE): Renamed PSIM_EXTERN_IDECODE. + (INLINE_IDECODE): Renamed PSIM_INLINE_IDECODE. + (EXTERN_ICACHE): Renamed PSIM_EXTERN_ICACHE. + (INLINE_ICACHE): Renamed PSIM_INLINE_ICACHE. + * options.c (options_inline): Fix names. + * sim-endian-n.h: Change INLINE_SIM_ENDIAN to INLINE_PSIM_ENDIAN. + * sim-endian.h: Likewise. + * sim-main.h: New file. + * std-config.h: Rename INLINE_LOCALS to PSIM_INLINE_LOCALS. + 2001-12-01 Andrew Cagney From Mark Peek. diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 6007ce08d9a..5aea414fc37 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -306,6 +306,7 @@ LIB_OBJ = \ semantics.o \ idecode.o \ support.o \ + @sim_fpu@ \ psim.o \ $(PACKAGE_OBJ) \ $(HW_OBJ) \ @@ -314,6 +315,9 @@ LIB_OBJ = \ GDB_OBJ = sim_calls.o @sim_callback@ +ICACHE_CFLAGS = @sim_fpu_cflags@ +SEMANTICS_CFLAGS = @sim_fpu_cflags@ + HW_SRC = @sim_hw_src@ HW_OBJ = @sim_hw_obj@ @@ -386,10 +390,10 @@ device_table.o: device_table.c $(DEVICE_TABLE_H) events.h hw.c cap.o: cap.c cap.h $(BASICS_H) semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H) - $(CC) -c $(NOWARN_CFLAGS) $< + $(CC) -c $(SEMANTICS_CFLAGS) $(NOWARN_CFLAGS) $< icache.o: icache.c icache.h $(IDECODE_H) $(CPU_H) - $(CC) -c $(NOWARN_CFLAGS) $< + $(CC) -c $(ICACHE_CFLAGS) $(NOWARN_CFLAGS) $< support.o: support.c support.h $(IDECODE_H) $(CPU_H) @@ -422,6 +426,16 @@ callback.o: ../common/callback.c targ-vals.h config.h targ-map.o: targ-map.c targ-vals.h +sim-fpu.o: $(srcdir)/../common/sim-fpu.c config.h tconfig.h + $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c + +sim-bits.o: $(srcdir)/../common/sim-bits.c config.h tconfig.h + $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-bits.c + +tconfig.h: + rm -f tconfig.h + echo > tconfig.h + # Rebuild options whenever something changes so the date/time is up to date. options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile defines.h $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $< diff --git a/sim/ppc/configure b/sim/ppc/configure index dcedf5d3843..6eb49968c51 100755 --- a/sim/ppc/configure +++ b/sim/ppc/configure @@ -3242,7 +3242,7 @@ case "$enableval" in no) sim_inline="-DDEFAULT_INLINE=0";; 0) sim_inline="-DDEFAULT_INLINE=0";; yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";; - 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";; + 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";; *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do new_flag="" case "$x" in @@ -3263,7 +3263,7 @@ if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then fi else if test x"$GCC" != ""; then - sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS" + sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS" if test x"$silent" != x"yes"; then echo "Setting inline flags = $sim_inline" 6>&1 fi @@ -4663,13 +4663,25 @@ else sim_targ_vals="" fi +echo $ac_n "checking for common simulator directory fpu implementation""... $ac_c" 1>&6 +echo "configure:4668: checking for common simulator directory fpu implementation" >&5 +if test -f "${srcdir}/../common/sim-fpu.c"; then + echo "$ac_t""yes" 1>&6 + sim_fpu_cflags="-DHAVE_COMMON_FPU -I${srcdir}/../common" + sim_fpu="sim-fpu.o sim-bits.o" +else + echo "$ac_t""no" 1>&6 + sim_fpu_cflags= + sim_fpu= +fi + echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:4668: checking for Cygwin environment" >&5 +echo "configure:4680: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -4697,19 +4709,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:4701: checking for mingw32 environment" >&5 +echo "configure:4713: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -4728,7 +4740,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4732: checking for executable suffix" >&5 +echo "configure:4744: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4738,7 +4750,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -4767,7 +4779,7 @@ AR=${AR-ar} # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4771: checking for $ac_word" >&5 +echo "configure:4783: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4834,6 +4846,8 @@ fi + + @@ -5069,6 +5083,8 @@ s%@sim_termio@%$sim_termio%g s%@sim_devzero@%$sim_devzero%g s%@sim_callback@%$sim_callback%g s%@sim_targ_vals@%$sim_targ_vals%g +s%@sim_fpu_cflags@%$sim_fpu_cflags%g +s%@sim_fpu@%$sim_fpu%g CEOF EOF @@ -5077,7 +5093,7 @@ cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. diff --git a/sim/ppc/configure.in b/sim/ppc/configure.in index 728f136e966..e4c2236fcb6 100644 --- a/sim/ppc/configure.in +++ b/sim/ppc/configure.in @@ -291,7 +291,7 @@ case "$enableval" in no) sim_inline="-DDEFAULT_INLINE=0";; 0) sim_inline="-DDEFAULT_INLINE=0";; yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";; - 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";; + 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";; *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do new_flag="" case "$x" in @@ -310,7 +310,7 @@ esac if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then echo "Setting inline flags = $sim_inline" 6>&1 fi],[if test x"$GCC" != ""; then - sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS" + sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS" if test x"$silent" != x"yes"; then echo "Setting inline flags = $sim_inline" 6>&1 fi @@ -689,6 +689,17 @@ else sim_targ_vals="" fi +AC_MSG_CHECKING(for common simulator directory fpu implementation) +if test -f "${srcdir}/../common/sim-fpu.c"; then + AC_MSG_RESULT(yes) + sim_fpu_cflags="-DHAVE_COMMON_FPU -I${srcdir}/../common" + sim_fpu="sim-fpu.o sim-bits.o" +else + AC_MSG_RESULT(no) + sim_fpu_cflags= + sim_fpu= +fi + dnl Check for exe extension AC_EXEEXT @@ -740,6 +751,8 @@ AC_SUBST(sim_termio) AC_SUBST(sim_devzero) AC_SUBST(sim_callback) AC_SUBST(sim_targ_vals) +AC_SUBST(sim_fpu_cflags) +AC_SUBST(sim_fpu) AC_OUTPUT(Makefile, [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac]) diff --git a/sim/ppc/device.h b/sim/ppc/device.h index 56c8ce54d99..d7117916d4a 100644 --- a/sim/ppc/device.h +++ b/sim/ppc/device.h @@ -335,7 +335,7 @@ INLINE_DEVICE\ (device *me, const char *property, unsigned index, - signed_word *integer); + signed_cell *integer); diff --git a/sim/ppc/gen-icache.c b/sim/ppc/gen-icache.c index 0d58ab1873a..8665ec8eacb 100644 --- a/sim/ppc/gen-icache.c +++ b/sim/ppc/gen-icache.c @@ -623,7 +623,7 @@ print_icache_internal_function_declaration(insn_table *table, ASSERT((code & generate_with_icache) != 0); if (it_is("internal", function->fields[insn_flags])) { lf_printf(file, "\n"); - lf_print_function_type(file, ICACHE_FUNCTION_TYPE, "INLINE_ICACHE", + lf_print_function_type(file, ICACHE_FUNCTION_TYPE, "PSIM_INLINE_ICACHE", "\n"); print_function_name(file, function->fields[insn_name], @@ -643,7 +643,7 @@ print_icache_internal_function_definition(insn_table *table, ASSERT((code & generate_with_icache) != 0); if (it_is("internal", function->fields[insn_flags])) { lf_printf(file, "\n"); - lf_print_function_type(file, ICACHE_FUNCTION_TYPE, "INLINE_ICACHE", + lf_print_function_type(file, ICACHE_FUNCTION_TYPE, "PSIM_INLINE_ICACHE", "\n"); print_function_name(file, function->fields[insn_name], diff --git a/sim/ppc/gen-idecode.c b/sim/ppc/gen-idecode.c index 397dcde1816..87d76a06029 100644 --- a/sim/ppc/gen-idecode.c +++ b/sim/ppc/gen-idecode.c @@ -1448,7 +1448,7 @@ print_idecode_run_function_header(lf *file, { int indent; lf_printf(file, "\n"); - lf_print_function_type(file, "void", "INLINE_IDECODE", (is_definition ? " " : "\n")); + lf_print_function_type(file, "void", "PSIM_INLINE_IDECODE", (is_definition ? " " : "\n")); indent = lf_putstr(file, (can_stop ? "idecode_run_until_stop" : "idecode_run")); if (is_definition) lf_putstr(file, "\n"); diff --git a/sim/ppc/gen-semantics.c b/sim/ppc/gen-semantics.c index b4c0613fe50..68682dcaac6 100644 --- a/sim/ppc/gen-semantics.c +++ b/sim/ppc/gen-semantics.c @@ -44,7 +44,7 @@ print_semantic_function_header(lf *file, { int indent; lf_printf(file, "\n"); - lf_print_function_type(file, SEMANTIC_FUNCTION_TYPE, "EXTERN_SEMANTICS", + lf_print_function_type(file, SEMANTIC_FUNCTION_TYPE, "PSIM_EXTERN_SEMANTICS", (is_function_definition ? "\n" : " ")); indent = print_function_name(file, basename, diff --git a/sim/ppc/gen-support.c b/sim/ppc/gen-support.c index 56edec38e5f..d3067c33348 100644 --- a/sim/ppc/gen-support.c +++ b/sim/ppc/gen-support.c @@ -38,7 +38,7 @@ print_support_function_name(lf *file, int is_function_definition) { if (it_is("internal", function->fields[insn_flags])) { - lf_print_function_type(file, SEMANTIC_FUNCTION_TYPE, "INLINE_SUPPORT", + lf_print_function_type(file, SEMANTIC_FUNCTION_TYPE, "PSIM_INLINE_SUPPORT", (is_function_definition ? "\n" : " ")); print_function_name(file, function->fields[function_name], @@ -52,7 +52,7 @@ print_support_function_name(lf *file, else { lf_print_function_type(file, function->fields[function_type], - "INLINE_SUPPORT", + "PSIM_INLINE_SUPPORT", (is_function_definition ? "\n" : " ")); lf_printf(file, "%s\n(%s)%s", function->fields[function_name], diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 94dcf5130dc..ae81142fac5 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -107,6 +107,8 @@ print_function_name(lf *file, switch (*pos) { case '/': case '-': + case '(': + case ')': break; case ' ': nr += lf_putchr(file, '_'); @@ -184,7 +186,7 @@ gen_semantics_h(insn_table *table, lf_printf(file, "extern int option_mpc860c0;\n"); lf_printf(file, "#define PAGE_SIZE 0x1000\n"); lf_printf(file, "\n"); - lf_printf(file, "EXTERN_SEMANTICS(void)\n"); + lf_printf(file, "PSIM_EXTERN_SEMANTICS(void)\n"); lf_printf(file, "semantic_init(device* root);\n"); lf_printf(file, "\n"); if (generate_expanded_instructions) @@ -219,10 +221,12 @@ gen_semantics_c(insn_table *table, lf_printf(file, "#include \"idecode.h\"\n"); lf_printf(file, "#include \"semantics.h\"\n"); lf_printf(file, "#include \"support.h\"\n"); + lf_printf(file, "#include \"sim-inline.h\"\n"); + lf_printf(file, "#include \"sim-fpu.h\"\n"); lf_printf(file, "\n"); lf_printf(file, "int option_mpc860c0 = 0;\n"); lf_printf(file, "\n"); - lf_printf(file, "EXTERN_SEMANTICS(void)\n"); + lf_printf(file, "PSIM_EXTERN_SEMANTICS(void)\n"); lf_printf(file, "semantic_init(device* root)\n"); lf_printf(file, "{\n"); lf_printf(file, " option_mpc860c0 = 0;\n"); @@ -303,6 +307,8 @@ gen_icache_c(insn_table *table, lf_printf(file, "#include \"semantics.h\"\n"); lf_printf(file, "#include \"icache.h\"\n"); lf_printf(file, "#include \"support.h\"\n"); + lf_printf(file, "#include \"sim-inline.h\"\n"); + lf_printf(file, "#include \"sim-fpu.h\"\n"); lf_printf(file, "\n"); insn_table_traverse_function(table, file, NULL, diff --git a/sim/ppc/inline.h b/sim/ppc/inline.h index f88cd9e4904..6ff94153c25 100644 --- a/sim/ppc/inline.h +++ b/sim/ppc/inline.h @@ -30,21 +30,21 @@ #if !defined(_SIM_ENDIAN_C_) && (SIM_ENDIAN_INLINE & INCLUDE_MODULE) # if (SIM_ENDIAN_INLINE & INLINE_MODULE) -# define INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE UNUSED -# define EXTERN_SIM_ENDIAN(TYPE) static TYPE UNUSED +# define INLINE_PSIM_ENDIAN(TYPE) static INLINE TYPE UNUSED +# define EXTERN_PSIM_ENDIAN(TYPE) static TYPE UNUSED # else -# define INLINE_SIM_ENDIAN(TYPE) static TYPE UNUSED -# define EXTERN_SIM_ENDIAN(TYPE) static TYPE UNUSED +# define INLINE_PSIM_ENDIAN(TYPE) static TYPE UNUSED +# define EXTERN_PSIM_ENDIAN(TYPE) static TYPE UNUSED # endif #else -# define INLINE_SIM_ENDIAN(TYPE) TYPE -# define EXTERN_SIM_ENDIAN(TYPE) TYPE +# define INLINE_PSIM_ENDIAN(TYPE) TYPE +# define EXTERN_PSIM_ENDIAN(TYPE) TYPE #endif -#if (SIM_ENDIAN_INLINE & INLINE_LOCALS) -# define STATIC_INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE +#if (SIM_ENDIAN_INLINE & PSIM_INLINE_LOCALS) +# define STATIC_INLINE_PSIM_ENDIAN(TYPE) static INLINE TYPE #else -# define STATIC_INLINE_SIM_ENDIAN(TYPE) static TYPE +# define STATIC_INLINE_PSIM_ENDIAN(TYPE) static TYPE #endif @@ -63,7 +63,7 @@ # define EXTERN_BITS(TYPE) TYPE #endif -#if (BITS_INLINE & INLINE_LOCALS) +#if (BITS_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_BITS(TYPE) static INLINE TYPE #else # define STATIC_INLINE_BITS(TYPE) static TYPE @@ -85,7 +85,7 @@ # define EXTERN_CORE(TYPE) TYPE #endif -#if (CORE_INLINE & INLINE_LOCALS) +#if (CORE_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_CORE(TYPE) static INLINE TYPE #else # define STATIC_INLINE_CORE(TYPE) static TYPE @@ -107,7 +107,7 @@ # define EXTERN_VM(TYPE) TYPE #endif -#if (VM_INLINE & INLINE_LOCALS) +#if (VM_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_VM(TYPE) static INLINE TYPE #else # define STATIC_INLINE_VM(TYPE) static TYPE @@ -129,7 +129,7 @@ # define EXTERN_CPU(TYPE) TYPE #endif -#if (CPU_INLINE & INLINE_LOCALS) +#if (CPU_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_CPU(TYPE) static INLINE TYPE #else # define STATIC_INLINE_CPU(TYPE) static TYPE @@ -151,7 +151,7 @@ # define EXTERN_MODEL(TYPE) TYPE #endif -#if (MODEL_INLINE & INLINE_LOCALS) +#if (MODEL_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_MODEL(TYPE) static INLINE TYPE #else # define STATIC_INLINE_MODEL(TYPE) static TYPE @@ -173,7 +173,7 @@ # define EXTERN_EVENTS(TYPE) TYPE #endif -#if (EVENTS_INLINE & INLINE_LOCALS) +#if (EVENTS_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_EVENTS(TYPE) static INLINE TYPE #else # define STATIC_INLINE_EVENTS(TYPE) static TYPE @@ -195,7 +195,7 @@ # define EXTERN_MON(TYPE) TYPE #endif -#if (MON_INLINE & INLINE_LOCALS) +#if (MON_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_MON(TYPE) static INLINE TYPE #else # define STATIC_INLINE_MON(TYPE) static TYPE @@ -217,7 +217,7 @@ # define EXTERN_REGISTERS(TYPE) TYPE #endif -#if (REGISTERS_INLINE & INLINE_LOCALS) +#if (REGISTERS_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_REGISTERS(TYPE) static INLINE TYPE #else # define STATIC_INLINE_REGISTERS(TYPE) static TYPE @@ -239,7 +239,7 @@ # define EXTERN_INTERRUPTS(TYPE) TYPE #endif -#if (INTERRUPTS_INLINE & INLINE_LOCALS) +#if (INTERRUPTS_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_INTERRUPTS(TYPE) static INLINE TYPE #else # define STATIC_INLINE_INTERRUPTS(TYPE) static TYPE @@ -261,7 +261,7 @@ # define EXTERN_DEVICE(TYPE) TYPE #endif -#if (DEVICE_INLINE & INLINE_LOCALS) +#if (DEVICE_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_DEVICE(TYPE) static INLINE TYPE #else # define STATIC_INLINE_DEVICE(TYPE) static TYPE @@ -283,7 +283,7 @@ # define EXTERN_TREE(TYPE) TYPE #endif -#if (TREE_INLINE & INLINE_LOCALS) +#if (TREE_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_TREE(TYPE) static INLINE TYPE #else # define STATIC_INLINE_TREE(TYPE) static TYPE @@ -305,7 +305,7 @@ # define EXTERN_SPREG(TYPE) TYPE #endif -#if (SPREG_INLINE & INLINE_LOCALS) +#if (SPREG_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_SPREG(TYPE) static INLINE TYPE #else # define STATIC_INLINE_SPREG(TYPE) static TYPE @@ -316,88 +316,96 @@ #if defined(_INLINE_C_) && !defined(_SEMANTICS_C_) && (SEMANTICS_INLINE & INCLUDE_MODULE) # if (SEMANTICS_INLINE & INLINE_MODULE) -# define INLINE_SEMANTICS(TYPE) static INLINE TYPE UNUSED -# define EXTERN_SEMANTICS(TYPE) static TYPE UNUSED REGPARM +# define PSIM_INLINE_SEMANTICS(TYPE) static INLINE TYPE UNUSED +# define PSIM_EXTERN_SEMANTICS(TYPE) static TYPE UNUSED REGPARM #else -# define INLINE_SEMANTICS(TYPE) static TYPE UNUSED REGPARM -# define EXTERN_SEMANTICS(TYPE) static TYPE UNUSED REGPARM +# define PSIM_INLINE_SEMANTICS(TYPE) static TYPE UNUSED REGPARM +# define PSIM_EXTERN_SEMANTICS(TYPE) static TYPE UNUSED REGPARM #endif #else -# define INLINE_SEMANTICS(TYPE) TYPE REGPARM -# define EXTERN_SEMANTICS(TYPE) TYPE REGPARM +# define PSIM_INLINE_SEMANTICS(TYPE) TYPE REGPARM +# define PSIM_EXTERN_SEMANTICS(TYPE) TYPE REGPARM #endif -#if (SEMANTICS_INLINE & INLINE_LOCALS) +#if 0 /* this isn't used */ +#if (SEMANTICS_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_SEMANTICS(TYPE) static INLINE TYPE #else # define STATIC_INLINE_SEMANTICS(TYPE) static TYPE REGPARM #endif +#endif /* idecode is actually not inlined */ #if defined(_INLINE_C_) && !defined(_IDECODE_C_) && (IDECODE_INLINE & INCLUDE_MODULE) # if (IDECODE_INLINE & INLINE_MODULE) -# define INLINE_IDECODE(TYPE) static INLINE TYPE UNUSED +# define PSIM_INLINE_IDECODE(TYPE) static INLINE TYPE UNUSED # define EXTERN_IDECODE(TYPE) static TYPE UNUSED REGPARM #else -# define INLINE_IDECODE(TYPE) static TYPE UNUSED REGPARM +# define PSIM_INLINE_IDECODE(TYPE) static TYPE UNUSED REGPARM # define EXTERN_IDECODE(TYPE) static TYPE UNUSED REGPARM #endif #else -# define INLINE_IDECODE(TYPE) TYPE REGPARM +# define PSIM_INLINE_IDECODE(TYPE) TYPE REGPARM # define EXTERN_IDECODE(TYPE) TYPE REGPARM #endif -#if (IDECODE_INLINE & INLINE_LOCALS) +#if 0 /* this isn't used */ +#if (IDECODE_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_IDECODE(TYPE) static INLINE TYPE #else # define STATIC_INLINE_IDECODE(TYPE) static TYPE REGPARM #endif +#endif /* icache is inlined with inline.c */ #if defined(_INLINE_C_) && !defined(_ICACHE_C_) && (ICACHE_INLINE & INCLUDE_MODULE) # if (ICACHE_INLINE & INLINE_MODULE) -# define INLINE_ICACHE(TYPE) static INLINE TYPE UNUSED +# define PSIM_INLINE_ICACHE(TYPE) static INLINE TYPE UNUSED # define EXTERN_ICACHE(TYPE) static TYPE UNUSED REGPARM #else -# define INLINE_ICACHE(TYPE) static TYPE UNUSED REGPARM +# define PSIM_INLINE_ICACHE(TYPE) static TYPE UNUSED REGPARM # define EXTERN_ICACHE(TYPE) static TYPE UNUSED REGPARM #endif #else -# define INLINE_ICACHE(TYPE) TYPE REGPARM +# define PSIM_INLINE_ICACHE(TYPE) TYPE REGPARM # define EXTERN_ICACHE(TYPE) TYPE REGPARM #endif -#if (ICACHE_INLINE & INLINE_LOCALS) +#if 0 /* this isn't used */ +#if (ICACHE_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_ICACHE(TYPE) static INLINE TYPE #else # define STATIC_INLINE_ICACHE(TYPE) static TYPE REGPARM #endif +#endif /* support is always inlined */ #if !defined(_SUPPORT_C_) && (SUPPORT_INLINE & INCLUDE_MODULE) # if (SUPPORT_INLINE & INLINE_MODULE) -# define INLINE_SUPPORT(TYPE) static INLINE TYPE UNUSED +# define PSIM_INLINE_SUPPORT(TYPE) static INLINE TYPE UNUSED # define EXTERN_SUPPORT(TYPE) static TYPE UNUSED #else -# define INLINE_SUPPORT(TYPE) static TYPE UNUSED +# define PSIM_INLINE_SUPPORT(TYPE) static TYPE UNUSED # define EXTERN_SUPPORT(TYPE) static TYPE UNUSED #endif #else -# define INLINE_SUPPORT(TYPE) TYPE +# define PSIM_INLINE_SUPPORT(TYPE) TYPE # define EXTERN_SUPPORT(TYPE) TYPE #endif -#if (SUPPORT_INLINE & INLINE_LOCALS) +#if 0 /* this isn't used */ +#if (SUPPORT_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_SUPPORT(TYPE) static INLINE TYPE #else # define STATIC_INLINE_SUPPORT(TYPE) static TYPE #endif +#endif /* options is inlined with inline.c */ @@ -415,7 +423,7 @@ # define EXTERN_OPTIONS(TYPE) TYPE #endif -#if (OPTIONS_INLINE & INLINE_LOCALS) +#if (OPTIONS_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_OPTIONS(TYPE) static INLINE TYPE #else # define STATIC_INLINE_OPTIONS(TYPE) static TYPE @@ -437,7 +445,7 @@ # define EXTERN_OS_EMUL(TYPE) TYPE #endif -#if (OS_EMUL_INLINE & INLINE_LOCALS) +#if (OS_EMUL_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_OS_EMUL(TYPE) static INLINE TYPE #else # define STATIC_INLINE_OS_EMUL(TYPE) static TYPE @@ -459,7 +467,7 @@ # define EXTERN_PSIM(TYPE) TYPE #endif -#if (PSIM_INLINE & INLINE_LOCALS) +#if (PSIM_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_PSIM(TYPE) static INLINE TYPE #else # define STATIC_INLINE_PSIM(TYPE) static TYPE @@ -481,7 +489,7 @@ # define EXTERN_CAP(TYPE) TYPE #endif -#if (CAP_INLINE & INLINE_LOCALS) +#if (CAP_INLINE & PSIM_INLINE_LOCALS) # define STATIC_INLINE_CAP(TYPE) static INLINE TYPE #else # define STATIC_INLINE_CAP(TYPE) static TYPE diff --git a/sim/ppc/options.c b/sim/ppc/options.c index 2d31124752a..d7079eb3e7a 100644 --- a/sim/ppc/options.c +++ b/sim/ppc/options.c @@ -99,9 +99,9 @@ options_inline (int in) case /*1*/ REVEAL_MODULE: return "REVEAL_MODULE"; case /*2*/ INLINE_MODULE: return "INLINE_MODULE"; case /*3*/ REVEAL_MODULE|INLINE_MODULE: return "REVEAL_MODULE|INLINE_MODULE"; - case /*4*/ INLINE_LOCALS: return "LOCALS_INLINE"; - case /*5*/ INLINE_LOCALS|REVEAL_MODULE: return "INLINE_LOCALS|REVEAL_MODULE"; - case /*6*/ INLINE_LOCALS|INLINE_MODULE: return "INLINE_LOCALS|INLINE_MODULE"; + case /*4*/ PSIM_INLINE_LOCALS: return "PSIM_LOCALS_INLINE"; + case /*5*/ PSIM_INLINE_LOCALS|REVEAL_MODULE: return "PSIM_INLINE_LOCALS|REVEAL_MODULE"; + case /*6*/ PSIM_INLINE_LOCALS|INLINE_MODULE: return "PSIM_INLINE_LOCALS|INLINE_MODULE"; case /*7*/ ALL_INLINE: return "ALL_INLINE"; } return "0"; diff --git a/sim/ppc/sim-endian-n.h b/sim/ppc/sim-endian-n.h index 4d0410a92b2..9e7d4b9e767 100644 --- a/sim/ppc/sim-endian-n.h +++ b/sim/ppc/sim-endian-n.h @@ -35,7 +35,7 @@ #define endian_le2h_N XCONCAT2(endian_le2h_,N) -INLINE_SIM_ENDIAN\ +INLINE_PSIM_ENDIAN\ (unsigned_N) endian_t2h_N(unsigned_N raw_in) { @@ -48,7 +48,7 @@ endian_t2h_N(unsigned_N raw_in) } -INLINE_SIM_ENDIAN\ +INLINE_PSIM_ENDIAN\ (unsigned_N) endian_h2t_N(unsigned_N raw_in) { @@ -61,7 +61,7 @@ endian_h2t_N(unsigned_N raw_in) } -INLINE_SIM_ENDIAN\ +INLINE_PSIM_ENDIAN\ (unsigned_N) swap_N(unsigned_N raw_in) { @@ -70,7 +70,7 @@ swap_N(unsigned_N raw_in) -INLINE_SIM_ENDIAN\ +INLINE_PSIM_ENDIAN\ (unsigned_N) endian_h2be_N(unsigned_N raw_in) { @@ -83,7 +83,7 @@ endian_h2be_N(unsigned_N raw_in) } -INLINE_SIM_ENDIAN\ +INLINE_PSIM_ENDIAN\ (unsigned_N) endian_be2h_N(unsigned_N raw_in) { @@ -96,7 +96,7 @@ endian_be2h_N(unsigned_N raw_in) } -INLINE_SIM_ENDIAN\ +INLINE_PSIM_ENDIAN\ (unsigned_N) endian_h2le_N(unsigned_N raw_in) { @@ -109,7 +109,7 @@ endian_h2le_N(unsigned_N raw_in) } -INLINE_SIM_ENDIAN\ +INLINE_PSIM_ENDIAN\ (unsigned_N) endian_le2h_N(unsigned_N raw_in) { diff --git a/sim/ppc/sim-endian.h b/sim/ppc/sim-endian.h index 74e8f1b2b69..570a311f531 100644 --- a/sim/ppc/sim-endian.h +++ b/sim/ppc/sim-endian.h @@ -25,40 +25,40 @@ /* C byte conversion functions */ -INLINE_SIM_ENDIAN(unsigned_1) endian_h2t_1(unsigned_1 x); -INLINE_SIM_ENDIAN(unsigned_2) endian_h2t_2(unsigned_2 x); -INLINE_SIM_ENDIAN(unsigned_4) endian_h2t_4(unsigned_4 x); -INLINE_SIM_ENDIAN(unsigned_8) endian_h2t_8(unsigned_8 x); - -INLINE_SIM_ENDIAN(unsigned_1) endian_t2h_1(unsigned_1 x); -INLINE_SIM_ENDIAN(unsigned_2) endian_t2h_2(unsigned_2 x); -INLINE_SIM_ENDIAN(unsigned_4) endian_t2h_4(unsigned_4 x); -INLINE_SIM_ENDIAN(unsigned_8) endian_t2h_8(unsigned_8 x); - -INLINE_SIM_ENDIAN(unsigned_1) swap_1(unsigned_1 x); -INLINE_SIM_ENDIAN(unsigned_2) swap_2(unsigned_2 x); -INLINE_SIM_ENDIAN(unsigned_4) swap_4(unsigned_4 x); -INLINE_SIM_ENDIAN(unsigned_8) swap_8(unsigned_8 x); - -INLINE_SIM_ENDIAN(unsigned_1) endian_h2be_1(unsigned_1 x); -INLINE_SIM_ENDIAN(unsigned_2) endian_h2be_2(unsigned_2 x); -INLINE_SIM_ENDIAN(unsigned_4) endian_h2be_4(unsigned_4 x); -INLINE_SIM_ENDIAN(unsigned_8) endian_h2be_8(unsigned_8 x); - -INLINE_SIM_ENDIAN(unsigned_1) endian_be2h_1(unsigned_1 x); -INLINE_SIM_ENDIAN(unsigned_2) endian_be2h_2(unsigned_2 x); -INLINE_SIM_ENDIAN(unsigned_4) endian_be2h_4(unsigned_4 x); -INLINE_SIM_ENDIAN(unsigned_8) endian_be2h_8(unsigned_8 x); - -INLINE_SIM_ENDIAN(unsigned_1) endian_h2le_1(unsigned_1 x); -INLINE_SIM_ENDIAN(unsigned_2) endian_h2le_2(unsigned_2 x); -INLINE_SIM_ENDIAN(unsigned_4) endian_h2le_4(unsigned_4 x); -INLINE_SIM_ENDIAN(unsigned_8) endian_h2le_8(unsigned_8 x); - -INLINE_SIM_ENDIAN(unsigned_1) endian_le2h_1(unsigned_1 x); -INLINE_SIM_ENDIAN(unsigned_2) endian_le2h_2(unsigned_2 x); -INLINE_SIM_ENDIAN(unsigned_4) endian_le2h_4(unsigned_4 x); -INLINE_SIM_ENDIAN(unsigned_8) endian_le2h_8(unsigned_8 x); +INLINE_PSIM_ENDIAN(unsigned_1) endian_h2t_1(unsigned_1 x); +INLINE_PSIM_ENDIAN(unsigned_2) endian_h2t_2(unsigned_2 x); +INLINE_PSIM_ENDIAN(unsigned_4) endian_h2t_4(unsigned_4 x); +INLINE_PSIM_ENDIAN(unsigned_8) endian_h2t_8(unsigned_8 x); + +INLINE_PSIM_ENDIAN(unsigned_1) endian_t2h_1(unsigned_1 x); +INLINE_PSIM_ENDIAN(unsigned_2) endian_t2h_2(unsigned_2 x); +INLINE_PSIM_ENDIAN(unsigned_4) endian_t2h_4(unsigned_4 x); +INLINE_PSIM_ENDIAN(unsigned_8) endian_t2h_8(unsigned_8 x); + +INLINE_PSIM_ENDIAN(unsigned_1) swap_1(unsigned_1 x); +INLINE_PSIM_ENDIAN(unsigned_2) swap_2(unsigned_2 x); +INLINE_PSIM_ENDIAN(unsigned_4) swap_4(unsigned_4 x); +INLINE_PSIM_ENDIAN(unsigned_8) swap_8(unsigned_8 x); + +INLINE_PSIM_ENDIAN(unsigned_1) endian_h2be_1(unsigned_1 x); +INLINE_PSIM_ENDIAN(unsigned_2) endian_h2be_2(unsigned_2 x); +INLINE_PSIM_ENDIAN(unsigned_4) endian_h2be_4(unsigned_4 x); +INLINE_PSIM_ENDIAN(unsigned_8) endian_h2be_8(unsigned_8 x); + +INLINE_PSIM_ENDIAN(unsigned_1) endian_be2h_1(unsigned_1 x); +INLINE_PSIM_ENDIAN(unsigned_2) endian_be2h_2(unsigned_2 x); +INLINE_PSIM_ENDIAN(unsigned_4) endian_be2h_4(unsigned_4 x); +INLINE_PSIM_ENDIAN(unsigned_8) endian_be2h_8(unsigned_8 x); + +INLINE_PSIM_ENDIAN(unsigned_1) endian_h2le_1(unsigned_1 x); +INLINE_PSIM_ENDIAN(unsigned_2) endian_h2le_2(unsigned_2 x); +INLINE_PSIM_ENDIAN(unsigned_4) endian_h2le_4(unsigned_4 x); +INLINE_PSIM_ENDIAN(unsigned_8) endian_h2le_8(unsigned_8 x); + +INLINE_PSIM_ENDIAN(unsigned_1) endian_le2h_1(unsigned_1 x); +INLINE_PSIM_ENDIAN(unsigned_2) endian_le2h_2(unsigned_2 x); +INLINE_PSIM_ENDIAN(unsigned_4) endian_le2h_4(unsigned_4 x); +INLINE_PSIM_ENDIAN(unsigned_8) endian_le2h_8(unsigned_8 x); /* Host dependant: diff --git a/sim/ppc/sim-main.h b/sim/ppc/sim-main.h new file mode 100644 index 00000000000..1e565c119ed --- /dev/null +++ b/sim/ppc/sim-main.h @@ -0,0 +1,10 @@ +#include "sim-basics.h" +#include "sim-signal.h" + +typedef unsigned32 sim_cia; + +#include "sim-base.h" + +struct sim_state { + sim_state_base base; +}; diff --git a/sim/ppc/std-config.h b/sim/ppc/std-config.h index eaf35582346..0b7c260009a 100644 --- a/sim/ppc/std-config.h +++ b/sim/ppc/std-config.h @@ -340,7 +340,7 @@ extern int current_stdio; the module is included into a file being compiled, calls to its funtions can be eliminated. 2 implies 1. - INLINE_LOCALS: + PSIM_INLINE_LOCALS: Make internal (static) functions within the module `inline'. @@ -348,7 +348,7 @@ extern int current_stdio; INCLUDE_MODULE == (REVEAL_MODULE | INLINE_MODULE) - ALL_INLINE == (REVEAL_MODULE | INLINE_MODULE | INLINE_LOCALS) + ALL_INLINE == (REVEAL_MODULE | INLINE_MODULE | PSIM_INLINE_LOCALS) In addition to this, modules have been put into two categories. @@ -449,7 +449,7 @@ extern int current_stdio; #define REVEAL_MODULE 1 #define INLINE_MODULE 2 #define INCLUDE_MODULE (INLINE_MODULE | REVEAL_MODULE) -#define INLINE_LOCALS 4 +#define PSIM_INLINE_LOCALS 4 #define ALL_INLINE 7 /* Your compilers inline reserved word */ @@ -506,7 +506,7 @@ extern int current_stdio; /* Default macro to simplify control several of key the inlines */ #ifndef DEFAULT_INLINE -#define DEFAULT_INLINE INLINE_LOCALS +#define DEFAULT_INLINE PSIM_INLINE_LOCALS #endif /* Code that converts between hosts and target byte order. Used on @@ -580,7 +580,7 @@ extern int current_stdio; a jump table. */ #ifndef DEVICE_INLINE -#define DEVICE_INLINE (DEFAULT_INLINE ? INLINE_LOCALS : 0) +#define DEVICE_INLINE (DEFAULT_INLINE ? PSIM_INLINE_LOCALS : 0) #endif /* Code called used while the device tree is being built. @@ -588,7 +588,7 @@ extern int current_stdio; Inlining this is of no benefit */ #ifndef TREE_INLINE -#define TREE_INLINE (DEFAULT_INLINE ? INLINE_LOCALS : 0) +#define TREE_INLINE (DEFAULT_INLINE ? PSIM_INLINE_LOCALS : 0) #endif /* Code called whenever information on a Special Purpose Register is @@ -628,7 +628,7 @@ extern int current_stdio; code is reduced. */ #ifndef SUPPORT_INLINE -#define SUPPORT_INLINE INLINE_LOCALS +#define SUPPORT_INLINE PSIM_INLINE_LOCALS #endif /* Model specific code used in simulating functional units. Note, it actaully @@ -653,13 +653,13 @@ extern int current_stdio; into this file */ #ifndef IDECOCE_INLINE -#define IDECODE_INLINE INLINE_LOCALS +#define IDECODE_INLINE PSIM_INLINE_LOCALS #endif /* psim, isn't actually inlined */ #ifndef PSIM_INLINE -#define PSIM_INLINE INLINE_LOCALS +#define PSIM_INLINE PSIM_INLINE_LOCALS #endif /* Code to emulate os or rom compatibility. This code is called via a