[gcc(refs/users/meissner/heads/work206-bugs)] Revert changes
Michael Meissner
meissner@gcc.gnu.org
Wed May 28 17:00:35 GMT 2025
https://gcc.gnu.org/g:ec40186f1e6c8615cd19456c1af8fc89d9e1a774
commit ec40186f1e6c8615cd19456c1af8fc89d9e1a774
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Wed May 28 13:00:24 2025 -0400
Revert changes
Diff:
---
gcc/config/rs6000/rs6000.cc | 8 +------
gcc/config/rs6000/rs6000.md | 27 ++++++++--------------
gcc/testsuite/gcc.target/powerpc/float128-cmove.c | 6 +----
.../gcc.target/powerpc/float128-minmax-3.c | 6 +----
4 files changed, 12 insertions(+), 35 deletions(-)
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index a8a0e153c362..11dfde7f288b 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -16509,17 +16509,11 @@ rs6000_maybe_emit_fp_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
/* Helper function to return true if the target has instructions to do a
compare and set mask instruction that can be used with XXSEL to implement a
conditional move. It is also assumed that such a target also supports the
- "C" minimum and maximum instructions.
-
- However, these instructions will trap if given a signaling NaN, so we can
- only use them if NaNs are not expected. */
+ "C" minimum and maximum instructions. */
static bool
have_compare_and_set_mask (machine_mode mode)
{
- if (!flag_finite_math_only)
- return false;
-
switch (mode)
{
case E_SFmode:
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 1f8cfcf0d255..65da0c653304 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -5699,10 +5699,6 @@
"fsel %0,%1,%2,%3"
[(set_attr "type" "fp")])
-;; On power9, we can generate XSCMP{EQ,GT,GE}DP and XXSEL to do a floating
-;; point conditional move. However, these instructions trap if one of the
-;; arguments is a signalling NaN. Therefore we can only do this optimize if
-;; NaNs are not expected in the code.
(define_insn_and_split "*mov<SFDF:mode><SFDF2:mode>cc_p9"
[(set (match_operand:SFDF 0 "vsx_register_operand" "=&wa,wa")
(if_then_else:SFDF
@@ -5712,7 +5708,7 @@
(match_operand:SFDF 4 "vsx_register_operand" "wa,wa")
(match_operand:SFDF 5 "vsx_register_operand" "wa,wa")))
(clobber (match_scratch:V2DI 6 "=0,&wa"))]
- "TARGET_P9_MINMAX && flag_finite_math_only"
+ "TARGET_P9_MINMAX"
"#"
"&& 1"
[(set (match_dup 6)
@@ -5744,7 +5740,7 @@
(match_operand:SFDF 4 "vsx_register_operand" "wa,wa")
(match_operand:SFDF 5 "vsx_register_operand" "wa,wa")))
(clobber (match_scratch:V2DI 6 "=0,&wa"))]
- "TARGET_P9_MINMAX && flag_finite_math_only"
+ "TARGET_P9_MINMAX"
"#"
"&& 1"
[(set (match_dup 6)
@@ -5779,7 +5775,7 @@
(match_operand:SFDF 3 "vsx_register_operand" "wa")])
(match_operand:V2DI 4 "all_ones_constant" "")
(match_operand:V2DI 5 "zero_constant" "")))]
- "TARGET_P9_MINMAX && flag_finite_math_only"
+ "TARGET_P9_MINMAX"
"xscmp%V1dp %x0,%x2,%x3"
[(set_attr "type" "fpcompare")])
@@ -5789,23 +5785,18 @@
(match_operand:V2DI 2 "zero_constant" ""))
(match_operand:SFDF 3 "vsx_register_operand" "wa")
(match_operand:SFDF 4 "vsx_register_operand" "wa")))]
- "TARGET_P9_MINMAX && flag_finite_math_only"
+ "TARGET_P9_MINMAX"
"xxsel %x0,%x4,%x3,%x1"
[(set_attr "type" "vecmove")])
;; Support for ISA 3.1 IEEE 128-bit conditional move. The mode used in the
;; comparison must be the same as used in the move.
-;;
-;; On power10, we can generate XSCMP{EQ,GT,GE}QP and XXSEL to do a floating
-;; point conditional move for IEEE 128-bit values. However, these instructions
-;; trap if one of the arguments is a signalling NaN. Therefore we can only do
-;; this optimize if NaNs are not expected in the code.
(define_expand "mov<mode>cc"
[(set (match_operand:IEEE128 0 "gpc_reg_operand")
(if_then_else:IEEE128 (match_operand 1 "comparison_operator")
(match_operand:IEEE128 2 "gpc_reg_operand")
(match_operand:IEEE128 3 "gpc_reg_operand")))]
- "TARGET_POWER10 && TARGET_FLOAT128_HW && flag_finite_math_only"
+ "TARGET_POWER10 && TARGET_FLOAT128_HW"
{
if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
DONE;
@@ -5822,7 +5813,7 @@
(match_operand:IEEE128 4 "altivec_register_operand" "v,v")
(match_operand:IEEE128 5 "altivec_register_operand" "v,v")))
(clobber (match_scratch:V2DI 6 "=0,&v"))]
- "TARGET_POWER10 && TARGET_FLOAT128_HW && flag_finite_math_only"
+ "TARGET_POWER10 && TARGET_FLOAT128_HW"
"#"
"&& 1"
[(set (match_dup 6)
@@ -5854,7 +5845,7 @@
(match_operand:IEEE128 4 "altivec_register_operand" "v,v")
(match_operand:IEEE128 5 "altivec_register_operand" "v,v")))
(clobber (match_scratch:V2DI 6 "=0,&v"))]
- "TARGET_POWER10 && TARGET_FLOAT128_HW && flag_finite_math_only"
+ "TARGET_POWER10 && TARGET_FLOAT128_HW"
"#"
"&& 1"
[(set (match_dup 6)
@@ -5889,7 +5880,7 @@
(match_operand:IEEE128 3 "altivec_register_operand" "v")])
(match_operand:V2DI 4 "all_ones_constant" "")
(match_operand:V2DI 5 "zero_constant" "")))]
- "TARGET_POWER10 && TARGET_FLOAT128_HW && flag_finite_math_only"
+ "TARGET_POWER10 && TARGET_FLOAT128_HW"
"xscmp%V1qp %0,%2,%3"
[(set_attr "type" "fpcompare")])
@@ -5900,7 +5891,7 @@
(match_operand:V2DI 2 "zero_constant" ""))
(match_operand:IEEE128 3 "altivec_register_operand" "v")
(match_operand:IEEE128 4 "altivec_register_operand" "v")))]
- "TARGET_POWER10 && TARGET_FLOAT128_HW && flag_finite_math_only"
+ "TARGET_POWER10 && TARGET_FLOAT128_HW"
"xxsel %x0,%x4,%x3,%x1"
[(set_attr "type" "vecmove")])
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-cmove.c b/gcc/testsuite/gcc.target/powerpc/float128-cmove.c
index 496fe29740c8..2fae8dc23bcf 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-cmove.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-cmove.c
@@ -1,11 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target ppc_float128_hw } */
/* { dg-require-effective-target power10_ok } */
-/* { dg-options "-mdejagnu-cpu=power10 -Ofast" } */
-
-/* The XSCMP{EQ,GT,GE}QP instructions will trap if a signaling NaN is one of
- the arguments, so this code is now only generated if -Ofast or
- -ffinite-math-only is used. */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
#ifndef TYPE
#ifdef __LONG_DOUBLE_IEEE128__
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-minmax-3.c b/gcc/testsuite/gcc.target/powerpc/float128-minmax-3.c
index 9c7474911981..6f7627c0f2a1 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-minmax-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-minmax-3.c
@@ -1,10 +1,6 @@
/* { dg-require-effective-target ppc_float128_hw } */
/* { dg-require-effective-target power10_ok } */
-/* { dg-options "-mdejagnu-cpu=power10 -Ofast" } */
-
-/* The XS{MAX,MIN}}CQP instructions will trap if a signaling NaN is one of the
- arguments, so this code is now only generated if -Ofast or
- -ffinite-math-only is used. */
+/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
#ifndef TYPE
#define TYPE _Float128
More information about the Gcc-cvs
mailing list