R600/SI: Promote f32 SELECT to i32
authorTom Stellard <thomas.stellard@amd.com>
Fri, 16 May 2014 20:56:41 +0000 (20:56 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 16 May 2014 20:56:41 +0000 (20:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209024 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/SIISelLowering.cpp
lib/Target/R600/SIInstructions.td
test/CodeGen/R600/v_cndmask.ll

index 7c0a6dd9f4aeb41716de9d97edc89056b380f268..b51c46c59e6efb5e76f0832d868ec7cd10315474 100644 (file)
@@ -99,6 +99,8 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :
   setOperationAction(ISD::STORE, MVT::v2i32, Custom);
   setOperationAction(ISD::STORE, MVT::v4i32, Custom);
 
+  setOperationAction(ISD::SELECT, MVT::f32, Promote);
+  AddPromotedToType(ISD::SELECT, MVT::f32, MVT::i32);
   setOperationAction(ISD::SELECT, MVT::i64, Custom);
   setOperationAction(ISD::SELECT, MVT::f64, Promote);
   AddPromotedToType(ISD::SELECT, MVT::f64, MVT::i64);
index fab74d064f713a6087582bca36ce1226f3cb4089..482295c26e7e19cebbe4e8832c0127e58dc2c3bb 100644 (file)
@@ -1121,12 +1121,6 @@ def V_CNDMASK_B32_e64 : VOP3 <0x00000100, (outs VReg_32:$dst),
   let src2_modifiers = 0;
 }
 
-//f32 pattern for V_CNDMASK_B32_e64
-def : Pat <
-  (f32 (select i1:$src2, f32:$src1, f32:$src0)),
-  (V_CNDMASK_B32_e64 $src0, $src1, $src2)
->;
-
 def V_READLANE_B32 : VOP2 <
   0x00000001,
   (outs SReg_32:$vdst),
index f8e96559a8a3028ce0e978a389bd30461a9a0f25..84087ee78d597ced8bf9361caff2e749a34f4223 100644 (file)
@@ -3,7 +3,8 @@
 ; SI: @v_cnd_nan
 ; SI: V_CNDMASK_B32_e64 v{{[0-9]}},
 ; SI-DAG: v{{[0-9]}}
-; SI-DAG: {{nan|#QNAN}}
+; All nan values are converted to 0xffffffff
+; SI-DAG: -1
 define void @v_cnd_nan(float addrspace(1)* %out, i32 %c, float %f) {
 entry:
   %0 = icmp ne i32 %c, 0