Commit c9b26f89 by Tom Wood

(SECONDARY_INPUT_RELOAD_CLASS): Require a temporary for a

	pic address with a large constant term.

(FUNCTION_PROFILER_LENGTH, FUNCTION_BLOCK_PROFILER_LENGTH,
	BLOCK_PROFILER_LENGTH, REG_PUSH_LENGTH, REG_POP_LENGTH): Added.
	(ADJUST_INSN_LENGTH): Account for profiling code.

From-SVN: r2518
parent 5785e34c
...@@ -215,9 +215,9 @@ extern char * reg_names[]; ...@@ -215,9 +215,9 @@ extern char * reg_names[];
/* Print subsidiary information on the compiler version in use. /* Print subsidiary information on the compiler version in use.
Redefined in m88kv4.h, and m88kluna.h. */ Redefined in m88kv4.h, and m88kluna.h. */
#define VERSION_INFO1 "88open OCS/BCS, " #define VERSION_INFO1 "88open OCS/BCS, "
#define VERSION_INFO2 "10/15/92" #define VERSION_INFO2 "10/19/92"
#define VERSION_STRING version_string #define VERSION_STRING version_string
#define TM_SCCS_ID "@(#)m88k.h 2.2.13.2 10/15/92 08:00:51" #define TM_SCCS_ID "@(#)m88k.h 2.2.13.4 10/19/92 10:34:58"
/* Run-time compilation parameters selecting different hardware subsets. */ /* Run-time compilation parameters selecting different hardware subsets. */
...@@ -840,6 +840,16 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ...@@ -840,6 +840,16 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
#define PREFERRED_RELOAD_CLASS(X,CLASS) \ #define PREFERRED_RELOAD_CLASS(X,CLASS) \
(CONSTANT_P(X) && (CLASS == XRF_REGS) ? NO_REGS : (CLASS)) (CONSTANT_P(X) && (CLASS == XRF_REGS) ? NO_REGS : (CLASS))
/* Return the register class of a scratch register needed to load IN
into a register of class CLASS in MODE. On the m88k, when PIC, we
need a temporary when loading some addresses into a register. */
#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, IN) \
((flag_pic \
&& GET_CODE (IN) == CONST \
&& GET_CODE (XEXP (IN, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (IN, 0), 0)) == CONST_INT \
&& ! SMALL_INT (XEXP (XEXP (IN, 0), 1))) ? GENERAL_REGS : NO_REGS)
/* Return the maximum number of consecutive registers /* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */ needed to represent mode MODE in a register of class CLASS. */
#define CLASS_MAX_NREGS(CLASS, MODE) \ #define CLASS_MAX_NREGS(CLASS, MODE) \
...@@ -1090,15 +1100,25 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ...@@ -1090,15 +1100,25 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
#define FUNCTION_PROFILER(FILE, LABELNO) \ #define FUNCTION_PROFILER(FILE, LABELNO) \
output_function_profiler (FILE, LABELNO, "mcount", 1) output_function_profiler (FILE, LABELNO, "mcount", 1)
/* Maximum length in instructions of the code output by FUNCTION_PROFILER. */
#define FUNCTION_PROFILER_LENGTH (5+3+1+5)
/* Output assembler code to FILE to initialize basic-block profiling for /* Output assembler code to FILE to initialize basic-block profiling for
the current module. LABELNO is unique to each instance. */ the current module. LABELNO is unique to each instance. */
#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \
output_function_block_profiler (FILE, LABELNO) output_function_block_profiler (FILE, LABELNO)
/* Maximum length in instructions of the code output by
FUNCTION_BLOCK_PROFILER. */
#define FUNCTION_BLOCK_PROFILER_LENGTH (3+5+2+5)
/* Output assembler code to FILE to increment the count associated with /* Output assembler code to FILE to increment the count associated with
the basic block number BLOCKNO. */ the basic block number BLOCKNO. */
#define BLOCK_PROFILER(FILE, BLOCKNO) output_block_profiler (FILE, BLOCKNO) #define BLOCK_PROFILER(FILE, BLOCKNO) output_block_profiler (FILE, BLOCKNO)
/* Maximum length in instructions of the code output by BLOCK_PROFILER. */
#define BLOCK_PROFILER_LENGTH 4
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in the stack pointer does not matter. The value is tested only in
functions that have frame pointers. functions that have frame pointers.
...@@ -1372,7 +1392,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ...@@ -1372,7 +1392,7 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
force_operand (XEXP (X, 1), 0)); \ force_operand (XEXP (X, 1), 0)); \
if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST \ if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST \
|| GET_CODE (X) == LABEL_REF) \ || GET_CODE (X) == LABEL_REF) \
(X) = legitimize_address (flag_pic, X, gen_reg_rtx (Pmode)); \ (X) = legitimize_address (flag_pic, X, 0, 0); \
if (memory_address_p (MODE, X)) \ if (memory_address_p (MODE, X)) \
goto WIN; } goto WIN; }
...@@ -1516,18 +1536,34 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ...@@ -1516,18 +1536,34 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
so give the MEM rtx word mode. */ so give the MEM rtx word mode. */
#define FUNCTION_MODE SImode #define FUNCTION_MODE SImode
/* A barrier will be aligned so account for the possible expansion. A /* A barrier will be aligned so account for the possible expansion.
volatile memory reference may be preceeded by a serializing instruction. */ A volatile load may be preceeded by a serializing instruction.
Account for profiling code output at NOTE_INSN_PROLOGUE_END.
Account for block profiling code at basic block boundaries. */
#define ADJUST_INSN_LENGTH(RTX, LENGTH) \ #define ADJUST_INSN_LENGTH(RTX, LENGTH) \
if (GET_CODE (RTX) == BARRIER \ if (GET_CODE (RTX) == BARRIER \
|| (TARGET_SERIALIZE_VOLATILE \ || (TARGET_SERIALIZE_VOLATILE \
&& GET_CODE (RTX) == INSN \ && GET_CODE (RTX) == INSN \
&& GET_CODE (PATTERN (RTX)) == SET \ && GET_CODE (PATTERN (RTX)) == SET \
&& ((GET_CODE (SET_SRC (PATTERN (RTX))) == MEM \ && ((GET_CODE (SET_SRC (PATTERN (RTX))) == MEM \
&& MEM_VOLATILE_P (SET_SRC (PATTERN (RTX)))) \ && MEM_VOLATILE_P (SET_SRC (PATTERN (RTX))))))) \
|| (GET_CODE (SET_DEST (PATTERN (RTX))) == MEM \ LENGTH += 1; \
&& MEM_VOLATILE_P (SET_DEST (PATTERN (RTX))))))) \ else if (GET_CODE (RTX) == NOTE \
LENGTH += 1; && NOTE_LINE_NUMBER (RTX) == NOTE_INSN_PROLOGUE_END) \
{ \
if (profile_block_flag) \
LENGTH += FUNCTION_BLOCK_PROFILER_LENGTH; \
if (profile_flag) \
LENGTH += (FUNCTION_PROFILER_LENGTH + REG_PUSH_LENGTH \
+ REG_POP_LENGTH); \
} \
else if (profile_block_flag \
&& (GET_CODE (RTX) == CODE_LABEL \
|| GET_CODE (RTX) == JUMP_INSN \
|| (GET_CODE (RTX) == INSN \
&& GET_CODE (PATTERN (RTX)) == SEQUENCE \
&& GET_CODE (XVECEXP (PATTERN (RTX), 0, 0)) == JUMP_INSN)))\
LENGTH += BLOCK_PROFILER_LENGTH;
/* Track the state of the last volatile memory reference. Clear the /* Track the state of the last volatile memory reference. Clear the
state with CC_STATUS_INIT for now. */ state with CC_STATUS_INIT for now. */
...@@ -2122,6 +2158,9 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ...@@ -2122,6 +2158,9 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
reg_names[REGNO], \ reg_names[REGNO], \
reg_names[STACK_POINTER_REGNUM]) reg_names[STACK_POINTER_REGNUM])
/* Length in instructions of the code output by ASM_OUTPUT_REG_PUSH. */
#define REG_PUSH_LENGTH 2
/* This is how to output an insn to pop a register from the stack. */ /* This is how to output an insn to pop a register from the stack. */
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
fprintf (FILE, "\tld\t %s,%s,0\n\taddu\t %s,%s,%d\n", \ fprintf (FILE, "\tld\t %s,%s,0\n\taddu\t %s,%s,%d\n", \
...@@ -2131,6 +2170,9 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, ...@@ -2131,6 +2170,9 @@ enum reg_class { NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS,
reg_names[STACK_POINTER_REGNUM], \ reg_names[STACK_POINTER_REGNUM], \
(STACK_BOUNDARY / BITS_PER_UNIT)) (STACK_BOUNDARY / BITS_PER_UNIT))
/* Length in instructions of the code output by ASM_OUTPUT_REG_POP. */
#define REG_POP_LENGTH 2
/* Define the parentheses used to group arithmetic operations /* Define the parentheses used to group arithmetic operations
in assembler code. */ in assembler code. */
#define ASM_OPEN_PAREN "(" #define ASM_OPEN_PAREN "("
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment