annotate llvm/test/CodeGen/AMDGPU/zero_extend.ll @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -enable-var-scope --check-prefix=GCN %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope --check-prefix=GCN %s
150
anatofuz
parents:
diff changeset
3 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=R600 %s
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 ; R600: {{^}}s_mad_zext_i32_to_i64:
anatofuz
parents:
diff changeset
6 ; R600: MEM_RAT_CACHELESS STORE_RAW
anatofuz
parents:
diff changeset
7 ; R600: MEM_RAT_CACHELESS STORE_RAW
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 ; GCN: {{^}}s_mad_zext_i32_to_i64:
anatofuz
parents:
diff changeset
10 ; GCN: v_mov_b32_e32 v[[V_ZERO:[0-9]]], 0{{$}}
anatofuz
parents:
diff changeset
11 ; GCN: buffer_store_dwordx2 v[0:[[V_ZERO]]{{\]}}
anatofuz
parents:
diff changeset
12 define amdgpu_kernel void @s_mad_zext_i32_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) #0 {
anatofuz
parents:
diff changeset
13 entry:
anatofuz
parents:
diff changeset
14 %tmp0 = mul i32 %a, %b
anatofuz
parents:
diff changeset
15 %tmp1 = add i32 %tmp0, %c
anatofuz
parents:
diff changeset
16 %tmp2 = zext i32 %tmp1 to i64
anatofuz
parents:
diff changeset
17 store i64 %tmp2, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
18 ret void
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 ; GCN-LABEL: {{^}}s_cmp_zext_i1_to_i32
anatofuz
parents:
diff changeset
22 ; GCN: v_cndmask_b32
anatofuz
parents:
diff changeset
23 define amdgpu_kernel void @s_cmp_zext_i1_to_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
anatofuz
parents:
diff changeset
24 entry:
anatofuz
parents:
diff changeset
25 %tmp0 = icmp eq i32 %a, %b
anatofuz
parents:
diff changeset
26 %tmp1 = zext i1 %tmp0 to i32
anatofuz
parents:
diff changeset
27 store i32 %tmp1, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
28 ret void
anatofuz
parents:
diff changeset
29 }
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 ; GCN-LABEL: {{^}}s_arg_zext_i1_to_i64:
anatofuz
parents:
diff changeset
32 define amdgpu_kernel void @s_arg_zext_i1_to_i64(i64 addrspace(1)* %out, i1 zeroext %arg) #0 {
anatofuz
parents:
diff changeset
33 %ext = zext i1 %arg to i64
anatofuz
parents:
diff changeset
34 store i64 %ext, i64 addrspace(1)* %out, align 8
anatofuz
parents:
diff changeset
35 ret void
anatofuz
parents:
diff changeset
36 }
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 ; GCN-LABEL: {{^}}s_cmp_zext_i1_to_i64:
anatofuz
parents:
diff changeset
39 ; GCN-DAG: s_mov_b32 s{{[0-9]+}}, 0
anatofuz
parents:
diff changeset
40 ; GCN-DAG: v_cmp_eq_u32
anatofuz
parents:
diff changeset
41 ; GCN: v_cndmask_b32
anatofuz
parents:
diff changeset
42 define amdgpu_kernel void @s_cmp_zext_i1_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b) #0 {
anatofuz
parents:
diff changeset
43 %cmp = icmp eq i32 %a, %b
anatofuz
parents:
diff changeset
44 %ext = zext i1 %cmp to i64
anatofuz
parents:
diff changeset
45 store i64 %ext, i64 addrspace(1)* %out, align 8
anatofuz
parents:
diff changeset
46 ret void
anatofuz
parents:
diff changeset
47 }
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 ; FIXME: Why different commute?
anatofuz
parents:
diff changeset
50 ; GCN-LABEL: {{^}}s_cmp_zext_i1_to_i16
anatofuz
parents:
diff changeset
51 ; GCN: s_load_dword [[A:s[0-9]+]]
anatofuz
parents:
diff changeset
52 ; GCN: s_load_dword [[B:s[0-9]+]]
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54 ; GCN: s_mov_b32 [[MASK:s[0-9]+]], 0xffff{{$}}
anatofuz
parents:
diff changeset
55 ; GCN-DAG: s_and_b32 [[MASK_A:s[0-9]+]], [[A]], [[MASK]]
anatofuz
parents:
diff changeset
56 ; GCN-DAG: s_and_b32 [[MASK_B:s[0-9]+]], [[B]], [[MASK]]
anatofuz
parents:
diff changeset
57 ; GCN: v_mov_b32_e32 [[V_B:v[0-9]+]], [[B]]
anatofuz
parents:
diff changeset
58 ; GCN: v_cmp_eq_u32_e32 vcc, [[MASK_A]], [[V_B]]
anatofuz
parents:
diff changeset
59
anatofuz
parents:
diff changeset
60 ; GCN: v_cndmask_b32_e64 [[RESULT:v[0-9]+]], 0, 1, vcc
anatofuz
parents:
diff changeset
61 ; GCN: buffer_store_short [[RESULT]]
anatofuz
parents:
diff changeset
62 define amdgpu_kernel void @s_cmp_zext_i1_to_i16(i16 addrspace(1)* %out, [8 x i32], i16 zeroext %a, [8 x i32], i16 zeroext %b) #0 {
anatofuz
parents:
diff changeset
63 %tmp0 = icmp eq i16 %a, %b
anatofuz
parents:
diff changeset
64 %tmp1 = zext i1 %tmp0 to i16
anatofuz
parents:
diff changeset
65 store i16 %tmp1, i16 addrspace(1)* %out
anatofuz
parents:
diff changeset
66 ret void
anatofuz
parents:
diff changeset
67 }
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 attributes #0 = { nounwind }