[1/2] rs6000: Handle unordered for xscmpexp[dq]p without NaNs (PR92449)
diff mbox series

Message ID 0afa61fc0966d2a31a00da03af3f925305029aff.1573590370.git.segher@kernel.crashing.org
State New
Headers show
Series
  • Fix PR 92449 (unordered with -ffast-math)
Related show

Commit Message

Segher Boessenkool Nov. 12, 2019, 8:54 p.m. UTC
2019-11-12  Segher Boessenkool  <segher@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(+)

Patch
diff mbox series

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);
 })