diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 1999-03-10 11:07:32 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 1999-03-10 11:07:32 +0000 |
commit | 66c0b347bc7f9c2006901ca903c052046b1d7256 (patch) | |
tree | 3ba789ca17f8b684a0ddaf4ef0ab79e3f20eeed4 /gcc | |
parent | 0c7f225984c0ef7a41393858ba8bdd473f17168c (diff) | |
download | gcc-66c0b347bc7f9c2006901ca903c052046b1d7256.zip gcc-66c0b347bc7f9c2006901ca903c052046b1d7256.tar.gz gcc-66c0b347bc7f9c2006901ca903c052046b1d7256.tar.bz2 |
sh.c (fp_arith_reg_operand): Actually test if reg is suitable for FP arithmetic.
* sh.c (fp_arith_reg_operand): Actually test if reg is suitable
for FP arithmetic. Changed caller.
* sh.md (subsf3, subsf_i): Use fp_arith_reg_operand.
From-SVN: r25670
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 20 | ||||
-rw-r--r-- | gcc/config/sh/sh.md | 12 |
3 files changed, 29 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f69c830..93012fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 10 19:04:31 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + * sh.c (fp_arith_reg_operand): Actually test if reg is suitable + for FP arithmetic. Changed caller. + * sh.md (subsf3, subsf_i): Use fp_arith_reg_operand. + Wed Mar 10 18:56:31 1999 J"orn Rennecke <amylaar@cygnus.co.uk> * reload1.c (choose_reload_regs): When inheriting from the frame diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 180cce2..41c5ac5 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -4192,8 +4192,8 @@ fp_arith_reg_operand (op, mode) else return 1; - return (regno != T_REG && regno != PR_REG && regno > 15 - && regno != MACH_REG && regno != MACL_REG); + return (regno >= FIRST_PSEUDO_REGISTER + || (regno >= FIRST_FP_REG && regno <= LAST_FP_REG)); } return 0; } @@ -4208,7 +4208,21 @@ fp_extended_operand (op, mode) op = XEXP (op, 0); mode = GET_MODE (op); } - return fp_arith_reg_operand (op, mode); + if (register_operand (op, mode)) + { + int regno; + + if (GET_CODE (op) == REG) + regno = REGNO (op); + else if (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG) + regno = REGNO (SUBREG_REG (op)); + else + return 1; + + return (regno != T_REG && regno != PR_REG && regno > 15 + && regno != MACH_REG && regno != MACL_REG); + } + return 0; } /* Returns 1 if OP is a valid source operand for an arithmetic insn. */ diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 8dc823c..55c5745 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -3870,16 +3870,16 @@ [(set_attr "type" "fp")]) (define_expand "subsf3" - [(match_operand:SF 0 "arith_reg_operand" "") - (match_operand:SF 1 "arith_reg_operand" "") - (match_operand:SF 2 "arith_reg_operand" "")] + [(match_operand:SF 0 "fp_arith_reg_operand" "") + (match_operand:SF 1 "fp_arith_reg_operand" "") + (match_operand:SF 2 "fp_arith_reg_operand" "")] "TARGET_SH3E" "{ expand_sf_binop (&gen_subsf3_i, operands); DONE; }") (define_insn "subsf3_i" - [(set (match_operand:SF 0 "arith_reg_operand" "=f") - (minus:SF (match_operand:SF 1 "arith_reg_operand" "0") - (match_operand:SF 2 "arith_reg_operand" "f"))) + [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") + (minus:SF (match_operand:SF 1 "fp_arith_reg_operand" "0") + (match_operand:SF 2 "fp_arith_reg_operand" "f"))) (use (match_operand:PSI 3 "fpscr_operand" "c"))] "TARGET_SH3E" "fsub %2,%0" |