2019-11-12  Segher Boessenkool  <seg...@kernel.crashing.org>

        * config/rs6000/vsx.md (xscmpexpdp_<code> for CMP_TEST): Handle
        UNORDERED if !HONOR_NANS (DFmode).
        (xscmpexpqp_<code>_<mode> for CMP_TEST and IEEE128): Handle UNORDERED
        if !HONOR_NANS (<MODE>mode).

---
 gcc/config/rs6000/vsx.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index aa13b20..3aa8e21 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -4526,6 +4526,12 @@ (define_expand "xscmpexpdp_<code>"
                     (const_int 0)))]
   "TARGET_P9_VECTOR"
 {
+  if (<CODE> == UNORDERED && !HONOR_NANS (DFmode))
+    {
+      emit_move_insn (operands[0], const0_rtx);
+      DONE;
+    }
+
   operands[3] = gen_reg_rtx (CCFPmode);
 })
 
@@ -4554,6 +4560,12 @@ (define_expand "xscmpexpqp_<code>_<mode>"
                     (const_int 0)))]
   "TARGET_P9_VECTOR"
 {
+  if (<CODE> == UNORDERED && !HONOR_NANS (<MODE>mode))
+    {
+      emit_move_insn (operands[0], const0_rtx);
+      DONE;
+    }
+
   operands[3] = gen_reg_rtx (CCFPmode);
 })
 
-- 
1.8.3.1

Reply via email to