R600/SI: Only select cvt_flr/cvt_rpi with no NaNs.
[oota-llvm.git] / lib / Target / R600 / AMDGPUInstructions.td
index e42796bd14a50223d3dcd6d2b0fe6113ece87331..6ab82a25913d3df0c0cfe998670a98a45061d06f 100644 (file)
@@ -612,12 +612,14 @@ def umul24 : PatFrag <(ops node:$x, node:$y), (mul node:$x, node:$y)>;
 
 def cvt_rpi_i32_f32 : PatFrag <
   (ops node:$src),
-  (fp_to_sint (ffloor (fadd $src, FP_HALF)))
+  (fp_to_sint (ffloor (fadd $src, FP_HALF))),
+  [{ (void) N; return TM.Options.NoNaNsFPMath; }]
 >;
 
 def cvt_flr_i32_f32 : PatFrag <
   (ops node:$src),
-  (fp_to_sint (ffloor $src))
+  (fp_to_sint (ffloor $src)),
+  [{ (void)N; return TM.Options.NoNaNsFPMath; }]
 >;
 
 /*