annotate llvm/test/CodeGen/AMDGPU/s_movk_i32.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; SI-LABEL: {{^}}s_movk_i32_k0:
anatofuz
parents:
diff changeset
5 ; SI-DAG: s_mov_b32 [[LO_S_IMM:s[0-9]+]], 0xffff{{$}}
anatofuz
parents:
diff changeset
6 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
7 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
8 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, 1, v[[HI_VREG]]
anatofuz
parents:
diff changeset
9 ; SI: s_endpgm
anatofuz
parents:
diff changeset
10 define amdgpu_kernel void @s_movk_i32_k0(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
11 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
12 %or = or i64 %loada, 4295032831 ; ((1 << 16) - 1) | (1 << 32)
anatofuz
parents:
diff changeset
13 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
14 call void asm sideeffect "; use $0", "s"(i64 4295032831)
anatofuz
parents:
diff changeset
15 ret void
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 ; SI-LABEL: {{^}}s_movk_i32_k1:
anatofuz
parents:
diff changeset
19 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x7fff{{$}}
anatofuz
parents:
diff changeset
20 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
21 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
22 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, 1, v[[HI_VREG]]
anatofuz
parents:
diff changeset
23 ; SI: s_endpgm
anatofuz
parents:
diff changeset
24 define amdgpu_kernel void @s_movk_i32_k1(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
25 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
26 %or = or i64 %loada, 4295000063 ; ((1 << 15) - 1) | (1 << 32)
anatofuz
parents:
diff changeset
27 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
28 call void asm sideeffect "; use $0", "s"(i64 4295000063)
anatofuz
parents:
diff changeset
29 ret void
anatofuz
parents:
diff changeset
30 }
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 ; SI-LABEL: {{^}}s_movk_i32_k2:
anatofuz
parents:
diff changeset
33 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x7fff{{$}}
anatofuz
parents:
diff changeset
34 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
35 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
36 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, 64, v[[HI_VREG]]
anatofuz
parents:
diff changeset
37 ; SI: s_endpgm
anatofuz
parents:
diff changeset
38 define amdgpu_kernel void @s_movk_i32_k2(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
39 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
40 %or = or i64 %loada, 274877939711 ; ((1 << 15) - 1) | (64 << 32)
anatofuz
parents:
diff changeset
41 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
42 call void asm sideeffect "; use $0", "s"(i64 274877939711)
anatofuz
parents:
diff changeset
43 ret void
anatofuz
parents:
diff changeset
44 }
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 ; SI-LABEL: {{^}}s_movk_i32_k3:
anatofuz
parents:
diff changeset
47 ; SI-DAG: s_mov_b32 [[LO_S_IMM:s[0-9]+]], 0x8000{{$}}
anatofuz
parents:
diff changeset
48 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
49 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
50 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, 1, v[[HI_VREG]]
anatofuz
parents:
diff changeset
51 ; SI: s_endpgm
anatofuz
parents:
diff changeset
52 define amdgpu_kernel void @s_movk_i32_k3(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
53 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
54 %or = or i64 %loada, 4295000064 ; (1 << 15) | (1 << 32)
anatofuz
parents:
diff changeset
55 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
56 call void asm sideeffect "; use $0", "s"(i64 4295000064)
anatofuz
parents:
diff changeset
57 ret void
anatofuz
parents:
diff changeset
58 }
anatofuz
parents:
diff changeset
59
anatofuz
parents:
diff changeset
60 ; SI-LABEL: {{^}}s_movk_i32_k4:
anatofuz
parents:
diff changeset
61 ; SI-DAG: s_mov_b32 [[LO_S_IMM:s[0-9]+]], 0x20000{{$}}
anatofuz
parents:
diff changeset
62 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
63 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
64 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, 1, v[[HI_VREG]]
anatofuz
parents:
diff changeset
65 ; SI: s_endpgm
anatofuz
parents:
diff changeset
66 define amdgpu_kernel void @s_movk_i32_k4(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
67 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
68 %or = or i64 %loada, 4295098368 ; (1 << 17) | (1 << 32)
anatofuz
parents:
diff changeset
69 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
70 call void asm sideeffect "; use $0", "s"(i64 4295098368)
anatofuz
parents:
diff changeset
71 ret void
anatofuz
parents:
diff changeset
72 }
anatofuz
parents:
diff changeset
73
anatofuz
parents:
diff changeset
74 ; SI-LABEL: {{^}}s_movk_i32_k5:
anatofuz
parents:
diff changeset
75 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0xffef{{$}}
anatofuz
parents:
diff changeset
76 ; SI-DAG: s_mov_b32 [[HI_S_IMM:s[0-9]+]], 0xff00ffff{{$}}
anatofuz
parents:
diff changeset
77 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
78 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
79 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[HI_S_IMM]], v[[HI_VREG]]
anatofuz
parents:
diff changeset
80 ; SI: s_endpgm
anatofuz
parents:
diff changeset
81 define amdgpu_kernel void @s_movk_i32_k5(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
82 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
83 %or = or i64 %loada, 18374967954648334319 ; -17 & 0xff00ffffffffffff
anatofuz
parents:
diff changeset
84 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
85 call void asm sideeffect "; use $0", "s"(i64 18374967954648334319)
anatofuz
parents:
diff changeset
86 ret void
anatofuz
parents:
diff changeset
87 }
anatofuz
parents:
diff changeset
88
anatofuz
parents:
diff changeset
89 ; SI-LABEL: {{^}}s_movk_i32_k6:
anatofuz
parents:
diff changeset
90 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x41{{$}}
anatofuz
parents:
diff changeset
91 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
92 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
93 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, 63, v[[HI_VREG]]
anatofuz
parents:
diff changeset
94 ; SI: s_endpgm
anatofuz
parents:
diff changeset
95 define amdgpu_kernel void @s_movk_i32_k6(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
96 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
97 %or = or i64 %loada, 270582939713 ; 65 | (63 << 32)
anatofuz
parents:
diff changeset
98 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
99 call void asm sideeffect "; use $0", "s"(i64 270582939713)
anatofuz
parents:
diff changeset
100 ret void
anatofuz
parents:
diff changeset
101 }
anatofuz
parents:
diff changeset
102
anatofuz
parents:
diff changeset
103 ; SI-LABEL: {{^}}s_movk_i32_k7:
anatofuz
parents:
diff changeset
104 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x2000{{$}}
anatofuz
parents:
diff changeset
105 ; SI-DAG: s_movk_i32 [[HI_S_IMM:s[0-9]+]], 0x4000{{$}}
anatofuz
parents:
diff changeset
106 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
107 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
108 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[HI_S_IMM]], v[[HI_VREG]]
anatofuz
parents:
diff changeset
109 ; SI: s_endpgm
anatofuz
parents:
diff changeset
110 define amdgpu_kernel void @s_movk_i32_k7(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
111 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
112 %or = or i64 %loada, 70368744185856; ((1 << 13)) | ((1 << 14) << 32)
anatofuz
parents:
diff changeset
113 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
114 call void asm sideeffect "; use $0", "s"(i64 70368744185856)
anatofuz
parents:
diff changeset
115 ret void
anatofuz
parents:
diff changeset
116 }
anatofuz
parents:
diff changeset
117
anatofuz
parents:
diff changeset
118 ; SI-LABEL: {{^}}s_movk_i32_k8:
anatofuz
parents:
diff changeset
119 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x8000{{$}}
anatofuz
parents:
diff changeset
120 ; SI-DAG: s_mov_b32 [[HI_S_IMM:s[0-9]+]], 0x11111111{{$}}
anatofuz
parents:
diff changeset
121 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
122 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
123 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[HI_S_IMM]], v[[HI_VREG]]
anatofuz
parents:
diff changeset
124 ; SI: s_endpgm
anatofuz
parents:
diff changeset
125 define amdgpu_kernel void @s_movk_i32_k8(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
126 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
127 %or = or i64 %loada, 1229782942255906816 ; 0x11111111ffff8000
anatofuz
parents:
diff changeset
128 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
129 call void asm sideeffect "; use $0", "s"(i64 1229782942255906816)
anatofuz
parents:
diff changeset
130 ret void
anatofuz
parents:
diff changeset
131 }
anatofuz
parents:
diff changeset
132
anatofuz
parents:
diff changeset
133 ; SI-LABEL: {{^}}s_movk_i32_k9:
anatofuz
parents:
diff changeset
134 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x8001{{$}}
anatofuz
parents:
diff changeset
135 ; SI-DAG: s_mov_b32 [[HI_S_IMM:s[0-9]+]], 0x11111111{{$}}
anatofuz
parents:
diff changeset
136 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
137 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
138 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[HI_S_IMM]], v[[HI_VREG]]
anatofuz
parents:
diff changeset
139 ; SI: s_endpgm
anatofuz
parents:
diff changeset
140 define amdgpu_kernel void @s_movk_i32_k9(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
141 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
142 %or = or i64 %loada, 1229782942255906817 ; 0x11111111ffff8001
anatofuz
parents:
diff changeset
143 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
144 call void asm sideeffect "; use $0", "s"(i64 1229782942255906817)
anatofuz
parents:
diff changeset
145 ret void
anatofuz
parents:
diff changeset
146 }
anatofuz
parents:
diff changeset
147
anatofuz
parents:
diff changeset
148 ; SI-LABEL: {{^}}s_movk_i32_k10:
anatofuz
parents:
diff changeset
149 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x8888{{$}}
anatofuz
parents:
diff changeset
150 ; SI-DAG: s_mov_b32 [[HI_S_IMM:s[0-9]+]], 0x11111111{{$}}
anatofuz
parents:
diff changeset
151 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
152 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
153 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[HI_S_IMM]], v[[HI_VREG]]
anatofuz
parents:
diff changeset
154 ; SI: s_endpgm
anatofuz
parents:
diff changeset
155 define amdgpu_kernel void @s_movk_i32_k10(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
156 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
157 %or = or i64 %loada, 1229782942255909000 ; 0x11111111ffff8888
anatofuz
parents:
diff changeset
158 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
159 call void asm sideeffect "; use $0", "s"(i64 1229782942255909000)
anatofuz
parents:
diff changeset
160 ret void
anatofuz
parents:
diff changeset
161 }
anatofuz
parents:
diff changeset
162
anatofuz
parents:
diff changeset
163 ; SI-LABEL: {{^}}s_movk_i32_k11:
anatofuz
parents:
diff changeset
164 ; SI-DAG: s_movk_i32 [[LO_S_IMM:s[0-9]+]], 0x8fff{{$}}
anatofuz
parents:
diff changeset
165 ; SI-DAG: s_mov_b32 [[HI_S_IMM:s[0-9]+]], 0x11111111{{$}}
anatofuz
parents:
diff changeset
166 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
167 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
168 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[HI_S_IMM]], v[[HI_VREG]]
anatofuz
parents:
diff changeset
169 ; SI: s_endpgm
anatofuz
parents:
diff changeset
170 define amdgpu_kernel void @s_movk_i32_k11(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
171 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
172 %or = or i64 %loada, 1229782942255910911 ; 0x11111111ffff8fff
anatofuz
parents:
diff changeset
173 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
174 call void asm sideeffect "; use $0", "s"(i64 1229782942255910911)
anatofuz
parents:
diff changeset
175 ret void
anatofuz
parents:
diff changeset
176 }
anatofuz
parents:
diff changeset
177
anatofuz
parents:
diff changeset
178 ; SI-LABEL: {{^}}s_movk_i32_k12:
anatofuz
parents:
diff changeset
179 ; SI-DAG: s_mov_b32 [[LO_S_IMM:s[0-9]+]], 0xffff7001{{$}}
anatofuz
parents:
diff changeset
180 ; SI-DAG: s_mov_b32 [[HI_S_IMM:s[0-9]+]], 0x11111111{{$}}
anatofuz
parents:
diff changeset
181 ; SI-DAG: buffer_load_dwordx2 v{{\[}}[[LO_VREG:[0-9]+]]:[[HI_VREG:[0-9]+]]{{\]}},
anatofuz
parents:
diff changeset
182 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[LO_S_IMM]], v[[LO_VREG]]
anatofuz
parents:
diff changeset
183 ; SI-DAG: v_or_b32_e32 {{v[0-9]+}}, [[HI_S_IMM]], v[[HI_VREG]]
anatofuz
parents:
diff changeset
184 ; SI: s_endpgm
anatofuz
parents:
diff changeset
185 define amdgpu_kernel void @s_movk_i32_k12(i64 addrspace(1)* %out, i64 addrspace(1)* %a, i64 addrspace(1)* %b) {
anatofuz
parents:
diff changeset
186 %loada = load i64, i64 addrspace(1)* %a, align 4
anatofuz
parents:
diff changeset
187 %or = or i64 %loada, 1229782942255902721 ; 0x11111111ffff7001
anatofuz
parents:
diff changeset
188 store i64 %or, i64 addrspace(1)* %out
anatofuz
parents:
diff changeset
189 call void asm sideeffect "; use $0", "s"(i64 1229782942255902721)
anatofuz
parents:
diff changeset
190 ret void
anatofuz
parents:
diff changeset
191 }