From: Steve Ellcey Date: Thu, 18 Jun 2015 15:17:49 +0000 (+0000) Subject: mips.c (mips_rtx_costs): Remove HONOR_NAN check. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ebfea12d2ee9263bdbf8ecd8e7b81e562bd3807;p=gcc.git mips.c (mips_rtx_costs): Remove HONOR_NAN check. 2015-06-18 Steve Ellcey * config/mips/mips.c (mips_rtx_costs): Remove HONOR_NAN check. * config/mips/mips.md (*madd4): Ditto. (*nmadd3) Ditto. (*nmadd4_fastmath): Ditto. (*nmadd3_fastmath): Ditto. (*nmsub4): Ditto. (*nmsub3): Ditto. (*nmsub4_fastmath): Ditto. (*nmsub3_fastmath): Ditto. From-SVN: r224625 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fef6cb94002..f2ba06f61bb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2015-06-18 Steve Ellcey + + * config/mips/mips.c (mips_rtx_costs): Remove HONOR_NAN check. + * config/mips/mips.md (*madd4): Ditto. + (*nmadd3) Ditto. + (*nmadd4_fastmath): Ditto. + (*nmadd3_fastmath): Ditto. + (*nmsub4): Ditto. + (*nmsub3): Ditto. + (*nmsub4_fastmath): Ditto. + (*nmsub3_fastmath): Ditto. + 2015-06-18 Michael Matz PR middle-end/66253 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index d427c0c0b07..1c837cf7c90 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -4069,7 +4069,6 @@ mips_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED, if (float_mode_p && (ISA_HAS_NMADD4_NMSUB4 || ISA_HAS_NMADD3_NMSUB3) && TARGET_FUSED_MADD - && !HONOR_NANS (mode) && !HONOR_SIGNED_ZEROS (mode)) { /* See if we can use NMADD or NMSUB. See mips.md for the @@ -4137,7 +4136,6 @@ mips_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED, if (float_mode_p && (ISA_HAS_NMADD4_NMSUB4 || ISA_HAS_NMADD3_NMSUB3) && TARGET_FUSED_MADD - && !HONOR_NANS (mode) && HONOR_SIGNED_ZEROS (mode)) { /* See if we can use NMADD or NMSUB. See mips.md for the diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 0a23fa214b0..f6912e11c2d 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -2475,6 +2475,13 @@ ;; Floating point multiply accumulate instructions. +;; The various multiply accumulate instructions can be used even when +;; HONOR_NANS is true because while IEEE 754-2008 requires the negate +;; operation to negate the sign of a NAN and the MIPS neg instruction does +;; not do this, the multiply and add (or minus) parts of these instructions +;; have no requirement on how the sign of a NAN is handled and so the final +;; sign bit of the entire operation is undefined. + (define_insn "*madd4" [(set (match_operand:ANYF 0 "register_operand" "=f") (plus:ANYF (mult:ANYF (match_operand:ANYF 1 "register_operand" "f") @@ -2533,8 +2540,7 @@ (match_operand:ANYF 3 "register_operand" "f"))))] "ISA_HAS_NMADD4_NMSUB4 && TARGET_FUSED_MADD - && HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && HONOR_SIGNED_ZEROS (mode)" "nmadd.\t%0,%3,%1,%2" [(set_attr "type" "fmadd") (set_attr "mode" "")]) @@ -2547,8 +2553,7 @@ (match_operand:ANYF 3 "register_operand" "0"))))] "ISA_HAS_NMADD3_NMSUB3 && TARGET_FUSED_MADD - && HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && HONOR_SIGNED_ZEROS (mode)" "nmadd.\t%0,%1,%2" [(set_attr "type" "fmadd") (set_attr "mode" "")]) @@ -2561,8 +2566,7 @@ (match_operand:ANYF 3 "register_operand" "f")))] "ISA_HAS_NMADD4_NMSUB4 && TARGET_FUSED_MADD - && !HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && !HONOR_SIGNED_ZEROS (mode)" "nmadd.\t%0,%3,%1,%2" [(set_attr "type" "fmadd") (set_attr "mode" "")]) @@ -2575,8 +2579,7 @@ (match_operand:ANYF 3 "register_operand" "0")))] "ISA_HAS_NMADD3_NMSUB3 && TARGET_FUSED_MADD - && !HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && !HONOR_SIGNED_ZEROS (mode)" "nmadd.\t%0,%1,%2" [(set_attr "type" "fmadd") (set_attr "mode" "")]) @@ -2589,8 +2592,7 @@ (match_operand:ANYF 1 "register_operand" "f"))))] "ISA_HAS_NMADD4_NMSUB4 && TARGET_FUSED_MADD - && HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && HONOR_SIGNED_ZEROS (mode)" "nmsub.\t%0,%1,%2,%3" [(set_attr "type" "fmadd") (set_attr "mode" "")]) @@ -2603,8 +2605,7 @@ (match_operand:ANYF 1 "register_operand" "0"))))] "ISA_HAS_NMADD3_NMSUB3 && TARGET_FUSED_MADD - && HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && HONOR_SIGNED_ZEROS (mode)" "nmsub.\t%0,%1,%2" [(set_attr "type" "fmadd") (set_attr "mode" "")]) @@ -2617,8 +2618,7 @@ (match_operand:ANYF 3 "register_operand" "f"))))] "ISA_HAS_NMADD4_NMSUB4 && TARGET_FUSED_MADD - && !HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && !HONOR_SIGNED_ZEROS (mode)" "nmsub.\t%0,%1,%2,%3" [(set_attr "type" "fmadd") (set_attr "mode" "")]) @@ -2631,8 +2631,7 @@ (match_operand:ANYF 3 "register_operand" "0"))))] "ISA_HAS_NMADD3_NMSUB3 && TARGET_FUSED_MADD - && !HONOR_SIGNED_ZEROS (mode) - && !HONOR_NANS (mode)" + && !HONOR_SIGNED_ZEROS (mode)" "nmsub.\t%0,%1,%2" [(set_attr "type" "fmadd") (set_attr "mode" "")])