summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/zero_extend.ll
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-11-10 16:02:37 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-11-10 16:02:37 +0000
commit115a61560e24e08ecca0b3e2d16e8f1491b47f61 (patch)
treea902f8fd2f221164e6ed9be6bbc932083293914a /llvm/test/CodeGen/AMDGPU/zero_extend.ll
parent2cf393c8fe6ebea1ba041de7e264f2fc7a557ab9 (diff)
downloadbcm5719-llvm-115a61560e24e08ecca0b3e2d16e8f1491b47f61.tar.gz
bcm5719-llvm-115a61560e24e08ecca0b3e2d16e8f1491b47f61.zip
AMDGPU: Add VI i16 support
Patch By: Wei Ding Differential Revision: https://reviews.llvm.org/D18049 llvm-svn: 286464
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/zero_extend.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/zero_extend.ll47
1 files changed, 33 insertions, 14 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/zero_extend.ll b/llvm/test/CodeGen/AMDGPU/zero_extend.ll
index 53539921479..b30cb73f6da 100644
--- a/llvm/test/CodeGen/AMDGPU/zero_extend.ll
+++ b/llvm/test/CodeGen/AMDGPU/zero_extend.ll
@@ -2,39 +2,58 @@
; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s --check-prefix=SI
; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=R600
-; R600: {{^}}test:
+; R600: {{^}}s_mad_zext_i32_to_i64:
; R600: MEM_RAT_CACHELESS STORE_RAW
; R600: MEM_RAT_CACHELESS STORE_RAW
-; SI: {{^}}test:
+; SI: {{^}}s_mad_zext_i32_to_i64:
; SI: v_mov_b32_e32 v[[V_ZERO:[0-9]]], 0{{$}}
; SI: buffer_store_dwordx2 v[0:[[V_ZERO]]{{\]}}
-define void @test(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) {
+define void @s_mad_zext_i32_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) #0 {
entry:
- %0 = mul i32 %a, %b
- %1 = add i32 %0, %c
- %2 = zext i32 %1 to i64
- store i64 %2, i64 addrspace(1)* %out
+ %tmp0 = mul i32 %a, %b
+ %tmp1 = add i32 %tmp0, %c
+ %tmp2 = zext i32 %tmp1 to i64
+ store i64 %tmp2, i64 addrspace(1)* %out
ret void
}
-; SI-LABEL: {{^}}testi1toi32:
+; SI-LABEL: {{^}}s_cmp_zext_i1_to_i32
; SI: v_cndmask_b32
-define void @testi1toi32(i32 addrspace(1)* %out, i32 %a, i32 %b) {
+define void @s_cmp_zext_i1_to_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
entry:
- %0 = icmp eq i32 %a, %b
- %1 = zext i1 %0 to i32
- store i32 %1, i32 addrspace(1)* %out
+ %tmp0 = icmp eq i32 %a, %b
+ %tmp1 = zext i1 %tmp0 to i32
+ store i32 %tmp1, i32 addrspace(1)* %out
ret void
}
-; SI-LABEL: {{^}}zext_i1_to_i64:
+; SI-LABEL: {{^}}s_arg_zext_i1_to_i64:
+define void @s_arg_zext_i1_to_i64(i64 addrspace(1)* %out, i1 zeroext %arg) #0 {
+ %ext = zext i1 %arg to i64
+ store i64 %ext, i64 addrspace(1)* %out, align 8
+ ret void
+}
+
+; SI-LABEL: {{^}}s_cmp_zext_i1_to_i64:
; SI: s_mov_b32 s{{[0-9]+}}, 0
; SI: v_cmp_eq_u32
; SI: v_cndmask_b32
-define void @zext_i1_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b) nounwind {
+define void @s_cmp_zext_i1_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b) #0 {
%cmp = icmp eq i32 %a, %b
%ext = zext i1 %cmp to i64
store i64 %ext, i64 addrspace(1)* %out, align 8
ret void
}
+
+; SI-LABEL: {{^}}s_cmp_zext_i1_to_i16
+; SI: v_cndmask_b32_e64 [[RESULT:v[0-9]+]], 0, 1, vcc
+; SI: buffer_store_short [[RESULT]]
+define void @s_cmp_zext_i1_to_i16(i16 addrspace(1)* %out, i16 zeroext %a, i16 zeroext %b) #0 {
+ %tmp0 = icmp eq i16 %a, %b
+ %tmp1 = zext i1 %tmp0 to i16
+ store i16 %tmp1, i16 addrspace(1)* %out
+ ret void
+}
+
+attributes #0 = { nounwind }
OpenPOWER on IntegriCloud