diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index fd2c87e148..2a4a55f3f1 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,23 @@ +Mon Nov 27 17:46:33 1995 Michael Meissner + + * mon.c: Check for whether to include sys/types.h and sys/time.h. + + * configure.in: Check for include files sys/types.h and + sys/time.h. + * configure: Regenerate. + * config.in: Regenerate. + + * cpu.h (CONST_ATTRIBUTE): Define as __attribute__((__const__)) if + not already defined. + (cpu_system): Use CONST_ATTRIBUTE, so that when we're not inlining + the world, the optimizer has a fair chance of CSE'ing function + calls. + (cpu_{monitor,nr,registers,model}): Ditto. + + * std-config.h (MODEL_INLINE): If not defined, define as 1 if + DEFAULT_INLINE is non-zero, 0 otherwise, rather than just the + value of DEFAULT_INLINE. + Fri Nov 24 11:24:34 1995 Michael Meissner * lf.h (__attribute__): If not GCC and at least 2.7.0, define as diff --git a/sim/ppc/config.in b/sim/ppc/config.in new file mode 100644 index 0000000000..b8acf940b3 --- /dev/null +++ b/sim/ppc/config.in @@ -0,0 +1,35 @@ +/* config.in. Generated automatically from configure.in by autoheader. */ + +#ifndef CONFIG_H +#define CONFIG_H + +/* Define if you have the getrusage function. */ +#undef HAVE_GETRUSAGE + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIMES_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H +#endif diff --git a/sim/ppc/configure b/sim/ppc/configure index e9f935813f..b8f3443e45 100755 --- a/sim/ppc/configure +++ b/sim/ppc/configure @@ -1319,7 +1319,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in string.h strings.h stdlib.h time.h sys/times.h unistd.h sys/resource.h +for ac_hdr in string.h strings.h stdlib.h time.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 diff --git a/sim/ppc/configure.in b/sim/ppc/configure.in index b884544727..0a708d2256 100644 --- a/sim/ppc/configure.in +++ b/sim/ppc/configure.in @@ -414,7 +414,7 @@ else fi AC_SUBST(CC_FOR_BUILD) -AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h unistd.h sys/resource.h) +AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h) AC_OUTPUT(Makefile, [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac]) diff --git a/sim/ppc/cpu.h b/sim/ppc/cpu.h index b66cffd8c3..efd49a5291 100644 --- a/sim/ppc/cpu.h +++ b/sim/ppc/cpu.h @@ -38,8 +38,10 @@ #include "itable.h" #include "mon.h" #include "model.h" -#include "function_unit.h" +#ifndef CONST_ATTRIBUTE +#define CONST_ATTRIBUTE __attribute__((__const__)) +#endif /* typedef struct _cpu cpu; @@ -62,13 +64,13 @@ INLINE_CPU void cpu_init /* Find our way home */ INLINE_CPU psim *cpu_system -(cpu *processor); +(cpu *processor) CONST_ATTRIBUTE; INLINE_CPU cpu_mon *cpu_monitor -(cpu *processor); +(cpu *processor) CONST_ATTRIBUTE; INLINE_CPU int cpu_nr -(cpu *processor); +(cpu *processor) CONST_ATTRIBUTE; INLINE_CPU event_queue *cpu_event_queue (cpu *processor); @@ -173,16 +175,13 @@ INLINE_CPU void cpu_print_info below to when ever a synchronization point is reached */ INLINE_CPU registers *cpu_registers -(cpu *processor); +(cpu *processor) CONST_ATTRIBUTE; INLINE_CPU void cpu_synchronize_context (cpu *processor); -INLINE_CPU function_unit *cpu_function_unit -(cpu *processor); - INLINE_CPU model_data *cpu_model -(cpu *processor); +(cpu *processor) CONST_ATTRIBUTE; #define IS_PROBLEM_STATE(PROCESSOR) \ (CURRENT_ENVIRONMENT == OPERATING_ENVIRONMENT \ diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c index 53021341b7..30bbbc4101 100644 --- a/sim/ppc/mon.c +++ b/sim/ppc/mon.c @@ -47,6 +47,10 @@ #include #endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif + #ifdef HAVE_TIME_H #include #endif @@ -55,6 +59,10 @@ #include #endif +#ifdef HAVE_SYS_TIME_H +#include +#endif + #ifdef HAVE_SYS_RESOURCE_H #include int getrusage(); diff --git a/sim/ppc/std-config.h b/sim/ppc/std-config.h index 6195db77ec..e1b308c974 100644 --- a/sim/ppc/std-config.h +++ b/sim/ppc/std-config.h @@ -262,43 +262,6 @@ extern int current_floating_point; | MONITOR_INSTRUCTION_ISSUE) #endif - -/* Include code that simulates function units to model particular - machines more closely and provide more detailed information about - optimization potential. */ - -#ifndef WITH_FUNCTION_UNIT -#define WITH_FUNCTION_UNIT 1 -#endif - -/* Which specific processor to model */ -typedef enum _ppc_model { - PPC_MODEL_UNKNOWN, - PPC_MODEL_601, - PPC_MODEL_602, - PPC_MODEL_603, - PPC_MODEL_603e, - PPC_MODEL_604, - PPC_MODEL_403, - PPC_MODEL_505, - PPC_MODEL_821, - PPC_MODEL_860 -} ppc_model; - -#ifndef WITH_DEFAULT_PPC_MODEL -#define WITH_DEFAULT_PPC_MODEL PPC_MODEL_603e -#endif - -extern ppc_model current_ppc_model; - -#ifndef WITH_PPC_MODEL -#define WITH_PPC_MODEL 0 -#endif - -#define CURRENT_PPC_MODEL (WITH_PPC_MODEL \ - ? WITH_PPC_MODEL \ - : current_ppc_model) - /* Current CPU model (models are in the generated models.h include file) */ #ifndef WITH_MODEL #define WITH_MODEL 0 @@ -312,6 +275,10 @@ extern ppc_model current_ppc_model; #define WITH_DEFAULT_MODEL DEFAULT_MODEL #endif +#ifndef WITH_MODEL_ISSUE +#define WITH_MODEL_ISSUE 1 +#endif + /* INLINE CODE SELECTION: GCC -O3 attempts to inline any function or procedure in scope. The @@ -357,8 +324,7 @@ extern ppc_model current_ppc_model; #if defined(__GNUC__) && defined(__OPTIMIZE__) && \ (DEFAULT_INLINE || SIM_ENDIAN_INLINE || BITS_INLINE || CPU_INLINE || VM_INLINE || CORE_INLINE \ || EVENTS_INLINE || MON_INLINE || INTERRUPTS_INLINE || REGISTERS_INLINE || DEVICE_TREE_INLINE \ - || DEVICES_INLINE || SPREG_INLINE || SEMANTICS_INLINE || IDECODE_INLINE || MODEL_INLINE \ - || FUNCTION_UNIT_INLINE) + || DEVICES_INLINE || SPREG_INLINE || SEMANTICS_INLINE || IDECODE_INLINE || MODEL_INLINE) #define INLINE __inline__ #else #define INLINE /*inline*/ @@ -488,16 +454,13 @@ extern ppc_model current_ppc_model; #define IDECODE_INLINE DEFAULT_INLINE #endif -/* Model specific code used in simulating functional units */ +/* Model specific code used in simulating functional units. Note, it actaully + pays NOT to inline the PowerPC model functions (at least on the x86). This + is because if it is inlined, each PowerPC instruction gets a separate copy + of the code, which is not friendly to the cache. */ #ifndef MODEL_INLINE -#define MODEL_INLINE DEFAULT_INLINE -#endif - -/* Code to simulate functional units of real machines */ - -#ifndef FUNCTION_UNIT_INLINE -#define FUNCTION_UNIT_INLINE DEFAULT_INLINE +#define MODEL_INLINE (DEFAULT_INLINE ? 1 : 0) #endif /* Code to print out what options we were compiled with. Because this