annotate llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.pk.i16.ll @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1f2b6ac9f198
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=SI %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=SI %s
anatofuz
parents:
diff changeset
3 ; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=VI %s
anatofuz
parents:
diff changeset
4 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=VI %s
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 ; GCN-LABEL: {{^}}s_cvt_pk_i16_i32:
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
7 ; GCN-DAG: s_load_dwordx4 s[[[#LOAD:]]:{{[0-9]+}}], s[0:1], 0x{{9|24}}
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
8 ; GCN: v_mov_b32_e32 [[VY:v[0-9]+]], s[[#LOAD + 3]]
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
9 ; SI: v_cvt_pk_i16_i32_e32 v{{[0-9]+}}, s[[#LOAD + 2]], [[VY]]
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
10 ; VI: v_cvt_pk_i16_i32 v{{[0-9]+}}, s[[#LOAD + 2]], [[VY]]
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
11 define amdgpu_kernel void @s_cvt_pk_i16_i32(ptr addrspace(1) %out, i32 %x, i32 %y) #0 {
150
anatofuz
parents:
diff changeset
12 %result = call <2 x i16> @llvm.amdgcn.cvt.pk.i16(i32 %x, i32 %y)
anatofuz
parents:
diff changeset
13 %r = bitcast <2 x i16> %result to i32
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
14 store i32 %r, ptr addrspace(1) %out
150
anatofuz
parents:
diff changeset
15 ret void
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 ; GCN-LABEL: {{^}}s_cvt_pk_i16_samereg_i32:
anatofuz
parents:
diff changeset
19 ; GCN: s_load_dword [[X:s[0-9]+]]
anatofuz
parents:
diff changeset
20 ; GCN: v_cvt_pk_i16_i32{{(_e64)*}} v{{[0-9]+}}, [[X]], [[X]]
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
21 define amdgpu_kernel void @s_cvt_pk_i16_samereg_i32(ptr addrspace(1) %out, i32 %x) #0 {
150
anatofuz
parents:
diff changeset
22 %result = call <2 x i16> @llvm.amdgcn.cvt.pk.i16(i32 %x, i32 %x)
anatofuz
parents:
diff changeset
23 %r = bitcast <2 x i16> %result to i32
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
24 store i32 %r, ptr addrspace(1) %out
150
anatofuz
parents:
diff changeset
25 ret void
anatofuz
parents:
diff changeset
26 }
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 ; GCN-LABEL: {{^}}v_cvt_pk_i16_i32:
anatofuz
parents:
diff changeset
29 ; GCN: {{buffer|flat|global}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
30 ; GCN: {{buffer|flat|global}}_load_dword [[B:v[0-9]+]]
anatofuz
parents:
diff changeset
31 ; SI: v_cvt_pk_i16_i32_e32 v{{[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
32 ; VI: v_cvt_pk_i16_i32 v{{[0-9]+}}, [[A]], [[B]]
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
33 define amdgpu_kernel void @v_cvt_pk_i16_i32(ptr addrspace(1) %out, ptr addrspace(1) %a.ptr, ptr addrspace(1) %b.ptr) #0 {
150
anatofuz
parents:
diff changeset
34 %tid = call i32 @llvm.amdgcn.workitem.id.x()
anatofuz
parents:
diff changeset
35 %tid.ext = sext i32 %tid to i64
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
36 %a.gep = getelementptr inbounds i32, ptr addrspace(1) %a.ptr, i64 %tid.ext
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
37 %b.gep = getelementptr inbounds i32, ptr addrspace(1) %b.ptr, i64 %tid.ext
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
38 %out.gep = getelementptr inbounds i32, ptr addrspace(1) %out, i64 %tid.ext
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
39 %a = load volatile i32, ptr addrspace(1) %a.gep
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
40 %b = load volatile i32, ptr addrspace(1) %b.gep
150
anatofuz
parents:
diff changeset
41 %cvt = call <2 x i16> @llvm.amdgcn.cvt.pk.i16(i32 %a, i32 %b)
anatofuz
parents:
diff changeset
42 %r = bitcast <2 x i16> %cvt to i32
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
43 store i32 %r, ptr addrspace(1) %out.gep
150
anatofuz
parents:
diff changeset
44 ret void
anatofuz
parents:
diff changeset
45 }
anatofuz
parents:
diff changeset
46
anatofuz
parents:
diff changeset
47 ; GCN-LABEL: {{^}}v_cvt_pk_i16_i32_reg_imm:
anatofuz
parents:
diff changeset
48 ; GCN: {{buffer|flat|global}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
49 ; GCN: v_cvt_pk_i16_i32{{(_e64)*}} v{{[0-9]+}}, [[A]], 1
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
50 define amdgpu_kernel void @v_cvt_pk_i16_i32_reg_imm(ptr addrspace(1) %out, ptr addrspace(1) %a.ptr) #0 {
150
anatofuz
parents:
diff changeset
51 %tid = call i32 @llvm.amdgcn.workitem.id.x()
anatofuz
parents:
diff changeset
52 %tid.ext = sext i32 %tid to i64
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
53 %a.gep = getelementptr inbounds i32, ptr addrspace(1) %a.ptr, i64 %tid.ext
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
54 %out.gep = getelementptr inbounds i32, ptr addrspace(1) %out, i64 %tid.ext
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
55 %a = load volatile i32, ptr addrspace(1) %a.gep
150
anatofuz
parents:
diff changeset
56 %cvt = call <2 x i16> @llvm.amdgcn.cvt.pk.i16(i32 %a, i32 1)
anatofuz
parents:
diff changeset
57 %r = bitcast <2 x i16> %cvt to i32
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
58 store i32 %r, ptr addrspace(1) %out.gep
150
anatofuz
parents:
diff changeset
59 ret void
anatofuz
parents:
diff changeset
60 }
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 ; GCN-LABEL: {{^}}v_cvt_pk_i16_i32_imm_reg:
anatofuz
parents:
diff changeset
63 ; GCN: {{buffer|flat|global}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
64 ; SI: v_cvt_pk_i16_i32_e32 v{{[0-9]+}}, 1, [[A]]
anatofuz
parents:
diff changeset
65 ; VI: v_cvt_pk_i16_i32 v{{[0-9]+}}, 1, [[A]]
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
66 define amdgpu_kernel void @v_cvt_pk_i16_i32_imm_reg(ptr addrspace(1) %out, ptr addrspace(1) %a.ptr) #0 {
150
anatofuz
parents:
diff changeset
67 %tid = call i32 @llvm.amdgcn.workitem.id.x()
anatofuz
parents:
diff changeset
68 %tid.ext = sext i32 %tid to i64
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
69 %a.gep = getelementptr inbounds i32, ptr addrspace(1) %a.ptr, i64 %tid.ext
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
70 %out.gep = getelementptr inbounds i32, ptr addrspace(1) %out, i64 %tid.ext
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
71 %a = load volatile i32, ptr addrspace(1) %a.gep
150
anatofuz
parents:
diff changeset
72 %cvt = call <2 x i16> @llvm.amdgcn.cvt.pk.i16(i32 1, i32 %a)
anatofuz
parents:
diff changeset
73 %r = bitcast <2 x i16> %cvt to i32
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
74 store i32 %r, ptr addrspace(1) %out.gep
150
anatofuz
parents:
diff changeset
75 ret void
anatofuz
parents:
diff changeset
76 }
anatofuz
parents:
diff changeset
77
anatofuz
parents:
diff changeset
78 declare <2 x i16> @llvm.amdgcn.cvt.pk.i16(i32, i32) #1
anatofuz
parents:
diff changeset
79 declare i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
80
anatofuz
parents:
diff changeset
81
anatofuz
parents:
diff changeset
82 attributes #0 = { nounwind }
anatofuz
parents:
diff changeset
83 attributes #1 = { nounwind readnone }