[llvm] r204840 - R600: Add a testcase for sext_in_reg I missed.
Matt Arsenault
Matthew.Arsenault at amd.com
Wed Mar 26 11:31:06 PDT 2014
Author: arsenm
Date: Wed Mar 26 13:31:06 2014
New Revision: 204840
URL: http://llvm.org/viewvc/llvm-project?rev=204840&view=rev
Log:
R600: Add a testcase for sext_in_reg I missed.
This sext_inreg i32 in i64 case was already handled, but not enabled.
Modified:
llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp
llvm/trunk/test/CodeGen/R600/sext-in-reg.ll
Modified: llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp?rev=204840&r1=204839&r2=204840&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp Wed Mar 26 13:31:06 2014
@@ -224,6 +224,8 @@ AMDGPUTargetLowering::AMDGPUTargetLoweri
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v2i16, Custom);
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v4i16, Custom);
+ setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i32, Custom);
+
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::Other, Custom);
}
Modified: llvm/trunk/test/CodeGen/R600/sext-in-reg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/sext-in-reg.ll?rev=204840&r1=204839&r2=204840&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/sext-in-reg.ll (original)
+++ llvm/trunk/test/CodeGen/R600/sext-in-reg.ll Wed Mar 26 13:31:06 2014
@@ -86,6 +86,20 @@ define void @sext_in_reg_i16_to_i64(i64
ret void
}
+; FUNC-LABEL: @sext_in_reg_i32_to_i64
+; SI: S_LOAD_DWORDX2
+; SI: S_ADD_I32
+; SI-NEXT: S_ADDC_U32
+; SI-NEXT: S_ASHR_I32 s{{[0-9]+}}, s{{[0-9]+}}, 31
+; SI: BUFFER_STORE_DWORDX2
+define void @sext_in_reg_i32_to_i64(i64 addrspace(1)* %out, i64 %a, i64 %b) nounwind {
+ %c = add i64 %a, %b
+ %shl = shl i64 %c, 32
+ %ashr = ashr i64 %shl, 32
+ store i64 %ashr, i64 addrspace(1)* %out, align 8
+ ret void
+}
+
; This is broken on Evergreen for some reason related to the <1 x i64> kernel arguments.
; XFUNC-LABEL: @sext_in_reg_i8_to_v1i64
; XSI: V_BFE_I32 {{v[0-9]+}}, {{s[0-9]+}}, 0, 8
More information about the llvm-commits
mailing list