[llvm] r232177 - R600/SI: Add test for min / max with immediate
Matt Arsenault
Matthew.Arsenault at amd.com
Fri Mar 13 09:43:49 PDT 2015
Author: arsenm
Date: Fri Mar 13 11:43:48 2015
New Revision: 232177
URL: http://llvm.org/viewvc/llvm-project?rev=232177&view=rev
Log:
R600/SI: Add test for min / max with immediate
Make sure this isn't getting confused by canonicalizations
of comparisons with a constant.
Modified:
llvm/trunk/test/CodeGen/R600/max.ll
llvm/trunk/test/CodeGen/R600/min.ll
Modified: llvm/trunk/test/CodeGen/R600/max.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/max.ll?rev=232177&r1=232176&r2=232177&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/max.ll (original)
+++ llvm/trunk/test/CodeGen/R600/max.ll Fri Mar 13 11:43:48 2015
@@ -26,6 +26,24 @@ define void @s_test_imax_sge_i32(i32 add
ret void
}
+; FUNC-LABEL: {{^}}s_test_imax_sge_imm_i32:
+; SI: s_max_i32 {{s[0-9]+}}, {{s[0-9]+}}, 9
+define void @s_test_imax_sge_imm_i32(i32 addrspace(1)* %out, i32 %a) nounwind {
+ %cmp = icmp sge i32 %a, 9
+ %val = select i1 %cmp, i32 %a, i32 9
+ store i32 %val, i32 addrspace(1)* %out, align 4
+ ret void
+}
+
+; FUNC-LABEL: {{^}}s_test_imax_sgt_imm_i32:
+; SI: s_max_i32 {{s[0-9]+}}, {{s[0-9]+}}, 9
+define void @s_test_imax_sgt_imm_i32(i32 addrspace(1)* %out, i32 %a) nounwind {
+ %cmp = icmp sgt i32 %a, 9
+ %val = select i1 %cmp, i32 %a, i32 9
+ store i32 %val, i32 addrspace(1)* %out, align 4
+ ret void
+}
+
; FUNC-LABEL: @v_test_imax_sgt_i32
; SI: v_max_i32_e32
define void @v_test_imax_sgt_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %aptr, i32 addrspace(1)* %bptr) nounwind {
Modified: llvm/trunk/test/CodeGen/R600/min.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/min.ll?rev=232177&r1=232176&r2=232177&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/min.ll (original)
+++ llvm/trunk/test/CodeGen/R600/min.ll Fri Mar 13 11:43:48 2015
@@ -50,6 +50,24 @@ define void @s_test_imin_slt_i32(i32 add
ret void
}
+; FUNC-LABEL: {{^}}s_test_imin_slt_imm_i32:
+; SI: s_min_i32 {{s[0-9]+}}, {{s[0-9]+}}, 8
+define void @s_test_imin_slt_imm_i32(i32 addrspace(1)* %out, i32 %a) nounwind {
+ %cmp = icmp slt i32 %a, 8
+ %val = select i1 %cmp, i32 %a, i32 8
+ store i32 %val, i32 addrspace(1)* %out, align 4
+ ret void
+}
+
+; FUNC-LABEL: {{^}}s_test_imin_sle_imm_i32:
+; SI: s_min_i32 {{s[0-9]+}}, {{s[0-9]+}}, 8
+define void @s_test_imin_sle_imm_i32(i32 addrspace(1)* %out, i32 %a) nounwind {
+ %cmp = icmp sle i32 %a, 8
+ %val = select i1 %cmp, i32 %a, i32 8
+ store i32 %val, i32 addrspace(1)* %out, align 4
+ ret void
+}
+
; FUNC-LABEL: @v_test_umin_ule_i32
; SI: v_min_u32_e32
define void @v_test_umin_ule_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %aptr, i32 addrspace(1)* %bptr) nounwind {
More information about the llvm-commits
mailing list