1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=verde -verify-machineinstrs -show-mc-encoding < %s | FileCheck -check-prefixes=GFX6 %s
3 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs -show-mc-encoding < %s | FileCheck -check-prefixes=GFX789 %s
4 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -show-mc-encoding < %s | FileCheck -check-prefixes=GFX789 %s
5 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs -show-mc-encoding < %s | FileCheck -check-prefixes=GFX10 %s
6 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs -show-mc-encoding < %s | FileCheck -check-prefixes=GFX11 %s
8 ; FIXME: This test has a DAG duplicate
11 ; (mode register ID = 1) | (Offset << 6) | ((Width - 1) << 11)
12 ; Offset: fp_round = 0, fp_denorm = 4, dx10_clamp = 8, ieee_mode = 9
15 ; Set FP32 fp_round to round to zero
16 define amdgpu_kernel void @test_setreg_f32_round_mode_rtz() {
17 ; GFX6-LABEL: test_setreg_f32_round_mode_rtz:
19 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 2), 3 ; encoding: [0x01,0x08,0x80,0xba,0x03,0x00,0x00,0x00]
20 ; GFX6-NEXT: ;;#ASMSTART
21 ; GFX6-NEXT: ;;#ASMEND
22 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
24 ; GFX789-LABEL: test_setreg_f32_round_mode_rtz:
26 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 2), 3 ; encoding: [0x01,0x08,0x00,0xba,0x03,0x00,0x00,0x00]
27 ; GFX789-NEXT: ;;#ASMSTART
28 ; GFX789-NEXT: ;;#ASMEND
29 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
31 ; GFX10-LABEL: test_setreg_f32_round_mode_rtz:
33 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 2), 3 ; encoding: [0x01,0x08,0x80,0xba,0x03,0x00,0x00,0x00]
34 ; GFX10-NEXT: ;;#ASMSTART
35 ; GFX10-NEXT: ;;#ASMEND
36 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
38 ; GFX11-LABEL: test_setreg_f32_round_mode_rtz:
40 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 2), 3 ; encoding: [0x01,0x08,0x80,0xb9,0x03,0x00,0x00,0x00]
41 ; GFX11-NEXT: ;;#ASMSTART
42 ; GFX11-NEXT: ;;#ASMEND
43 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
44 call void @llvm.amdgcn.s.setreg(i32 2049, i32 3)
45 call void asm sideeffect "", ""()
49 ; Set FP64/FP16 fp_round to round to zero
50 define amdgpu_kernel void @test_setreg_f64_round_mode_rtz() {
51 ; GFX6-LABEL: test_setreg_f64_round_mode_rtz:
53 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 3 ; encoding: [0x81,0x08,0x80,0xba,0x03,0x00,0x00,0x00]
54 ; GFX6-NEXT: ;;#ASMSTART
55 ; GFX6-NEXT: ;;#ASMEND
56 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
58 ; GFX789-LABEL: test_setreg_f64_round_mode_rtz:
60 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 3 ; encoding: [0x81,0x08,0x00,0xba,0x03,0x00,0x00,0x00]
61 ; GFX789-NEXT: ;;#ASMSTART
62 ; GFX789-NEXT: ;;#ASMEND
63 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
65 ; GFX10-LABEL: test_setreg_f64_round_mode_rtz:
67 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 3 ; encoding: [0x81,0x08,0x80,0xba,0x03,0x00,0x00,0x00]
68 ; GFX10-NEXT: ;;#ASMSTART
69 ; GFX10-NEXT: ;;#ASMEND
70 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
72 ; GFX11-LABEL: test_setreg_f64_round_mode_rtz:
74 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 3 ; encoding: [0x81,0x08,0x80,0xb9,0x03,0x00,0x00,0x00]
75 ; GFX11-NEXT: ;;#ASMSTART
76 ; GFX11-NEXT: ;;#ASMEND
77 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
78 call void @llvm.amdgcn.s.setreg(i32 2177, i32 3)
79 call void asm sideeffect "", ""()
83 ; Set all fp_round to round to zero
84 define amdgpu_kernel void @test_setreg_all_round_mode_rtz() {
85 ; GFX6-LABEL: test_setreg_all_round_mode_rtz:
87 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 7 ; encoding: [0x81,0x18,0x80,0xba,0x07,0x00,0x00,0x00]
88 ; GFX6-NEXT: ;;#ASMSTART
89 ; GFX6-NEXT: ;;#ASMEND
90 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
92 ; GFX789-LABEL: test_setreg_all_round_mode_rtz:
94 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 7 ; encoding: [0x81,0x18,0x00,0xba,0x07,0x00,0x00,0x00]
95 ; GFX789-NEXT: ;;#ASMSTART
96 ; GFX789-NEXT: ;;#ASMEND
97 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
99 ; GFX10-LABEL: test_setreg_all_round_mode_rtz:
101 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 7 ; encoding: [0x81,0x18,0x80,0xba,0x07,0x00,0x00,0x00]
102 ; GFX10-NEXT: ;;#ASMSTART
103 ; GFX10-NEXT: ;;#ASMEND
104 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
106 ; GFX11-LABEL: test_setreg_all_round_mode_rtz:
108 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 7 ; encoding: [0x81,0x18,0x80,0xb9,0x07,0x00,0x00,0x00]
109 ; GFX11-NEXT: ;;#ASMSTART
110 ; GFX11-NEXT: ;;#ASMEND
111 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
112 call void @llvm.amdgcn.s.setreg(i32 6273, i32 7)
113 call void asm sideeffect "", ""()
117 ; Set FP32 fp_round to dynamic mode
118 define amdgpu_cs void @test_setreg_roundingmode_var(i32 inreg %var.mode) {
119 ; GFX6-LABEL: test_setreg_roundingmode_var:
121 ; GFX6-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 2), s0 ; encoding: [0x01,0x08,0x80,0xb9]
122 ; GFX6-NEXT: ;;#ASMSTART
123 ; GFX6-NEXT: ;;#ASMEND
124 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
126 ; GFX789-LABEL: test_setreg_roundingmode_var:
128 ; GFX789-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 2), s0 ; encoding: [0x01,0x08,0x00,0xb9]
129 ; GFX789-NEXT: ;;#ASMSTART
130 ; GFX789-NEXT: ;;#ASMEND
131 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
133 ; GFX10-LABEL: test_setreg_roundingmode_var:
135 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 2), s0 ; encoding: [0x01,0x08,0x80,0xb9]
136 ; GFX10-NEXT: ;;#ASMSTART
137 ; GFX10-NEXT: ;;#ASMEND
138 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
140 ; GFX11-LABEL: test_setreg_roundingmode_var:
142 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 2), s0 ; encoding: [0x01,0x08,0x00,0xb9]
143 ; GFX11-NEXT: ;;#ASMSTART
144 ; GFX11-NEXT: ;;#ASMEND
145 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
146 call void @llvm.amdgcn.s.setreg(i32 2049, i32 %var.mode)
147 call void asm sideeffect "", ""()
151 define amdgpu_kernel void @test_setreg_ieee_mode_off() {
152 ; GFX6-LABEL: test_setreg_ieee_mode_off:
154 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 0 ; encoding: [0x41,0x02,0x80,0xba,0x00,0x00,0x00,0x00]
155 ; GFX6-NEXT: ;;#ASMSTART
156 ; GFX6-NEXT: ;;#ASMEND
157 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
159 ; GFX789-LABEL: test_setreg_ieee_mode_off:
161 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 0 ; encoding: [0x41,0x02,0x00,0xba,0x00,0x00,0x00,0x00]
162 ; GFX789-NEXT: ;;#ASMSTART
163 ; GFX789-NEXT: ;;#ASMEND
164 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
166 ; GFX10-LABEL: test_setreg_ieee_mode_off:
168 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 0 ; encoding: [0x41,0x02,0x80,0xba,0x00,0x00,0x00,0x00]
169 ; GFX10-NEXT: ;;#ASMSTART
170 ; GFX10-NEXT: ;;#ASMEND
171 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
173 ; GFX11-LABEL: test_setreg_ieee_mode_off:
175 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 0 ; encoding: [0x41,0x02,0x80,0xb9,0x00,0x00,0x00,0x00]
176 ; GFX11-NEXT: ;;#ASMSTART
177 ; GFX11-NEXT: ;;#ASMEND
178 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
179 call void @llvm.amdgcn.s.setreg(i32 577, i32 0)
180 call void asm sideeffect "", ""()
184 define amdgpu_kernel void @test_setreg_ieee_mode_on() {
185 ; GFX6-LABEL: test_setreg_ieee_mode_on:
187 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 1 ; encoding: [0x41,0x02,0x80,0xba,0x01,0x00,0x00,0x00]
188 ; GFX6-NEXT: ;;#ASMSTART
189 ; GFX6-NEXT: ;;#ASMEND
190 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
192 ; GFX789-LABEL: test_setreg_ieee_mode_on:
194 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 1 ; encoding: [0x41,0x02,0x00,0xba,0x01,0x00,0x00,0x00]
195 ; GFX789-NEXT: ;;#ASMSTART
196 ; GFX789-NEXT: ;;#ASMEND
197 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
199 ; GFX10-LABEL: test_setreg_ieee_mode_on:
201 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 1 ; encoding: [0x41,0x02,0x80,0xba,0x01,0x00,0x00,0x00]
202 ; GFX10-NEXT: ;;#ASMSTART
203 ; GFX10-NEXT: ;;#ASMEND
204 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
206 ; GFX11-LABEL: test_setreg_ieee_mode_on:
208 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 9, 1), 1 ; encoding: [0x41,0x02,0x80,0xb9,0x01,0x00,0x00,0x00]
209 ; GFX11-NEXT: ;;#ASMSTART
210 ; GFX11-NEXT: ;;#ASMEND
211 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
212 call void @llvm.amdgcn.s.setreg(i32 577, i32 1)
213 call void asm sideeffect "", ""()
217 define amdgpu_kernel void @test_setreg_dx10_clamp_off() {
218 ; GFX6-LABEL: test_setreg_dx10_clamp_off:
220 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 0 ; encoding: [0x01,0x02,0x80,0xba,0x00,0x00,0x00,0x00]
221 ; GFX6-NEXT: ;;#ASMSTART
222 ; GFX6-NEXT: ;;#ASMEND
223 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
225 ; GFX789-LABEL: test_setreg_dx10_clamp_off:
227 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 0 ; encoding: [0x01,0x02,0x00,0xba,0x00,0x00,0x00,0x00]
228 ; GFX789-NEXT: ;;#ASMSTART
229 ; GFX789-NEXT: ;;#ASMEND
230 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
232 ; GFX10-LABEL: test_setreg_dx10_clamp_off:
234 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 0 ; encoding: [0x01,0x02,0x80,0xba,0x00,0x00,0x00,0x00]
235 ; GFX10-NEXT: ;;#ASMSTART
236 ; GFX10-NEXT: ;;#ASMEND
237 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
239 ; GFX11-LABEL: test_setreg_dx10_clamp_off:
241 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 0 ; encoding: [0x01,0x02,0x80,0xb9,0x00,0x00,0x00,0x00]
242 ; GFX11-NEXT: ;;#ASMSTART
243 ; GFX11-NEXT: ;;#ASMEND
244 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
245 call void @llvm.amdgcn.s.setreg(i32 513, i32 0)
246 call void asm sideeffect "", ""()
250 define amdgpu_kernel void @test_setreg_dx10_clamp_on() {
251 ; GFX6-LABEL: test_setreg_dx10_clamp_on:
253 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 1 ; encoding: [0x01,0x02,0x80,0xba,0x01,0x00,0x00,0x00]
254 ; GFX6-NEXT: ;;#ASMSTART
255 ; GFX6-NEXT: ;;#ASMEND
256 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
258 ; GFX789-LABEL: test_setreg_dx10_clamp_on:
260 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 1 ; encoding: [0x01,0x02,0x00,0xba,0x01,0x00,0x00,0x00]
261 ; GFX789-NEXT: ;;#ASMSTART
262 ; GFX789-NEXT: ;;#ASMEND
263 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
265 ; GFX10-LABEL: test_setreg_dx10_clamp_on:
267 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 1 ; encoding: [0x01,0x02,0x80,0xba,0x01,0x00,0x00,0x00]
268 ; GFX10-NEXT: ;;#ASMSTART
269 ; GFX10-NEXT: ;;#ASMEND
270 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
272 ; GFX11-LABEL: test_setreg_dx10_clamp_on:
274 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 8, 1), 1 ; encoding: [0x01,0x02,0x80,0xb9,0x01,0x00,0x00,0x00]
275 ; GFX11-NEXT: ;;#ASMSTART
276 ; GFX11-NEXT: ;;#ASMEND
277 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
278 call void @llvm.amdgcn.s.setreg(i32 513, i32 1)
279 call void asm sideeffect "", ""()
283 ; Sets full width of fp round and fp denorm fields, to a variable
284 define amdgpu_cs void @test_setreg_full_both_round_mode_and_denorm_mode(i32 inreg %mode) {
285 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode:
287 ; GFX6-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 8), s0 ; encoding: [0x01,0x38,0x80,0xb9]
288 ; GFX6-NEXT: ;;#ASMSTART
289 ; GFX6-NEXT: ;;#ASMEND
290 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
292 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode:
294 ; GFX789-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 8), s0 ; encoding: [0x01,0x38,0x00,0xb9]
295 ; GFX789-NEXT: ;;#ASMSTART
296 ; GFX789-NEXT: ;;#ASMEND
297 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
299 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode:
301 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 8), s0 ; encoding: [0x01,0x38,0x80,0xb9]
302 ; GFX10-NEXT: ;;#ASMSTART
303 ; GFX10-NEXT: ;;#ASMEND
304 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
306 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode:
308 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 8), s0 ; encoding: [0x01,0x38,0x00,0xb9]
309 ; GFX11-NEXT: ;;#ASMSTART
310 ; GFX11-NEXT: ;;#ASMEND
311 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
312 call void @llvm.amdgcn.s.setreg(i32 14337, i32 inreg %mode)
313 call void asm sideeffect "", ""()
317 ; Does not cover last bit of denorm field
318 define amdgpu_cs void @test_setreg_most_both_round_mode_and_denorm_mode() {
319 ; GFX6-LABEL: test_setreg_most_both_round_mode_and_denorm_mode:
321 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 7), 6 ; encoding: [0x01,0x30,0x80,0xba,0x06,0x00,0x00,0x00]
322 ; GFX6-NEXT: ;;#ASMSTART
323 ; GFX6-NEXT: ;;#ASMEND
324 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
326 ; GFX789-LABEL: test_setreg_most_both_round_mode_and_denorm_mode:
328 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 7), 6 ; encoding: [0x01,0x30,0x00,0xba,0x06,0x00,0x00,0x00]
329 ; GFX789-NEXT: ;;#ASMSTART
330 ; GFX789-NEXT: ;;#ASMEND
331 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
333 ; GFX10-LABEL: test_setreg_most_both_round_mode_and_denorm_mode:
335 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 7), 6 ; encoding: [0x01,0x30,0x80,0xba,0x06,0x00,0x00,0x00]
336 ; GFX10-NEXT: ;;#ASMSTART
337 ; GFX10-NEXT: ;;#ASMEND
338 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
340 ; GFX11-LABEL: test_setreg_most_both_round_mode_and_denorm_mode:
342 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 7), 6 ; encoding: [0x01,0x30,0x80,0xb9,0x06,0x00,0x00,0x00]
343 ; GFX11-NEXT: ;;#ASMSTART
344 ; GFX11-NEXT: ;;#ASMEND
345 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
346 call void @llvm.amdgcn.s.setreg(i32 12289, i32 6)
347 call void asm sideeffect "", ""()
351 ; Does not cover first bit of denorm field
352 define amdgpu_cs void @test_setreg_most_both_round_mode_and_denorm_mode_6() {
353 ; GFX6-LABEL: test_setreg_most_both_round_mode_and_denorm_mode_6:
355 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 1, 3), 6 ; encoding: [0x41,0x10,0x80,0xba,0x06,0x00,0x00,0x00]
356 ; GFX6-NEXT: ;;#ASMSTART
357 ; GFX6-NEXT: ;;#ASMEND
358 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
360 ; GFX789-LABEL: test_setreg_most_both_round_mode_and_denorm_mode_6:
362 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 1, 3), 6 ; encoding: [0x41,0x10,0x00,0xba,0x06,0x00,0x00,0x00]
363 ; GFX789-NEXT: ;;#ASMSTART
364 ; GFX789-NEXT: ;;#ASMEND
365 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
367 ; GFX10-LABEL: test_setreg_most_both_round_mode_and_denorm_mode_6:
369 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 1, 3), 6 ; encoding: [0x41,0x10,0x80,0xba,0x06,0x00,0x00,0x00]
370 ; GFX10-NEXT: ;;#ASMSTART
371 ; GFX10-NEXT: ;;#ASMEND
372 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
374 ; GFX11-LABEL: test_setreg_most_both_round_mode_and_denorm_mode_6:
376 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 1, 3), 6 ; encoding: [0x41,0x10,0x80,0xb9,0x06,0x00,0x00,0x00]
377 ; GFX11-NEXT: ;;#ASMSTART
378 ; GFX11-NEXT: ;;#ASMEND
379 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
380 call void @llvm.amdgcn.s.setreg(i32 4161, i32 6)
381 call void asm sideeffect "", ""()
385 define amdgpu_cs void @test_setreg_f32_denorm_mode(i32 inreg %val) {
386 ; GFX6-LABEL: test_setreg_f32_denorm_mode:
388 ; GFX6-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0 ; encoding: [0x01,0x09,0x80,0xb9]
389 ; GFX6-NEXT: ;;#ASMSTART
390 ; GFX6-NEXT: ;;#ASMEND
391 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
393 ; GFX789-LABEL: test_setreg_f32_denorm_mode:
395 ; GFX789-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0 ; encoding: [0x01,0x09,0x00,0xb9]
396 ; GFX789-NEXT: ;;#ASMSTART
397 ; GFX789-NEXT: ;;#ASMEND
398 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
400 ; GFX10-LABEL: test_setreg_f32_denorm_mode:
402 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0 ; encoding: [0x01,0x09,0x80,0xb9]
403 ; GFX10-NEXT: ;;#ASMSTART
404 ; GFX10-NEXT: ;;#ASMEND
405 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
407 ; GFX11-LABEL: test_setreg_f32_denorm_mode:
409 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 4, 2), s0 ; encoding: [0x01,0x09,0x00,0xb9]
410 ; GFX11-NEXT: ;;#ASMSTART
411 ; GFX11-NEXT: ;;#ASMEND
412 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
413 call void @llvm.amdgcn.s.setreg(i32 2305, i32 %val)
414 call void asm sideeffect "", ""()
418 define amdgpu_cs void @test_setreg_f64_denorm_mode(i32 inreg %val) {
419 ; GFX6-LABEL: test_setreg_f64_denorm_mode:
421 ; GFX6-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 6, 2), s0 ; encoding: [0x81,0x09,0x80,0xb9]
422 ; GFX6-NEXT: ;;#ASMSTART
423 ; GFX6-NEXT: ;;#ASMEND
424 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
426 ; GFX789-LABEL: test_setreg_f64_denorm_mode:
428 ; GFX789-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 6, 2), s0 ; encoding: [0x81,0x09,0x00,0xb9]
429 ; GFX789-NEXT: ;;#ASMSTART
430 ; GFX789-NEXT: ;;#ASMEND
431 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
433 ; GFX10-LABEL: test_setreg_f64_denorm_mode:
435 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 6, 2), s0 ; encoding: [0x81,0x09,0x80,0xb9]
436 ; GFX10-NEXT: ;;#ASMSTART
437 ; GFX10-NEXT: ;;#ASMEND
438 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
440 ; GFX11-LABEL: test_setreg_f64_denorm_mode:
442 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 6, 2), s0 ; encoding: [0x81,0x09,0x00,0xb9]
443 ; GFX11-NEXT: ;;#ASMSTART
444 ; GFX11-NEXT: ;;#ASMEND
445 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
446 call void @llvm.amdgcn.s.setreg(i32 2433, i32 %val)
447 call void asm sideeffect "", ""()
451 define amdgpu_cs void @test_setreg_full_denorm_mode(i32 inreg %val) {
452 ; GFX6-LABEL: test_setreg_full_denorm_mode:
454 ; GFX6-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 4), s0 ; encoding: [0x01,0x18,0x80,0xb9]
455 ; GFX6-NEXT: ;;#ASMSTART
456 ; GFX6-NEXT: ;;#ASMEND
457 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
459 ; GFX789-LABEL: test_setreg_full_denorm_mode:
461 ; GFX789-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 4), s0 ; encoding: [0x01,0x18,0x00,0xb9]
462 ; GFX789-NEXT: ;;#ASMSTART
463 ; GFX789-NEXT: ;;#ASMEND
464 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
466 ; GFX10-LABEL: test_setreg_full_denorm_mode:
468 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 4), s0 ; encoding: [0x01,0x18,0x80,0xb9]
469 ; GFX10-NEXT: ;;#ASMSTART
470 ; GFX10-NEXT: ;;#ASMEND
471 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
473 ; GFX11-LABEL: test_setreg_full_denorm_mode:
475 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 4), s0 ; encoding: [0x01,0x18,0x00,0xb9]
476 ; GFX11-NEXT: ;;#ASMSTART
477 ; GFX11-NEXT: ;;#ASMEND
478 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
479 call void @llvm.amdgcn.s.setreg(i32 6145, i32 %val)
480 call void asm sideeffect "", ""()
484 define amdgpu_kernel void @test_setreg_full_round_mode_0() {
485 ; GFX6-LABEL: test_setreg_full_round_mode_0:
487 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 0 ; encoding: [0x01,0x18,0x80,0xba,0x00,0x00,0x00,0x00]
488 ; GFX6-NEXT: ;;#ASMSTART
489 ; GFX6-NEXT: ;;#ASMEND
490 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
492 ; GFX789-LABEL: test_setreg_full_round_mode_0:
494 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 0 ; encoding: [0x01,0x18,0x00,0xba,0x00,0x00,0x00,0x00]
495 ; GFX789-NEXT: ;;#ASMSTART
496 ; GFX789-NEXT: ;;#ASMEND
497 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
499 ; GFX10-LABEL: test_setreg_full_round_mode_0:
501 ; GFX10-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0xa4,0xbf]
502 ; GFX10-NEXT: ;;#ASMSTART
503 ; GFX10-NEXT: ;;#ASMEND
504 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
506 ; GFX11-LABEL: test_setreg_full_round_mode_0:
508 ; GFX11-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0x91,0xbf]
509 ; GFX11-NEXT: ;;#ASMSTART
510 ; GFX11-NEXT: ;;#ASMEND
511 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
512 call void @llvm.amdgcn.s.setreg(i32 6145, i32 0)
513 call void asm sideeffect "", ""()
517 define amdgpu_kernel void @test_setreg_full_round_mode_1() {
518 ; GFX6-LABEL: test_setreg_full_round_mode_1:
520 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 1 ; encoding: [0x01,0x18,0x80,0xba,0x01,0x00,0x00,0x00]
521 ; GFX6-NEXT: ;;#ASMSTART
522 ; GFX6-NEXT: ;;#ASMEND
523 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
525 ; GFX789-LABEL: test_setreg_full_round_mode_1:
527 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 1 ; encoding: [0x01,0x18,0x00,0xba,0x01,0x00,0x00,0x00]
528 ; GFX789-NEXT: ;;#ASMSTART
529 ; GFX789-NEXT: ;;#ASMEND
530 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
532 ; GFX10-LABEL: test_setreg_full_round_mode_1:
534 ; GFX10-NEXT: s_round_mode 0x1 ; encoding: [0x01,0x00,0xa4,0xbf]
535 ; GFX10-NEXT: ;;#ASMSTART
536 ; GFX10-NEXT: ;;#ASMEND
537 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
539 ; GFX11-LABEL: test_setreg_full_round_mode_1:
541 ; GFX11-NEXT: s_round_mode 0x1 ; encoding: [0x01,0x00,0x91,0xbf]
542 ; GFX11-NEXT: ;;#ASMSTART
543 ; GFX11-NEXT: ;;#ASMEND
544 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
545 call void @llvm.amdgcn.s.setreg(i32 6145, i32 1)
546 call void asm sideeffect "", ""()
550 define amdgpu_kernel void @test_setreg_full_round_mode_2() {
551 ; GFX6-LABEL: test_setreg_full_round_mode_2:
553 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 2 ; encoding: [0x01,0x18,0x80,0xba,0x02,0x00,0x00,0x00]
554 ; GFX6-NEXT: ;;#ASMSTART
555 ; GFX6-NEXT: ;;#ASMEND
556 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
558 ; GFX789-LABEL: test_setreg_full_round_mode_2:
560 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 2 ; encoding: [0x01,0x18,0x00,0xba,0x02,0x00,0x00,0x00]
561 ; GFX789-NEXT: ;;#ASMSTART
562 ; GFX789-NEXT: ;;#ASMEND
563 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
565 ; GFX10-LABEL: test_setreg_full_round_mode_2:
567 ; GFX10-NEXT: s_round_mode 0x2 ; encoding: [0x02,0x00,0xa4,0xbf]
568 ; GFX10-NEXT: ;;#ASMSTART
569 ; GFX10-NEXT: ;;#ASMEND
570 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
572 ; GFX11-LABEL: test_setreg_full_round_mode_2:
574 ; GFX11-NEXT: s_round_mode 0x2 ; encoding: [0x02,0x00,0x91,0xbf]
575 ; GFX11-NEXT: ;;#ASMSTART
576 ; GFX11-NEXT: ;;#ASMEND
577 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
578 call void @llvm.amdgcn.s.setreg(i32 6145, i32 2)
579 call void asm sideeffect "", ""()
583 define amdgpu_kernel void @test_setreg_full_round_mode_4() {
584 ; GFX6-LABEL: test_setreg_full_round_mode_4:
586 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 4 ; encoding: [0x01,0x18,0x80,0xba,0x04,0x00,0x00,0x00]
587 ; GFX6-NEXT: ;;#ASMSTART
588 ; GFX6-NEXT: ;;#ASMEND
589 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
591 ; GFX789-LABEL: test_setreg_full_round_mode_4:
593 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 4 ; encoding: [0x01,0x18,0x00,0xba,0x04,0x00,0x00,0x00]
594 ; GFX789-NEXT: ;;#ASMSTART
595 ; GFX789-NEXT: ;;#ASMEND
596 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
598 ; GFX10-LABEL: test_setreg_full_round_mode_4:
600 ; GFX10-NEXT: s_round_mode 0x4 ; encoding: [0x04,0x00,0xa4,0xbf]
601 ; GFX10-NEXT: ;;#ASMSTART
602 ; GFX10-NEXT: ;;#ASMEND
603 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
605 ; GFX11-LABEL: test_setreg_full_round_mode_4:
607 ; GFX11-NEXT: s_round_mode 0x4 ; encoding: [0x04,0x00,0x91,0xbf]
608 ; GFX11-NEXT: ;;#ASMSTART
609 ; GFX11-NEXT: ;;#ASMEND
610 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
611 call void @llvm.amdgcn.s.setreg(i32 6145, i32 4)
612 call void asm sideeffect "", ""()
616 define amdgpu_kernel void @test_setreg_full_round_mode_8() {
617 ; GFX6-LABEL: test_setreg_full_round_mode_8:
619 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 8 ; encoding: [0x01,0x18,0x80,0xba,0x08,0x00,0x00,0x00]
620 ; GFX6-NEXT: ;;#ASMSTART
621 ; GFX6-NEXT: ;;#ASMEND
622 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
624 ; GFX789-LABEL: test_setreg_full_round_mode_8:
626 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 8 ; encoding: [0x01,0x18,0x00,0xba,0x08,0x00,0x00,0x00]
627 ; GFX789-NEXT: ;;#ASMSTART
628 ; GFX789-NEXT: ;;#ASMEND
629 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
631 ; GFX10-LABEL: test_setreg_full_round_mode_8:
633 ; GFX10-NEXT: s_round_mode 0x8 ; encoding: [0x08,0x00,0xa4,0xbf]
634 ; GFX10-NEXT: ;;#ASMSTART
635 ; GFX10-NEXT: ;;#ASMEND
636 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
638 ; GFX11-LABEL: test_setreg_full_round_mode_8:
640 ; GFX11-NEXT: s_round_mode 0x8 ; encoding: [0x08,0x00,0x91,0xbf]
641 ; GFX11-NEXT: ;;#ASMSTART
642 ; GFX11-NEXT: ;;#ASMEND
643 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
644 call void @llvm.amdgcn.s.setreg(i32 6145, i32 8)
645 call void asm sideeffect "", ""()
649 define amdgpu_kernel void @test_setreg_full_round_mode_15() {
650 ; GFX6-LABEL: test_setreg_full_round_mode_15:
652 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 15 ; encoding: [0x01,0x18,0x80,0xba,0x0f,0x00,0x00,0x00]
653 ; GFX6-NEXT: ;;#ASMSTART
654 ; GFX6-NEXT: ;;#ASMEND
655 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
657 ; GFX789-LABEL: test_setreg_full_round_mode_15:
659 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 15 ; encoding: [0x01,0x18,0x00,0xba,0x0f,0x00,0x00,0x00]
660 ; GFX789-NEXT: ;;#ASMSTART
661 ; GFX789-NEXT: ;;#ASMEND
662 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
664 ; GFX10-LABEL: test_setreg_full_round_mode_15:
666 ; GFX10-NEXT: s_round_mode 0xf ; encoding: [0x0f,0x00,0xa4,0xbf]
667 ; GFX10-NEXT: ;;#ASMSTART
668 ; GFX10-NEXT: ;;#ASMEND
669 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
671 ; GFX11-LABEL: test_setreg_full_round_mode_15:
673 ; GFX11-NEXT: s_round_mode 0xf ; encoding: [0x0f,0x00,0x91,0xbf]
674 ; GFX11-NEXT: ;;#ASMSTART
675 ; GFX11-NEXT: ;;#ASMEND
676 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
677 call void @llvm.amdgcn.s.setreg(i32 6145, i32 15)
678 call void asm sideeffect "", ""()
682 ; Should truncate set immediate value
683 define amdgpu_kernel void @test_setreg_full_round_mode_42() {
684 ; GFX6-LABEL: test_setreg_full_round_mode_42:
686 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 42 ; encoding: [0x01,0x18,0x80,0xba,0x2a,0x00,0x00,0x00]
687 ; GFX6-NEXT: ;;#ASMSTART
688 ; GFX6-NEXT: ;;#ASMEND
689 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
691 ; GFX789-LABEL: test_setreg_full_round_mode_42:
693 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 4), 42 ; encoding: [0x01,0x18,0x00,0xba,0x2a,0x00,0x00,0x00]
694 ; GFX789-NEXT: ;;#ASMSTART
695 ; GFX789-NEXT: ;;#ASMEND
696 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
698 ; GFX10-LABEL: test_setreg_full_round_mode_42:
700 ; GFX10-NEXT: s_round_mode 0xa ; encoding: [0x0a,0x00,0xa4,0xbf]
701 ; GFX10-NEXT: ;;#ASMSTART
702 ; GFX10-NEXT: ;;#ASMEND
703 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
705 ; GFX11-LABEL: test_setreg_full_round_mode_42:
707 ; GFX11-NEXT: s_round_mode 0xa ; encoding: [0x0a,0x00,0x91,0xbf]
708 ; GFX11-NEXT: ;;#ASMSTART
709 ; GFX11-NEXT: ;;#ASMEND
710 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
711 call void @llvm.amdgcn.s.setreg(i32 6145, i32 42)
712 call void asm sideeffect "", ""()
716 define amdgpu_kernel void @test_setreg_full_denorm_mode_0() {
717 ; GFX6-LABEL: test_setreg_full_denorm_mode_0:
719 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 0 ; encoding: [0x01,0x19,0x80,0xba,0x00,0x00,0x00,0x00]
720 ; GFX6-NEXT: ;;#ASMSTART
721 ; GFX6-NEXT: ;;#ASMEND
722 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
724 ; GFX789-LABEL: test_setreg_full_denorm_mode_0:
726 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 0 ; encoding: [0x01,0x19,0x00,0xba,0x00,0x00,0x00,0x00]
727 ; GFX789-NEXT: ;;#ASMSTART
728 ; GFX789-NEXT: ;;#ASMEND
729 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
731 ; GFX10-LABEL: test_setreg_full_denorm_mode_0:
733 ; GFX10-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf]
734 ; GFX10-NEXT: ;;#ASMSTART
735 ; GFX10-NEXT: ;;#ASMEND
736 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
738 ; GFX11-LABEL: test_setreg_full_denorm_mode_0:
740 ; GFX11-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
741 ; GFX11-NEXT: ;;#ASMSTART
742 ; GFX11-NEXT: ;;#ASMEND
743 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
744 call void @llvm.amdgcn.s.setreg(i32 6401, i32 0)
745 call void asm sideeffect "", ""()
749 define amdgpu_kernel void @test_setreg_full_denorm_mode_1() {
750 ; GFX6-LABEL: test_setreg_full_denorm_mode_1:
752 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 1 ; encoding: [0x01,0x19,0x80,0xba,0x01,0x00,0x00,0x00]
753 ; GFX6-NEXT: ;;#ASMSTART
754 ; GFX6-NEXT: ;;#ASMEND
755 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
757 ; GFX789-LABEL: test_setreg_full_denorm_mode_1:
759 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 1 ; encoding: [0x01,0x19,0x00,0xba,0x01,0x00,0x00,0x00]
760 ; GFX789-NEXT: ;;#ASMSTART
761 ; GFX789-NEXT: ;;#ASMEND
762 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
764 ; GFX10-LABEL: test_setreg_full_denorm_mode_1:
766 ; GFX10-NEXT: s_denorm_mode 1 ; encoding: [0x01,0x00,0xa5,0xbf]
767 ; GFX10-NEXT: ;;#ASMSTART
768 ; GFX10-NEXT: ;;#ASMEND
769 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
771 ; GFX11-LABEL: test_setreg_full_denorm_mode_1:
773 ; GFX11-NEXT: s_denorm_mode 1 ; encoding: [0x01,0x00,0x92,0xbf]
774 ; GFX11-NEXT: ;;#ASMSTART
775 ; GFX11-NEXT: ;;#ASMEND
776 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
777 call void @llvm.amdgcn.s.setreg(i32 6401, i32 1)
778 call void asm sideeffect "", ""()
783 define amdgpu_kernel void @test_setreg_full_denorm_mode_2() {
784 ; GFX6-LABEL: test_setreg_full_denorm_mode_2:
786 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 2 ; encoding: [0x01,0x19,0x80,0xba,0x02,0x00,0x00,0x00]
787 ; GFX6-NEXT: ;;#ASMSTART
788 ; GFX6-NEXT: ;;#ASMEND
789 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
791 ; GFX789-LABEL: test_setreg_full_denorm_mode_2:
793 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 2 ; encoding: [0x01,0x19,0x00,0xba,0x02,0x00,0x00,0x00]
794 ; GFX789-NEXT: ;;#ASMSTART
795 ; GFX789-NEXT: ;;#ASMEND
796 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
798 ; GFX10-LABEL: test_setreg_full_denorm_mode_2:
800 ; GFX10-NEXT: s_denorm_mode 2 ; encoding: [0x02,0x00,0xa5,0xbf]
801 ; GFX10-NEXT: ;;#ASMSTART
802 ; GFX10-NEXT: ;;#ASMEND
803 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
805 ; GFX11-LABEL: test_setreg_full_denorm_mode_2:
807 ; GFX11-NEXT: s_denorm_mode 2 ; encoding: [0x02,0x00,0x92,0xbf]
808 ; GFX11-NEXT: ;;#ASMSTART
809 ; GFX11-NEXT: ;;#ASMEND
810 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
811 call void @llvm.amdgcn.s.setreg(i32 6401, i32 2)
812 call void asm sideeffect "", ""()
816 define amdgpu_kernel void @test_setreg_full_denorm_mode_4() {
817 ; GFX6-LABEL: test_setreg_full_denorm_mode_4:
819 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 4 ; encoding: [0x01,0x19,0x80,0xba,0x04,0x00,0x00,0x00]
820 ; GFX6-NEXT: ;;#ASMSTART
821 ; GFX6-NEXT: ;;#ASMEND
822 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
824 ; GFX789-LABEL: test_setreg_full_denorm_mode_4:
826 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 4 ; encoding: [0x01,0x19,0x00,0xba,0x04,0x00,0x00,0x00]
827 ; GFX789-NEXT: ;;#ASMSTART
828 ; GFX789-NEXT: ;;#ASMEND
829 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
831 ; GFX10-LABEL: test_setreg_full_denorm_mode_4:
833 ; GFX10-NEXT: s_denorm_mode 4 ; encoding: [0x04,0x00,0xa5,0xbf]
834 ; GFX10-NEXT: ;;#ASMSTART
835 ; GFX10-NEXT: ;;#ASMEND
836 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
838 ; GFX11-LABEL: test_setreg_full_denorm_mode_4:
840 ; GFX11-NEXT: s_denorm_mode 4 ; encoding: [0x04,0x00,0x92,0xbf]
841 ; GFX11-NEXT: ;;#ASMSTART
842 ; GFX11-NEXT: ;;#ASMEND
843 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
844 call void @llvm.amdgcn.s.setreg(i32 6401, i32 4)
845 call void asm sideeffect "", ""()
849 define amdgpu_kernel void @test_setreg_full_denorm_mode_8() {
850 ; GFX6-LABEL: test_setreg_full_denorm_mode_8:
852 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 8 ; encoding: [0x01,0x19,0x80,0xba,0x08,0x00,0x00,0x00]
853 ; GFX6-NEXT: ;;#ASMSTART
854 ; GFX6-NEXT: ;;#ASMEND
855 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
857 ; GFX789-LABEL: test_setreg_full_denorm_mode_8:
859 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 8 ; encoding: [0x01,0x19,0x00,0xba,0x08,0x00,0x00,0x00]
860 ; GFX789-NEXT: ;;#ASMSTART
861 ; GFX789-NEXT: ;;#ASMEND
862 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
864 ; GFX10-LABEL: test_setreg_full_denorm_mode_8:
866 ; GFX10-NEXT: s_denorm_mode 8 ; encoding: [0x08,0x00,0xa5,0xbf]
867 ; GFX10-NEXT: ;;#ASMSTART
868 ; GFX10-NEXT: ;;#ASMEND
869 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
871 ; GFX11-LABEL: test_setreg_full_denorm_mode_8:
873 ; GFX11-NEXT: s_denorm_mode 8 ; encoding: [0x08,0x00,0x92,0xbf]
874 ; GFX11-NEXT: ;;#ASMSTART
875 ; GFX11-NEXT: ;;#ASMEND
876 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
877 call void @llvm.amdgcn.s.setreg(i32 6401, i32 8)
878 call void asm sideeffect "", ""()
882 define amdgpu_kernel void @test_setreg_full_denorm_mode_15() {
883 ; GFX6-LABEL: test_setreg_full_denorm_mode_15:
885 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 15 ; encoding: [0x01,0x19,0x80,0xba,0x0f,0x00,0x00,0x00]
886 ; GFX6-NEXT: ;;#ASMSTART
887 ; GFX6-NEXT: ;;#ASMEND
888 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
890 ; GFX789-LABEL: test_setreg_full_denorm_mode_15:
892 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 15 ; encoding: [0x01,0x19,0x00,0xba,0x0f,0x00,0x00,0x00]
893 ; GFX789-NEXT: ;;#ASMSTART
894 ; GFX789-NEXT: ;;#ASMEND
895 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
897 ; GFX10-LABEL: test_setreg_full_denorm_mode_15:
899 ; GFX10-NEXT: s_denorm_mode 15 ; encoding: [0x0f,0x00,0xa5,0xbf]
900 ; GFX10-NEXT: ;;#ASMSTART
901 ; GFX10-NEXT: ;;#ASMEND
902 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
904 ; GFX11-LABEL: test_setreg_full_denorm_mode_15:
906 ; GFX11-NEXT: s_denorm_mode 15 ; encoding: [0x0f,0x00,0x92,0xbf]
907 ; GFX11-NEXT: ;;#ASMSTART
908 ; GFX11-NEXT: ;;#ASMEND
909 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
910 call void @llvm.amdgcn.s.setreg(i32 6401, i32 15)
911 call void asm sideeffect "", ""()
915 define amdgpu_kernel void @test_setreg_full_denorm_mode_42() {
916 ; GFX6-LABEL: test_setreg_full_denorm_mode_42:
918 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 42 ; encoding: [0x01,0x19,0x80,0xba,0x2a,0x00,0x00,0x00]
919 ; GFX6-NEXT: ;;#ASMSTART
920 ; GFX6-NEXT: ;;#ASMEND
921 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
923 ; GFX789-LABEL: test_setreg_full_denorm_mode_42:
925 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 4, 4), 42 ; encoding: [0x01,0x19,0x00,0xba,0x2a,0x00,0x00,0x00]
926 ; GFX789-NEXT: ;;#ASMSTART
927 ; GFX789-NEXT: ;;#ASMEND
928 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
930 ; GFX10-LABEL: test_setreg_full_denorm_mode_42:
932 ; GFX10-NEXT: s_denorm_mode 10 ; encoding: [0x0a,0x00,0xa5,0xbf]
933 ; GFX10-NEXT: ;;#ASMSTART
934 ; GFX10-NEXT: ;;#ASMEND
935 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
937 ; GFX11-LABEL: test_setreg_full_denorm_mode_42:
939 ; GFX11-NEXT: s_denorm_mode 10 ; encoding: [0x0a,0x00,0x92,0xbf]
940 ; GFX11-NEXT: ;;#ASMSTART
941 ; GFX11-NEXT: ;;#ASMEND
942 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
943 call void @llvm.amdgcn.s.setreg(i32 6401, i32 42)
944 call void asm sideeffect "", ""()
948 ; Sets all fp round and fp denorm bits.
949 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_0() {
950 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_0:
952 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0 ; encoding: [0x01,0x38,0x80,0xba,0x00,0x00,0x00,0x00]
953 ; GFX6-NEXT: ;;#ASMSTART
954 ; GFX6-NEXT: ;;#ASMEND
955 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
957 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_0:
959 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0 ; encoding: [0x01,0x38,0x00,0xba,0x00,0x00,0x00,0x00]
960 ; GFX789-NEXT: ;;#ASMSTART
961 ; GFX789-NEXT: ;;#ASMEND
962 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
964 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_0:
966 ; GFX10-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0xa4,0xbf]
967 ; GFX10-NEXT: ;;#ASMSTART
968 ; GFX10-NEXT: ;;#ASMEND
969 ; GFX10-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf]
970 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
972 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_0:
974 ; GFX11-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0x91,0xbf]
975 ; GFX11-NEXT: ;;#ASMSTART
976 ; GFX11-NEXT: ;;#ASMEND
977 ; GFX11-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
978 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
979 call void @llvm.amdgcn.s.setreg(i32 14337, i32 0)
980 call void asm sideeffect "", ""()
984 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_1() {
985 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_1:
987 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 1 ; encoding: [0x01,0x38,0x80,0xba,0x01,0x00,0x00,0x00]
988 ; GFX6-NEXT: ;;#ASMSTART
989 ; GFX6-NEXT: ;;#ASMEND
990 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
992 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_1:
994 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 1 ; encoding: [0x01,0x38,0x00,0xba,0x01,0x00,0x00,0x00]
995 ; GFX789-NEXT: ;;#ASMSTART
996 ; GFX789-NEXT: ;;#ASMEND
997 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
999 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_1:
1001 ; GFX10-NEXT: s_round_mode 0x1 ; encoding: [0x01,0x00,0xa4,0xbf]
1002 ; GFX10-NEXT: ;;#ASMSTART
1003 ; GFX10-NEXT: ;;#ASMEND
1004 ; GFX10-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf]
1005 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1007 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_1:
1009 ; GFX11-NEXT: s_round_mode 0x1 ; encoding: [0x01,0x00,0x91,0xbf]
1010 ; GFX11-NEXT: ;;#ASMSTART
1011 ; GFX11-NEXT: ;;#ASMEND
1012 ; GFX11-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
1013 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1014 call void @llvm.amdgcn.s.setreg(i32 14337, i32 1)
1015 call void asm sideeffect "", ""()
1019 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_2() {
1020 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_2:
1022 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 2 ; encoding: [0x01,0x38,0x80,0xba,0x02,0x00,0x00,0x00]
1023 ; GFX6-NEXT: ;;#ASMSTART
1024 ; GFX6-NEXT: ;;#ASMEND
1025 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1027 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_2:
1029 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 2 ; encoding: [0x01,0x38,0x00,0xba,0x02,0x00,0x00,0x00]
1030 ; GFX789-NEXT: ;;#ASMSTART
1031 ; GFX789-NEXT: ;;#ASMEND
1032 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1034 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_2:
1036 ; GFX10-NEXT: s_round_mode 0x2 ; encoding: [0x02,0x00,0xa4,0xbf]
1037 ; GFX10-NEXT: ;;#ASMSTART
1038 ; GFX10-NEXT: ;;#ASMEND
1039 ; GFX10-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf]
1040 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1042 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_2:
1044 ; GFX11-NEXT: s_round_mode 0x2 ; encoding: [0x02,0x00,0x91,0xbf]
1045 ; GFX11-NEXT: ;;#ASMSTART
1046 ; GFX11-NEXT: ;;#ASMEND
1047 ; GFX11-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
1048 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1049 call void @llvm.amdgcn.s.setreg(i32 14337, i32 2)
1050 call void asm sideeffect "", ""()
1054 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_4() {
1055 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_4:
1057 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 4 ; encoding: [0x01,0x38,0x80,0xba,0x04,0x00,0x00,0x00]
1058 ; GFX6-NEXT: ;;#ASMSTART
1059 ; GFX6-NEXT: ;;#ASMEND
1060 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1062 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_4:
1064 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 4 ; encoding: [0x01,0x38,0x00,0xba,0x04,0x00,0x00,0x00]
1065 ; GFX789-NEXT: ;;#ASMSTART
1066 ; GFX789-NEXT: ;;#ASMEND
1067 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1069 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_4:
1071 ; GFX10-NEXT: s_round_mode 0x4 ; encoding: [0x04,0x00,0xa4,0xbf]
1072 ; GFX10-NEXT: ;;#ASMSTART
1073 ; GFX10-NEXT: ;;#ASMEND
1074 ; GFX10-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf]
1075 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1077 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_4:
1079 ; GFX11-NEXT: s_round_mode 0x4 ; encoding: [0x04,0x00,0x91,0xbf]
1080 ; GFX11-NEXT: ;;#ASMSTART
1081 ; GFX11-NEXT: ;;#ASMEND
1082 ; GFX11-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
1083 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1084 call void @llvm.amdgcn.s.setreg(i32 14337, i32 4)
1085 call void asm sideeffect "", ""()
1089 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_8() {
1090 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_8:
1092 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 8 ; encoding: [0x01,0x38,0x80,0xba,0x08,0x00,0x00,0x00]
1093 ; GFX6-NEXT: ;;#ASMSTART
1094 ; GFX6-NEXT: ;;#ASMEND
1095 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1097 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_8:
1099 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 8 ; encoding: [0x01,0x38,0x00,0xba,0x08,0x00,0x00,0x00]
1100 ; GFX789-NEXT: ;;#ASMSTART
1101 ; GFX789-NEXT: ;;#ASMEND
1102 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1104 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_8:
1106 ; GFX10-NEXT: s_round_mode 0x8 ; encoding: [0x08,0x00,0xa4,0xbf]
1107 ; GFX10-NEXT: ;;#ASMSTART
1108 ; GFX10-NEXT: ;;#ASMEND
1109 ; GFX10-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf]
1110 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1112 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_8:
1114 ; GFX11-NEXT: s_round_mode 0x8 ; encoding: [0x08,0x00,0x91,0xbf]
1115 ; GFX11-NEXT: ;;#ASMSTART
1116 ; GFX11-NEXT: ;;#ASMEND
1117 ; GFX11-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
1118 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1119 call void @llvm.amdgcn.s.setreg(i32 14337, i32 8)
1120 call void asm sideeffect "", ""()
1124 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_16() {
1125 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_16:
1127 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 16 ; encoding: [0x01,0x38,0x80,0xba,0x10,0x00,0x00,0x00]
1128 ; GFX6-NEXT: ;;#ASMSTART
1129 ; GFX6-NEXT: ;;#ASMEND
1130 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1132 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_16:
1134 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 16 ; encoding: [0x01,0x38,0x00,0xba,0x10,0x00,0x00,0x00]
1135 ; GFX789-NEXT: ;;#ASMSTART
1136 ; GFX789-NEXT: ;;#ASMEND
1137 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1139 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_16:
1141 ; GFX10-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0xa4,0xbf]
1142 ; GFX10-NEXT: ;;#ASMSTART
1143 ; GFX10-NEXT: ;;#ASMEND
1144 ; GFX10-NEXT: s_denorm_mode 1 ; encoding: [0x01,0x00,0xa5,0xbf]
1145 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1147 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_16:
1149 ; GFX11-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0x91,0xbf]
1150 ; GFX11-NEXT: ;;#ASMSTART
1151 ; GFX11-NEXT: ;;#ASMEND
1152 ; GFX11-NEXT: s_denorm_mode 1 ; encoding: [0x01,0x00,0x92,0xbf]
1153 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1154 call void @llvm.amdgcn.s.setreg(i32 14337, i32 16)
1155 call void asm sideeffect "", ""()
1159 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_32() {
1160 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_32:
1162 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 32 ; encoding: [0x01,0x38,0x80,0xba,0x20,0x00,0x00,0x00]
1163 ; GFX6-NEXT: ;;#ASMSTART
1164 ; GFX6-NEXT: ;;#ASMEND
1165 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1167 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_32:
1169 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 32 ; encoding: [0x01,0x38,0x00,0xba,0x20,0x00,0x00,0x00]
1170 ; GFX789-NEXT: ;;#ASMSTART
1171 ; GFX789-NEXT: ;;#ASMEND
1172 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1174 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_32:
1176 ; GFX10-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0xa4,0xbf]
1177 ; GFX10-NEXT: ;;#ASMSTART
1178 ; GFX10-NEXT: ;;#ASMEND
1179 ; GFX10-NEXT: s_denorm_mode 2 ; encoding: [0x02,0x00,0xa5,0xbf]
1180 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1182 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_32:
1184 ; GFX11-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0x91,0xbf]
1185 ; GFX11-NEXT: ;;#ASMSTART
1186 ; GFX11-NEXT: ;;#ASMEND
1187 ; GFX11-NEXT: s_denorm_mode 2 ; encoding: [0x02,0x00,0x92,0xbf]
1188 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1189 call void @llvm.amdgcn.s.setreg(i32 14337, i32 32)
1190 call void asm sideeffect "", ""()
1194 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_64() {
1195 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_64:
1197 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 64 ; encoding: [0x01,0x38,0x80,0xba,0x40,0x00,0x00,0x00]
1198 ; GFX6-NEXT: ;;#ASMSTART
1199 ; GFX6-NEXT: ;;#ASMEND
1200 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1202 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_64:
1204 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 64 ; encoding: [0x01,0x38,0x00,0xba,0x40,0x00,0x00,0x00]
1205 ; GFX789-NEXT: ;;#ASMSTART
1206 ; GFX789-NEXT: ;;#ASMEND
1207 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1209 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_64:
1211 ; GFX10-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0xa4,0xbf]
1212 ; GFX10-NEXT: ;;#ASMSTART
1213 ; GFX10-NEXT: ;;#ASMEND
1214 ; GFX10-NEXT: s_denorm_mode 4 ; encoding: [0x04,0x00,0xa5,0xbf]
1215 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1217 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_64:
1219 ; GFX11-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0x91,0xbf]
1220 ; GFX11-NEXT: ;;#ASMSTART
1221 ; GFX11-NEXT: ;;#ASMEND
1222 ; GFX11-NEXT: s_denorm_mode 4 ; encoding: [0x04,0x00,0x92,0xbf]
1223 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1224 call void @llvm.amdgcn.s.setreg(i32 14337, i32 64)
1225 call void asm sideeffect "", ""()
1229 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_128() {
1230 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_128:
1232 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0x80 ; encoding: [0x01,0x38,0x80,0xba,0x80,0x00,0x00,0x00]
1233 ; GFX6-NEXT: ;;#ASMSTART
1234 ; GFX6-NEXT: ;;#ASMEND
1235 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1237 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_128:
1239 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0x80 ; encoding: [0x01,0x38,0x00,0xba,0x80,0x00,0x00,0x00]
1240 ; GFX789-NEXT: ;;#ASMSTART
1241 ; GFX789-NEXT: ;;#ASMEND
1242 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1244 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_128:
1246 ; GFX10-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0xa4,0xbf]
1247 ; GFX10-NEXT: ;;#ASMSTART
1248 ; GFX10-NEXT: ;;#ASMEND
1249 ; GFX10-NEXT: s_denorm_mode 8 ; encoding: [0x08,0x00,0xa5,0xbf]
1250 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1252 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_128:
1254 ; GFX11-NEXT: s_round_mode 0x0 ; encoding: [0x00,0x00,0x91,0xbf]
1255 ; GFX11-NEXT: ;;#ASMSTART
1256 ; GFX11-NEXT: ;;#ASMEND
1257 ; GFX11-NEXT: s_denorm_mode 8 ; encoding: [0x08,0x00,0x92,0xbf]
1258 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1259 call void @llvm.amdgcn.s.setreg(i32 14337, i32 128)
1260 call void asm sideeffect "", ""()
1264 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_15() {
1265 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_15:
1267 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 15 ; encoding: [0x01,0x38,0x80,0xba,0x0f,0x00,0x00,0x00]
1268 ; GFX6-NEXT: ;;#ASMSTART
1269 ; GFX6-NEXT: ;;#ASMEND
1270 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1272 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_15:
1274 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 15 ; encoding: [0x01,0x38,0x00,0xba,0x0f,0x00,0x00,0x00]
1275 ; GFX789-NEXT: ;;#ASMSTART
1276 ; GFX789-NEXT: ;;#ASMEND
1277 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1279 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_15:
1281 ; GFX10-NEXT: s_round_mode 0xf ; encoding: [0x0f,0x00,0xa4,0xbf]
1282 ; GFX10-NEXT: ;;#ASMSTART
1283 ; GFX10-NEXT: ;;#ASMEND
1284 ; GFX10-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0xa5,0xbf]
1285 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1287 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_15:
1289 ; GFX11-NEXT: s_round_mode 0xf ; encoding: [0x0f,0x00,0x91,0xbf]
1290 ; GFX11-NEXT: ;;#ASMSTART
1291 ; GFX11-NEXT: ;;#ASMEND
1292 ; GFX11-NEXT: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
1293 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1294 call void @llvm.amdgcn.s.setreg(i32 14337, i32 15)
1295 call void asm sideeffect "", ""()
1299 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_255() {
1300 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_255:
1302 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0xff ; encoding: [0x01,0x38,0x80,0xba,0xff,0x00,0x00,0x00]
1303 ; GFX6-NEXT: ;;#ASMSTART
1304 ; GFX6-NEXT: ;;#ASMEND
1305 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1307 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_255:
1309 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0xff ; encoding: [0x01,0x38,0x00,0xba,0xff,0x00,0x00,0x00]
1310 ; GFX789-NEXT: ;;#ASMSTART
1311 ; GFX789-NEXT: ;;#ASMEND
1312 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1314 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_255:
1316 ; GFX10-NEXT: s_round_mode 0xf ; encoding: [0x0f,0x00,0xa4,0xbf]
1317 ; GFX10-NEXT: ;;#ASMSTART
1318 ; GFX10-NEXT: ;;#ASMEND
1319 ; GFX10-NEXT: s_denorm_mode 15 ; encoding: [0x0f,0x00,0xa5,0xbf]
1320 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1322 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_255:
1324 ; GFX11-NEXT: s_round_mode 0xf ; encoding: [0x0f,0x00,0x91,0xbf]
1325 ; GFX11-NEXT: ;;#ASMSTART
1326 ; GFX11-NEXT: ;;#ASMEND
1327 ; GFX11-NEXT: s_denorm_mode 15 ; encoding: [0x0f,0x00,0x92,0xbf]
1328 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1329 call void @llvm.amdgcn.s.setreg(i32 14337, i32 255)
1330 call void asm sideeffect "", ""()
1334 ; Truncate extra high bit
1335 define amdgpu_kernel void @test_setreg_full_both_round_mode_and_denorm_mode_597() {
1336 ; GFX6-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_597:
1338 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0x255 ; encoding: [0x01,0x38,0x80,0xba,0x55,0x02,0x00,0x00]
1339 ; GFX6-NEXT: ;;#ASMSTART
1340 ; GFX6-NEXT: ;;#ASMEND
1341 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1343 ; GFX789-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_597:
1345 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 0, 8), 0x255 ; encoding: [0x01,0x38,0x00,0xba,0x55,0x02,0x00,0x00]
1346 ; GFX789-NEXT: ;;#ASMSTART
1347 ; GFX789-NEXT: ;;#ASMEND
1348 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1350 ; GFX10-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_597:
1352 ; GFX10-NEXT: s_round_mode 0x5 ; encoding: [0x05,0x00,0xa4,0xbf]
1353 ; GFX10-NEXT: ;;#ASMSTART
1354 ; GFX10-NEXT: ;;#ASMEND
1355 ; GFX10-NEXT: s_denorm_mode 5 ; encoding: [0x05,0x00,0xa5,0xbf]
1356 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1358 ; GFX11-LABEL: test_setreg_full_both_round_mode_and_denorm_mode_597:
1360 ; GFX11-NEXT: s_round_mode 0x5 ; encoding: [0x05,0x00,0x91,0xbf]
1361 ; GFX11-NEXT: ;;#ASMSTART
1362 ; GFX11-NEXT: ;;#ASMEND
1363 ; GFX11-NEXT: s_denorm_mode 5 ; encoding: [0x05,0x00,0x92,0xbf]
1364 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1365 call void @llvm.amdgcn.s.setreg(i32 14337, i32 597)
1366 call void asm sideeffect "", ""()
1370 define amdgpu_kernel void @test_setreg_set_8_bits_straddles_round_and_denorm() {
1371 ; GFX6-LABEL: test_setreg_set_8_bits_straddles_round_and_denorm:
1373 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 8), 0xff ; encoding: [0x81,0x38,0x80,0xba,0xff,0x00,0x00,0x00]
1374 ; GFX6-NEXT: ;;#ASMSTART
1375 ; GFX6-NEXT: ;;#ASMEND
1376 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1378 ; GFX789-LABEL: test_setreg_set_8_bits_straddles_round_and_denorm:
1380 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 8), 0xff ; encoding: [0x81,0x38,0x00,0xba,0xff,0x00,0x00,0x00]
1381 ; GFX789-NEXT: ;;#ASMSTART
1382 ; GFX789-NEXT: ;;#ASMEND
1383 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1385 ; GFX10-LABEL: test_setreg_set_8_bits_straddles_round_and_denorm:
1387 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 8), 0xff ; encoding: [0x81,0x38,0x80,0xba,0xff,0x00,0x00,0x00]
1388 ; GFX10-NEXT: ;;#ASMSTART
1389 ; GFX10-NEXT: ;;#ASMEND
1390 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1392 ; GFX11-LABEL: test_setreg_set_8_bits_straddles_round_and_denorm:
1394 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 8), 0xff ; encoding: [0x81,0x38,0x80,0xb9,0xff,0x00,0x00,0x00]
1395 ; GFX11-NEXT: ;;#ASMSTART
1396 ; GFX11-NEXT: ;;#ASMEND
1397 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1398 call void @llvm.amdgcn.s.setreg(i32 14465, i32 255)
1399 call void asm sideeffect "", ""()
1403 define amdgpu_kernel void @test_setreg_set_4_bits_straddles_round_and_denorm() {
1404 ; GFX6-LABEL: test_setreg_set_4_bits_straddles_round_and_denorm:
1406 ; GFX6-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 15 ; encoding: [0x81,0x18,0x80,0xba,0x0f,0x00,0x00,0x00]
1407 ; GFX6-NEXT: ;;#ASMSTART
1408 ; GFX6-NEXT: ;;#ASMEND
1409 ; GFX6-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1411 ; GFX789-LABEL: test_setreg_set_4_bits_straddles_round_and_denorm:
1413 ; GFX789-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 15 ; encoding: [0x81,0x18,0x00,0xba,0x0f,0x00,0x00,0x00]
1414 ; GFX789-NEXT: ;;#ASMSTART
1415 ; GFX789-NEXT: ;;#ASMEND
1416 ; GFX789-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1418 ; GFX10-LABEL: test_setreg_set_4_bits_straddles_round_and_denorm:
1420 ; GFX10-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 15 ; encoding: [0x81,0x18,0x80,0xba,0x0f,0x00,0x00,0x00]
1421 ; GFX10-NEXT: ;;#ASMSTART
1422 ; GFX10-NEXT: ;;#ASMEND
1423 ; GFX10-NEXT: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
1425 ; GFX11-LABEL: test_setreg_set_4_bits_straddles_round_and_denorm:
1427 ; GFX11-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 4), 15 ; encoding: [0x81,0x18,0x80,0xb9,0x0f,0x00,0x00,0x00]
1428 ; GFX11-NEXT: ;;#ASMSTART
1429 ; GFX11-NEXT: ;;#ASMEND
1430 ; GFX11-NEXT: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
1431 call void @llvm.amdgcn.s.setreg(i32 6273, i32 15)
1432 call void asm sideeffect "", ""()
1436 ; FIXME: Broken for DAG
1437 define void @test_setreg_roundingmode_var_vgpr(i32 %var.mode) {
1438 ; GFX6-LABEL: test_setreg_roundingmode_var_vgpr:
1440 ; GFX6-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
1441 ; GFX6-NEXT: v_readfirstlane_b32 s4, v0 ; encoding: [0x00,0x05,0x08,0x7e]
1442 ; GFX6-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 3), s4 ; encoding: [0x01,0x10,0x84,0xb9]
1443 ; GFX6-NEXT: ;;#ASMSTART
1444 ; GFX6-NEXT: ;;#ASMEND
1445 ; GFX6-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
1447 ; GFX789-LABEL: test_setreg_roundingmode_var_vgpr:
1449 ; GFX789-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
1450 ; GFX789-NEXT: v_readfirstlane_b32 s4, v0 ; encoding: [0x00,0x05,0x08,0x7e]
1451 ; GFX789-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 3), s4 ; encoding: [0x01,0x10,0x04,0xb9]
1452 ; GFX789-NEXT: ;;#ASMSTART
1453 ; GFX789-NEXT: ;;#ASMEND
1454 ; GFX789-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
1456 ; GFX10-LABEL: test_setreg_roundingmode_var_vgpr:
1458 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
1459 ; GFX10-NEXT: v_readfirstlane_b32 s4, v0 ; encoding: [0x00,0x05,0x08,0x7e]
1460 ; GFX10-NEXT: ;;#ASMSTART
1461 ; GFX10-NEXT: ;;#ASMEND
1462 ; GFX10-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 3), s4 ; encoding: [0x01,0x10,0x84,0xb9]
1463 ; GFX10-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
1465 ; GFX11-LABEL: test_setreg_roundingmode_var_vgpr:
1467 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
1468 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0 ; encoding: [0x00,0x05,0x00,0x7e]
1469 ; GFX11-NEXT: ;;#ASMSTART
1470 ; GFX11-NEXT: ;;#ASMEND
1471 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) ; encoding: [0x01,0x00,0x87,0xbf]
1472 ; GFX11-NEXT: s_setreg_b32 hwreg(HW_REG_MODE, 0, 3), s0 ; encoding: [0x01,0x10,0x00,0xb9]
1473 ; GFX11-NEXT: s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
1474 call void @llvm.amdgcn.s.setreg(i32 4097, i32 %var.mode)
1475 call void asm sideeffect "", ""()
1479 declare void @llvm.amdgcn.s.setreg(i32 immarg, i32) #0
1481 attributes #0 = { nounwind }