https://gcc.gnu.org/g:6aff7ebb20085661a9f4ca7a4156188d63bfe7eb

commit 6aff7ebb20085661a9f4ca7a4156188d63bfe7eb
Author: Michael Meissner <meiss...@linux.ibm.com>
Date:   Thu May 22 16:40:42 2025 -0400

    Disable fp cmove on power9
    
    2025-05-22  Michael Meissner  <meiss...@linux.ibm.com>
    
    gcc/
    
            PR target/118541
            * config/rs6000/rs6000.cc (have_compare_and_set_mask): Disable 
unless
            NaNs are disabled.

Diff:
---
 gcc/config/rs6000/rs6000.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 11dfde7f288b..a8a0e153c362 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -16509,11 +16509,17 @@ 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. */
+   "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.  */
 
 static bool
 have_compare_and_set_mask (machine_mode mode)
 {
+  if (!flag_finite_math_only)
+    return false;
+
   switch (mode)
     {
     case E_SFmode:

Reply via email to