Build again on SunOS; Make MODEL_INLINE default to 1 if inlining, not 2; Use __attrib...
authorMichael Meissner <gnu@the-meissners.org>
Mon, 27 Nov 1995 22:54:40 +0000 (22:54 +0000)
committerMichael Meissner <gnu@the-meissners.org>
Mon, 27 Nov 1995 22:54:40 +0000 (22:54 +0000)
sim/ppc/ChangeLog
sim/ppc/config.in [new file with mode: 0644]
sim/ppc/configure
sim/ppc/configure.in
sim/ppc/cpu.h
sim/ppc/mon.c
sim/ppc/std-config.h

index fd2c87e1481127f8622c3a48df1458935f5ec41e..2a4a55f3f16cbdf82660156a106ae645b657eb1e 100644 (file)
@@ -1,3 +1,23 @@
+Mon Nov 27 17:46:33 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
+
+       * 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  <meissner@tiktok.cygnus.com>
 
        * 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 (file)
index 0000000..b8acf94
--- /dev/null
@@ -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 <stdlib.h> header file.  */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the <string.h> header file.  */
+#undef HAVE_STRING_H
+
+/* Define if you have the <strings.h> header file.  */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <sys/resource.h> header file.  */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define if you have the <sys/time.h> header file.  */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <sys/times.h> header file.  */
+#undef HAVE_SYS_TIMES_H
+
+/* Define if you have the <sys/types.h> header file.  */
+#undef HAVE_SYS_TYPES_H
+
+/* Define if you have the <time.h> header file.  */
+#undef HAVE_TIME_H
+
+/* Define if you have the <unistd.h> header file.  */
+#undef HAVE_UNISTD_H
+#endif
index e9f935813f5a94b0affd4caa124dbc5dd4c3c602..b8f3443e45acd52bc0d6c0f76af9373512587eda 100755 (executable)
@@ -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
index b884544727ba53bf77c36709a24589127c9c3d32..0a708d2256eabd23c052d2494d89fa948b27cd47 100644 (file)
@@ -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])
index b66cffd8c3fdc0eafc5f14e3a1b1b1b1143448d1..efd49a529102a1ba2a547a85a358b11d5182a980 100644 (file)
 #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 \
index 53021341b7c50bc42d26abd46480eb30921122f7..30bbbc4101a6513b7b4f57c32f00b68860eed00f 100644 (file)
 #include <stdlib.h>
 #endif
 
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
 #ifdef HAVE_TIME_H
 #include <time.h>
 #endif
 #include <sys/times.h>
 #endif
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 int getrusage();
index 6195db77ec32468a460a996875bb99c3b05ef969..e1b308c974fbc96db9616524e61039717d084c7e 100644 (file)
@@ -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
This page took 0.040255 seconds and 4 git commands to generate.