annotate llvm/test/CodeGen/AMDGPU/commute-shifts.ll @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=VI %s
150
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 define amdgpu_ps float @main(float %arg0, float %arg1) #0 {
anatofuz
parents:
diff changeset
6 ; SI-LABEL: main:
anatofuz
parents:
diff changeset
7 ; SI: ; %bb.0: ; %bb
anatofuz
parents:
diff changeset
8 ; SI-NEXT: v_cvt_i32_f32_e32 v0, v0
anatofuz
parents:
diff changeset
9 ; SI-NEXT: s_mov_b32 s0, 0
anatofuz
parents:
diff changeset
10 ; SI-NEXT: s_mov_b32 s1, s0
anatofuz
parents:
diff changeset
11 ; SI-NEXT: s_mov_b32 s2, s0
anatofuz
parents:
diff changeset
12 ; SI-NEXT: s_mov_b32 s3, s0
anatofuz
parents:
diff changeset
13 ; SI-NEXT: s_mov_b32 s4, s0
anatofuz
parents:
diff changeset
14 ; SI-NEXT: s_mov_b32 s5, s0
anatofuz
parents:
diff changeset
15 ; SI-NEXT: s_mov_b32 s6, s0
anatofuz
parents:
diff changeset
16 ; SI-NEXT: s_mov_b32 s7, s0
anatofuz
parents:
diff changeset
17 ; SI-NEXT: image_load v2, v0, s[0:7] dmask:0x1 unorm
anatofuz
parents:
diff changeset
18 ; SI-NEXT: v_and_b32_e32 v0, 7, v0
anatofuz
parents:
diff changeset
19 ; SI-NEXT: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
20 ; SI-NEXT: v_lshr_b32_e32 v0, v2, v0
anatofuz
parents:
diff changeset
21 ; SI-NEXT: v_and_b32_e32 v0, 1, v0
anatofuz
parents:
diff changeset
22 ; SI-NEXT: v_cmp_eq_u32_e32 vcc, 1, v0
anatofuz
parents:
diff changeset
23 ; SI-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
anatofuz
parents:
diff changeset
24 ; SI-NEXT: v_cvt_pkrtz_f16_f32_e32 v0, s0, v0
anatofuz
parents:
diff changeset
25 ; SI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
26 ;
anatofuz
parents:
diff changeset
27 ; VI-LABEL: main:
anatofuz
parents:
diff changeset
28 ; VI: ; %bb.0: ; %bb
anatofuz
parents:
diff changeset
29 ; VI-NEXT: v_cvt_i32_f32_e32 v0, v0
anatofuz
parents:
diff changeset
30 ; VI-NEXT: s_mov_b32 s0, 0
anatofuz
parents:
diff changeset
31 ; VI-NEXT: s_mov_b32 s1, s0
anatofuz
parents:
diff changeset
32 ; VI-NEXT: s_mov_b32 s2, s0
anatofuz
parents:
diff changeset
33 ; VI-NEXT: s_mov_b32 s3, s0
anatofuz
parents:
diff changeset
34 ; VI-NEXT: s_mov_b32 s4, s0
anatofuz
parents:
diff changeset
35 ; VI-NEXT: s_mov_b32 s5, s0
anatofuz
parents:
diff changeset
36 ; VI-NEXT: s_mov_b32 s6, s0
anatofuz
parents:
diff changeset
37 ; VI-NEXT: s_mov_b32 s7, s0
anatofuz
parents:
diff changeset
38 ; VI-NEXT: image_load v2, v0, s[0:7] dmask:0x1 unorm
anatofuz
parents:
diff changeset
39 ; VI-NEXT: v_and_b32_e32 v0, 7, v0
anatofuz
parents:
diff changeset
40 ; VI-NEXT: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
41 ; VI-NEXT: v_lshrrev_b32_e32 v0, v0, v2
anatofuz
parents:
diff changeset
42 ; VI-NEXT: v_and_b32_e32 v0, 1, v0
anatofuz
parents:
diff changeset
43 ; VI-NEXT: v_cmp_eq_u32_e32 vcc, 1, v0
anatofuz
parents:
diff changeset
44 ; VI-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
anatofuz
parents:
diff changeset
45 ; VI-NEXT: v_cvt_pkrtz_f16_f32 v0, s0, v0
anatofuz
parents:
diff changeset
46 ; VI-NEXT: ; return to shader part epilog
anatofuz
parents:
diff changeset
47 bb:
anatofuz
parents:
diff changeset
48 %tmp = fptosi float %arg0 to i32
anatofuz
parents:
diff changeset
49 %tmp1 = call <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32 15, i32 undef, <8 x i32> undef, i32 0, i32 0)
anatofuz
parents:
diff changeset
50 %tmp2.f = extractelement <4 x float> %tmp1, i32 0
anatofuz
parents:
diff changeset
51 %tmp2 = bitcast float %tmp2.f to i32
anatofuz
parents:
diff changeset
52 %tmp3 = and i32 %tmp, 7
anatofuz
parents:
diff changeset
53 %tmp4 = shl i32 1, %tmp3
anatofuz
parents:
diff changeset
54 %tmp5 = and i32 %tmp2, %tmp4
anatofuz
parents:
diff changeset
55 %tmp6 = icmp eq i32 %tmp5, 0
anatofuz
parents:
diff changeset
56 %tmp7 = select i1 %tmp6, float 0.000000e+00, float %arg1
anatofuz
parents:
diff changeset
57 %tmp8 = call <2 x half> @llvm.amdgcn.cvt.pkrtz(float undef, float %tmp7)
anatofuz
parents:
diff changeset
58 %tmp9 = bitcast <2 x half> %tmp8 to float
anatofuz
parents:
diff changeset
59 ret float %tmp9
anatofuz
parents:
diff changeset
60 }
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 declare <2 x half> @llvm.amdgcn.cvt.pkrtz(float, float) #1
anatofuz
parents:
diff changeset
63 declare <4 x float> @llvm.amdgcn.image.load.1d.v4f32.i32(i32, i32, <8 x i32>, i32, i32) #2
anatofuz
parents:
diff changeset
64
anatofuz
parents:
diff changeset
65 attributes #0 = { nounwind }
anatofuz
parents:
diff changeset
66 attributes #1 = { nounwind readnone }
anatofuz
parents:
diff changeset
67 attributes #2 = { nounwind readonly }