From: J"orn Rennecke Date: Wed, 10 Mar 1999 11:07:32 +0000 (+0000) Subject: sh.c (fp_arith_reg_operand): Actually test if reg is suitable for FP arithmetic. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66c0b347bc7f9c2006901ca903c052046b1d7256;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f69c8304991..93012fe9303 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 10 19:04:31 1999 J"orn Rennecke + + * 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 * 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 180cce2b2aa..41c5ac5ecac 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 8dc823cef76..55c5745b6b1 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"