diff options
author | Richard Sandiford <rsandifo@nildram.co.uk> | 2007-10-21 09:13:06 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-10-21 09:13:06 +0000 |
commit | a1569a0e15fd6e03a5d52da09cdacd23cee0bc11 (patch) | |
tree | cf9485218276786f934bc068e85df2fc721986af | |
parent | f457938f7f42894d3b0571b9d092f0706e192fae (diff) | |
download | gcc-a1569a0e15fd6e03a5d52da09cdacd23cee0bc11.zip gcc-a1569a0e15fd6e03a5d52da09cdacd23cee0bc11.tar.gz gcc-a1569a0e15fd6e03a5d52da09cdacd23cee0bc11.tar.bz2 |
mips.c (mips_rtx_costs): Only recognize reciprocals if ISA_HAS_FP4.
gcc/
* config/mips/mips.c (mips_rtx_costs): Only recognize reciprocals
if ISA_HAS_FP4.
From-SVN: r129524
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 26 |
2 files changed, 16 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cbc431f..154bcc8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2007-10-21 Richard Sandiford <rsandifo@nildram.co.uk> + * config/mips/mips.c (mips_rtx_costs): Only recognize reciprocals + if ISA_HAS_FP4. + +2007-10-21 Richard Sandiford <rsandifo@nildram.co.uk> + * config/mips/mips.h (ISA_HAS_LDC1_SDC1): New macro. * config/mips/mips.c (mips_split_64bit_move_p): Use ISA_HAS_LDC1_SDC1 instead of checking mips_isa. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 0948832..2ddb778 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3305,22 +3305,18 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total) case DIV: /* Check for a reciprocal. */ - if (float_mode_p && XEXP (x, 0) == CONST1_RTX (mode)) + if (float_mode_p + && ISA_HAS_FP4 + && flag_unsafe_math_optimizations + && XEXP (x, 0) == CONST1_RTX (mode)) { - if (ISA_HAS_FP4 - && flag_unsafe_math_optimizations - && (outer_code == SQRT || GET_CODE (XEXP (x, 1)) == SQRT)) - { - /* An rsqrt<mode>a or rsqrt<mode>b pattern. Count the - division as being free. */ - *total = rtx_cost (XEXP (x, 1), 0); - return true; - } - if (!ISA_MIPS1) - { - *total = mips_fp_div_cost (mode) + rtx_cost (XEXP (x, 1), 0); - return true; - } + if (outer_code == SQRT || GET_CODE (XEXP (x, 1)) == SQRT) + /* An rsqrt<mode>a or rsqrt<mode>b pattern. Count the + division as being free. */ + *total = rtx_cost (XEXP (x, 1), 0); + else + *total = mips_fp_div_cost (mode) + rtx_cost (XEXP (x, 1), 0); + return true; } /* Fall through. */ |