aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1993-01-17 11:07:59 -0700
committerJeff Law <law@gcc.gnu.org>1993-01-17 11:07:59 -0700
commit5de7c240a0d46a902633f88e5bf5e3ec7200559c (patch)
tree9794e80978c23a9a3e596b777be49921df9cb679 /gcc
parentf133af4c9179bcd44c02c90cbde0efb7a06d3a5e (diff)
downloadgcc-5de7c240a0d46a902633f88e5bf5e3ec7200559c.zip
gcc-5de7c240a0d46a902633f88e5bf5e3ec7200559c.tar.gz
gcc-5de7c240a0d46a902633f88e5bf5e3ec7200559c.tar.bz2
pa.h (FP_REG_CLASS_P): New macro.
* pa.h (FP_REG_CLASS_P): New macro. (REGISTER_MOVE_COST): Use FP_REG_CLASS_P to simplify. Make copies from the SAR so expensive that they should never happen. From-SVN: r3259
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/pa/pa.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 14257e5..40d1929 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -561,6 +561,9 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FP_REGS, GENERAL_OR_FP_REGS,
#define INDEX_REG_CLASS GENERAL_REGS
#define BASE_REG_CLASS GENERAL_REGS
+#define FP_REG_CLASS_P(CLASS) \
+ (CLASS == FP_REGS || CLASS == SNAKE_FP_REGS || CLASS == HI_SNAKE_FP_REGS)
+
/* Get reg_class from a letter such as appears in the machine description. */
#define REG_CLASS_FROM_LETTER(C) \
@@ -1479,16 +1482,20 @@ while (0)
(GET_CODE (RTX) == REG ? 1 : hppa_address_cost (RTX))
/* Compute extra cost of moving data between one register class
- and another. */
+ and another.
+
+ Make moves from SAR so expensive they should never happen.
+
+ Copies involving a FP register and a non-FP register are relatively
+ expensive because they must go through memory.
+
+ Other copies are reasonably cheap. */
#define REGISTER_MOVE_COST(CLASS1, CLASS2) \
- ((((CLASS1 == FP_REGS || CLASS1 == SNAKE_FP_REGS \
- || CLASS1 == HI_SNAKE_FP_REGS) \
- && (CLASS2 == R1_REGS || CLASS2 == GENERAL_REGS \
- || CLASS2 == SHIFT_REGS)) \
- || ((CLASS1 == R1_REGS || CLASS1 == GENERAL_REGS \
- || CLASS1 == SHIFT_REGS) \
- && (CLASS2 == FP_REGS || CLASS2 == SNAKE_FP_REGS \
- || CLASS2 == HI_SNAKE_FP_REGS))) ? 16 : 2)
+ (CLASS1 == SHIFT_REGS ? 0xffff \
+ : FP_REG_CLASS_P (CLASS1) && ! FP_REG_CLASS_P (CLASS2) ? 16 \
+ : FP_REG_CLASS_P (CLASS2) && ! FP_REG_CLASS_P (CLASS1) ? 16 \
+ : 2)
+
/* Provide the costs of a rtl expression. This is in the body of a
switch on CODE. The purpose for the cost of MULT is to encourage