Commit 4cbb525c by James Van Artsdalen

(FLOAT_CLASS_P): New macro.

(REGISTER_MOVE_COST): Use it instead of comparing to FLOAT_REGS.
(PREFERRED_RELOAD_CLASS): Likewise.
(SECONDARY_MEMORY_NEEDED): Likewise.
(CLASS_MAX_NREGS): Likewise.
(SELECT_CC_MODE): Use VOIDmode for non-FP-equality comparisons.

From-SVN: r3713
parent dc577ada
...@@ -300,10 +300,10 @@ extern int target_flags; ...@@ -300,10 +300,10 @@ extern int target_flags;
On the i386, copying between floating-point and fixed-point On the i386, copying between floating-point and fixed-point
registers is expensive. */ registers is expensive. */
#define REGISTER_MOVE_COST(CLASS1, CLASS2) \ #define REGISTER_MOVE_COST(CLASS1, CLASS2) \
((((CLASS1) == FLOAT_REGS && (CLASS2) != FLOAT_REGS) \ (((FLOAT_CLASS_P (CLASS1) && ! FLOAT_CLASS_P (CLASS2)) \
|| ((CLASS2) == FLOAT_REGS && (CLASS1) != FLOAT_REGS)) \ || (! FLOAT_CLASS_P (CLASS1) && FLOAT_CLASS_P (CLASS2))) ? 10 \
? 10 : 2) : 2)
/* Specify the registers used for certain standard purposes. /* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */ The values of these macros are register numbers. */
...@@ -389,6 +389,8 @@ enum reg_class ...@@ -389,6 +389,8 @@ enum reg_class
#define N_REG_CLASSES (int) LIM_REG_CLASSES #define N_REG_CLASSES (int) LIM_REG_CLASSES
#define FLOAT_CLASS_P(CLASS) (reg_class_subset_p (CLASS, FLOAT_REGS))
/* Give names of register classes as strings for dump file. */ /* Give names of register classes as strings for dump file. */
#define REG_CLASS_NAMES \ #define REG_CLASS_NAMES \
...@@ -512,8 +514,8 @@ extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; ...@@ -512,8 +514,8 @@ extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
((C) == 'G' ? standard_80387_constant_p (VALUE) : 0) ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0)
/* Place additional restrictions on the register class to use when it /* Place additional restrictions on the register class to use when it
is necessary to be able to hold a value of mode @var{mode} in a reload is necessary to be able to hold a value of mode MODE in a reload
register for which class @var{class} would ordinarily be used. */ register for which class CLASS would ordinarily be used. */
#define LIMIT_RELOAD_CLASS(MODE, CLASS) \ #define LIMIT_RELOAD_CLASS(MODE, CLASS) \
((MODE) == QImode && ((CLASS) == ALL_REGS || (CLASS) == GENERAL_REGS) \ ((MODE) == QImode && ((CLASS) == ALL_REGS || (CLASS) == GENERAL_REGS) \
...@@ -534,7 +536,7 @@ extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; ...@@ -534,7 +536,7 @@ extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
#define PREFERRED_RELOAD_CLASS(X,CLASS) \ #define PREFERRED_RELOAD_CLASS(X,CLASS) \
(GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode ? NO_REGS \ (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode ? NO_REGS \
: GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \ : GET_MODE (X) == QImode && ! reg_class_subset_p (CLASS, Q_REGS) ? Q_REGS \
: ((CLASS) == FLOAT_REGS \ : (FLOAT_CLASS_P (CLASS) \
&& (GET_MODE (X) == VOIDmode \ && (GET_MODE (X) == VOIDmode \
|| GET_MODE_CLASS (GET_MODE (X)) == MODE_INT)) ? GENERAL_REGS \ || GET_MODE_CLASS (GET_MODE (X)) == MODE_INT)) ? GENERAL_REGS \
: (CLASS) == ALL_REGS ? GENERAL_REGS \ : (CLASS) == ALL_REGS ? GENERAL_REGS \
...@@ -548,18 +550,16 @@ extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; ...@@ -548,18 +550,16 @@ extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
location. */ location. */
#define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \ #define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \
(((CLASS1) == FLOAT_REGS && (CLASS2) != FLOAT_REGS) \ ((FLOAT_CLASS_P (CLASS1) && ! FLOAT_CLASS_P (CLASS2)) \
|| ((CLASS2) == FLOAT_REGS && (CLASS1) != FLOAT_REGS)) || (! FLOAT_CLASS_P (CLASS1) && FLOAT_CLASS_P (CLASS2)))
/* 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. */
/* On the 80386, this is the size of MODE in words, /* On the 80386, this is the size of MODE in words,
except in the FP regs, where a single reg is always enough. */ except in the FP regs, where a single reg is always enough. */
#define CLASS_MAX_NREGS(CLASS, MODE) \ #define CLASS_MAX_NREGS(CLASS, MODE) \
((CLASS) == FLOAT_REGS ? 1 : \ (FLOAT_CLASS_P (CLASS) ? 1 : \
(CLASS) == FP_TOP_REG ? 1 : \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
(CLASS) == FP_SECOND_REG ? 1 : \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
/* Stack layout; function entry, exit and calling. */ /* Stack layout; function entry, exit and calling. */
...@@ -1242,7 +1242,7 @@ while (0) ...@@ -1242,7 +1242,7 @@ while (0)
#define SELECT_CC_MODE(OP,X,Y) \ #define SELECT_CC_MODE(OP,X,Y) \
(GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& ((OP) == EQ || (OP) == NE) ? CCFPEQmode : CCmode) && ((OP) == EQ || (OP) == NE) ? CCFPEQmode : VOIDmode)
/* Define the information needed to generate branch and scc insns. This is /* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. Note that we can't use "rtx" here stored from the compare operation. Note that we can't use "rtx" here
......
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