+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
--- /dev/null
+/* 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
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
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])
#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;
/* 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);
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 \
#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();
| 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
#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
#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*/
#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