Build again on SunOS; Make MODEL_INLINE default to 1 if inlining, not 2; Use __attribute__((const))

This commit is contained in:
Michael Meissner 1995-11-27 22:54:40 +00:00
parent 79e6c66069
commit 70fc4ad384
7 changed files with 83 additions and 58 deletions

View 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> 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 * lf.h (__attribute__): If not GCC and at least 2.7.0, define as

35
sim/ppc/config.in Normal file
View File

@ -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

2
sim/ppc/configure vendored
View File

@ -1319,7 +1319,7 @@ else
fi fi
echo "$ac_t""$CPP" 1>&6 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 do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'` ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6

View File

@ -414,7 +414,7 @@ else
fi fi
AC_SUBST(CC_FOR_BUILD) 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, AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac]) [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])

View File

@ -38,8 +38,10 @@
#include "itable.h" #include "itable.h"
#include "mon.h" #include "mon.h"
#include "model.h" #include "model.h"
#include "function_unit.h"
#ifndef CONST_ATTRIBUTE
#define CONST_ATTRIBUTE __attribute__((__const__))
#endif
/* typedef struct _cpu cpu; /* typedef struct _cpu cpu;
@ -62,13 +64,13 @@ INLINE_CPU void cpu_init
/* Find our way home */ /* Find our way home */
INLINE_CPU psim *cpu_system INLINE_CPU psim *cpu_system
(cpu *processor); (cpu *processor) CONST_ATTRIBUTE;
INLINE_CPU cpu_mon *cpu_monitor INLINE_CPU cpu_mon *cpu_monitor
(cpu *processor); (cpu *processor) CONST_ATTRIBUTE;
INLINE_CPU int cpu_nr INLINE_CPU int cpu_nr
(cpu *processor); (cpu *processor) CONST_ATTRIBUTE;
INLINE_CPU event_queue *cpu_event_queue INLINE_CPU event_queue *cpu_event_queue
(cpu *processor); (cpu *processor);
@ -173,16 +175,13 @@ INLINE_CPU void cpu_print_info
below to when ever a synchronization point is reached */ below to when ever a synchronization point is reached */
INLINE_CPU registers *cpu_registers INLINE_CPU registers *cpu_registers
(cpu *processor); (cpu *processor) CONST_ATTRIBUTE;
INLINE_CPU void cpu_synchronize_context INLINE_CPU void cpu_synchronize_context
(cpu *processor); (cpu *processor);
INLINE_CPU function_unit *cpu_function_unit
(cpu *processor);
INLINE_CPU model_data *cpu_model INLINE_CPU model_data *cpu_model
(cpu *processor); (cpu *processor) CONST_ATTRIBUTE;
#define IS_PROBLEM_STATE(PROCESSOR) \ #define IS_PROBLEM_STATE(PROCESSOR) \
(CURRENT_ENVIRONMENT == OPERATING_ENVIRONMENT \ (CURRENT_ENVIRONMENT == OPERATING_ENVIRONMENT \

View File

@ -47,6 +47,10 @@
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_TIME_H #ifdef HAVE_TIME_H
#include <time.h> #include <time.h>
#endif #endif
@ -55,6 +59,10 @@
#include <sys/times.h> #include <sys/times.h>
#endif #endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h> #include <sys/resource.h>
int getrusage(); int getrusage();

View File

@ -262,43 +262,6 @@ extern int current_floating_point;
| MONITOR_INSTRUCTION_ISSUE) | MONITOR_INSTRUCTION_ISSUE)
#endif #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) */ /* Current CPU model (models are in the generated models.h include file) */
#ifndef WITH_MODEL #ifndef WITH_MODEL
#define WITH_MODEL 0 #define WITH_MODEL 0
@ -312,6 +275,10 @@ extern ppc_model current_ppc_model;
#define WITH_DEFAULT_MODEL DEFAULT_MODEL #define WITH_DEFAULT_MODEL DEFAULT_MODEL
#endif #endif
#ifndef WITH_MODEL_ISSUE
#define WITH_MODEL_ISSUE 1
#endif
/* INLINE CODE SELECTION: /* INLINE CODE SELECTION:
GCC -O3 attempts to inline any function or procedure in scope. The 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__) && \ #if defined(__GNUC__) && defined(__OPTIMIZE__) && \
(DEFAULT_INLINE || SIM_ENDIAN_INLINE || BITS_INLINE || CPU_INLINE || VM_INLINE || CORE_INLINE \ (DEFAULT_INLINE || SIM_ENDIAN_INLINE || BITS_INLINE || CPU_INLINE || VM_INLINE || CORE_INLINE \
|| EVENTS_INLINE || MON_INLINE || INTERRUPTS_INLINE || REGISTERS_INLINE || DEVICE_TREE_INLINE \ || EVENTS_INLINE || MON_INLINE || INTERRUPTS_INLINE || REGISTERS_INLINE || DEVICE_TREE_INLINE \
|| DEVICES_INLINE || SPREG_INLINE || SEMANTICS_INLINE || IDECODE_INLINE || MODEL_INLINE \ || DEVICES_INLINE || SPREG_INLINE || SEMANTICS_INLINE || IDECODE_INLINE || MODEL_INLINE)
|| FUNCTION_UNIT_INLINE)
#define INLINE __inline__ #define INLINE __inline__
#else #else
#define INLINE /*inline*/ #define INLINE /*inline*/
@ -488,16 +454,13 @@ extern ppc_model current_ppc_model;
#define IDECODE_INLINE DEFAULT_INLINE #define IDECODE_INLINE DEFAULT_INLINE
#endif #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 #ifndef MODEL_INLINE
#define MODEL_INLINE DEFAULT_INLINE #define MODEL_INLINE (DEFAULT_INLINE ? 1 : 0)
#endif
/* Code to simulate functional units of real machines */
#ifndef FUNCTION_UNIT_INLINE
#define FUNCTION_UNIT_INLINE DEFAULT_INLINE
#endif #endif
/* Code to print out what options we were compiled with. Because this /* Code to print out what options we were compiled with. Because this