[llvm] r209024 - R600/SI: Promote f32 SELECT to i32
Tom Stellard
thomas.stellard at amd.com
Fri May 16 13:56:41 PDT 2014
Author: tstellar
Date: Fri May 16 15:56:41 2014
New Revision: 209024
URL: http://llvm.org/viewvc/llvm-project?rev=209024&view=rev
Log:
R600/SI: Promote f32 SELECT to i32
Modified:
llvm/trunk/lib/Target/R600/SIISelLowering.cpp
llvm/trunk/lib/Target/R600/SIInstructions.td
llvm/trunk/test/CodeGen/R600/v_cndmask.ll
Modified: llvm/trunk/lib/Target/R600/SIISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIISelLowering.cpp?rev=209024&r1=209023&r2=209024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIISelLowering.cpp Fri May 16 15:56:41 2014
@@ -99,6 +99,8 @@ SITargetLowering::SITargetLowering(Targe
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);
Modified: llvm/trunk/lib/Target/R600/SIInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstructions.td?rev=209024&r1=209023&r2=209024&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstructions.td (original)
+++ llvm/trunk/lib/Target/R600/SIInstructions.td Fri May 16 15:56:41 2014
@@ -1121,12 +1121,6 @@ def V_CNDMASK_B32_e64 : VOP3 <0x00000100
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),
Modified: llvm/trunk/test/CodeGen/R600/v_cndmask.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/v_cndmask.ll?rev=209024&r1=209023&r2=209024&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/v_cndmask.ll (original)
+++ llvm/trunk/test/CodeGen/R600/v_cndmask.ll Fri May 16 15:56:41 2014
@@ -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
More information about the llvm-commits
mailing list