[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / code-size-estimate.ll
blob22823c8b6b0a8d5edeab90c91400003174452ff6
1 ; RUN: llc -march=amdgcn -mcpu=gfx900 -show-mc-encoding < %s | FileCheck -check-prefixes=CHECK,GFX9 %s
2 ; RUN: llc -march=amdgcn -mcpu=gfx1030 -show-mc-encoding < %s | FileCheck -check-prefixes=CHECK,GFX10 %s
3 ; RUN: llc -march=amdgcn -mcpu=gfx1100 -show-mc-encoding < %s | FileCheck -check-prefixes=CHECK,GFX11,GFX1100 %s
4 ; RUN: llc -march=amdgcn -mcpu=gfx1150 -show-mc-encoding < %s | FileCheck -check-prefixes=CHECK,GFX11,GFX1150 %s
6 declare float @llvm.fabs.f32(float)
7 declare float @llvm.fma.f32(float, float, float)
9 define float @v_mul_f32_vop2(float %x, float %y) {
10 ; GFX9-LABEL: v_mul_f32_vop2:
11 ; GFX9:       ; %bb.0:
12 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
13 ; GFX9-NEXT:    v_mul_f32_e32 v0, v0, v1 ; encoding: [0x00,0x03,0x00,0x0a]
14 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
16 ; GFX10-LABEL: v_mul_f32_vop2:
17 ; GFX10:       ; %bb.0:
18 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
19 ; GFX10-NEXT:    v_mul_f32_e32 v0, v0, v1 ; encoding: [0x00,0x03,0x00,0x10]
20 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
22 ; GFX11-LABEL: v_mul_f32_vop2:
23 ; GFX11:       ; %bb.0:
24 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
25 ; GFX11-NEXT:    v_mul_f32_e32 v0, v0, v1 ; encoding: [0x00,0x03,0x00,0x10]
26 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
27   %mul = fmul float %x, %y
28   ret float %mul
30 ; CHECK: codeLenInByte = 12
32 define float @v_mul_f32_vop2_inline_imm(float %x) {
33 ; GFX9-LABEL: v_mul_f32_vop2_inline_imm:
34 ; GFX9:       ; %bb.0:
35 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
36 ; GFX9-NEXT:    v_mul_f32_e32 v0, 4.0, v0 ; encoding: [0xf6,0x00,0x00,0x0a]
37 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
39 ; GFX10-LABEL: v_mul_f32_vop2_inline_imm:
40 ; GFX10:       ; %bb.0:
41 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
42 ; GFX10-NEXT:    v_mul_f32_e32 v0, 4.0, v0 ; encoding: [0xf6,0x00,0x00,0x10]
43 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
45 ; GFX11-LABEL: v_mul_f32_vop2_inline_imm:
46 ; GFX11:       ; %bb.0:
47 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
48 ; GFX11-NEXT:    v_mul_f32_e32 v0, 4.0, v0 ; encoding: [0xf6,0x00,0x00,0x10]
49 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
50   %mul = fmul float %x, 4.0
51   ret float %mul
53 ; CHECK: codeLenInByte = 12
55 define float @v_mul_f32_vop2_literal(float %x) {
56 ; GFX9-LABEL: v_mul_f32_vop2_literal:
57 ; GFX9:       ; %bb.0:
58 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
59 ; GFX9-NEXT:    v_mul_f32_e32 v0, 0x42f60000, v0 ; encoding: [0xff,0x00,0x00,0x0a,0x00,0x00,0xf6,0x42]
60 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
62 ; GFX10-LABEL: v_mul_f32_vop2_literal:
63 ; GFX10:       ; %bb.0:
64 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
65 ; GFX10-NEXT:    v_mul_f32_e32 v0, 0x42f60000, v0 ; encoding: [0xff,0x00,0x00,0x10,0x00,0x00,0xf6,0x42]
66 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
68 ; GFX11-LABEL: v_mul_f32_vop2_literal:
69 ; GFX11:       ; %bb.0:
70 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
71 ; GFX11-NEXT:    v_mul_f32_e32 v0, 0x42f60000, v0 ; encoding: [0xff,0x00,0x00,0x10,0x00,0x00,0xf6,0x42]
72 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
73   %mul = fmul float %x, 123.0
74   ret float %mul
76 ; CHECK: codeLenInByte = 16
78 define float @v_mul_f32_vop3_src_mods(float %x, float %y) {
79 ; GFX9-LABEL: v_mul_f32_vop3_src_mods:
80 ; GFX9:       ; %bb.0:
81 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
82 ; GFX9-NEXT:    v_mul_f32_e64 v0, |v0|, v1 ; encoding: [0x00,0x01,0x05,0xd1,0x00,0x03,0x02,0x00]
83 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
85 ; GFX10-LABEL: v_mul_f32_vop3_src_mods:
86 ; GFX10:       ; %bb.0:
87 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
88 ; GFX10-NEXT:    v_mul_f32_e64 v0, |v0|, v1 ; encoding: [0x00,0x01,0x08,0xd5,0x00,0x03,0x02,0x00]
89 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
91 ; GFX11-LABEL: v_mul_f32_vop3_src_mods:
92 ; GFX11:       ; %bb.0:
93 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
94 ; GFX11-NEXT:    v_mul_f32_e64 v0, |v0|, v1 ; encoding: [0x00,0x01,0x08,0xd5,0x00,0x03,0x02,0x00]
95 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
96   %fabs.x = call float @llvm.fabs.f32(float %x)
97   %mul = fmul float %fabs.x, %y
98   ret float %mul
100 ; CHECK: codeLenInByte = 16
102 define float @v_mul_f32_vop3_src_mods_inline_imm(float %x, float %y) {
103 ; GFX9-LABEL: v_mul_f32_vop3_src_mods_inline_imm:
104 ; GFX9:       ; %bb.0:
105 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
106 ; GFX9-NEXT:    v_mul_f32_e64 v0, |v0|, 4.0 ; encoding: [0x00,0x01,0x05,0xd1,0x00,0xed,0x01,0x00]
107 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
109 ; GFX10-LABEL: v_mul_f32_vop3_src_mods_inline_imm:
110 ; GFX10:       ; %bb.0:
111 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
112 ; GFX10-NEXT:    v_mul_f32_e64 v0, |v0|, 4.0 ; encoding: [0x00,0x01,0x08,0xd5,0x00,0xed,0x01,0x00]
113 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
115 ; GFX11-LABEL: v_mul_f32_vop3_src_mods_inline_imm:
116 ; GFX11:       ; %bb.0:
117 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
118 ; GFX11-NEXT:    v_mul_f32_e64 v0, |v0|, 4.0 ; encoding: [0x00,0x01,0x08,0xd5,0x00,0xed,0x01,0x00]
119 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
120   %fabs.x = call float @llvm.fabs.f32(float %x)
121   %mul = fmul float %fabs.x, 4.0
122   ret float %mul
125 ; CHECK: codeLenInByte = 16
127 define float @v_mul_f32_vop3_src_mods_literal(float %x, float %y) {
128 ; GFX9-LABEL: v_mul_f32_vop3_src_mods_literal:
129 ; GFX9:       ; %bb.0:
130 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
131 ; GFX9-NEXT:    s_mov_b32 s4, 0x42f60000 ; encoding: [0xff,0x00,0x84,0xbe,0x00,0x00,0xf6,0x42]
132 ; GFX9-NEXT:    v_mul_f32_e64 v0, |v0|, s4 ; encoding: [0x00,0x01,0x05,0xd1,0x00,0x09,0x00,0x00]
133 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
135 ; GFX10-LABEL: v_mul_f32_vop3_src_mods_literal:
136 ; GFX10:       ; %bb.0:
137 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
138 ; GFX10-NEXT:    v_mul_f32_e64 v0, 0x42f60000, |v0| ; encoding: [0x00,0x02,0x08,0xd5,0xff,0x00,0x02,0x00,0x00,0x00,0xf6,0x42]
139 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
141 ; GFX11-LABEL: v_mul_f32_vop3_src_mods_literal:
142 ; GFX11:       ; %bb.0:
143 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
144 ; GFX11-NEXT:    v_mul_f32_e64 v0, 0x42f60000, |v0| ; encoding: [0x00,0x02,0x08,0xd5,0xff,0x00,0x02,0x00,0x00,0x00,0xf6,0x42]
145 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
146   %fabs.x = call float @llvm.fabs.f32(float %x)
147   %mul = fmul float %fabs.x, 123.0
148   ret float %mul
151 ; GFX9: codeLenInByte = 24
152 ; GFX10: codeLenInByte = 20
153 ; GFX11: codeLenInByte = 20
155 define float @v_mul_f32_vop2_frame_index(float %x) {
156 ; GFX9-LABEL: v_mul_f32_vop2_frame_index:
157 ; GFX9:       ; %bb.0:
158 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
159 ; GFX9-NEXT:    v_lshrrev_b32_e64 v1, 6, s32 ; encoding: [0x01,0x00,0x10,0xd1,0x86,0x40,0x00,0x00]
160 ; GFX9-NEXT:    v_mul_f32_e32 v0, v1, v0 ; encoding: [0x01,0x01,0x00,0x0a]
161 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
163 ; GFX10-LABEL: v_mul_f32_vop2_frame_index:
164 ; GFX10:       ; %bb.0:
165 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
166 ; GFX10-NEXT:    v_lshrrev_b32_e64 v1, 5, s32 ; encoding: [0x01,0x00,0x16,0xd5,0x85,0x40,0x00,0x00]
167 ; GFX10-NEXT:    v_mul_f32_e32 v0, v1, v0 ; encoding: [0x01,0x01,0x00,0x10]
168 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
170 ; GFX11-LABEL: v_mul_f32_vop2_frame_index:
171 ; GFX11:       ; %bb.0:
172 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
173 ; GFX11-NEXT:    v_mul_f32_e32 v0, s32, v0 ; encoding: [0x20,0x00,0x00,0x10]
174 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
175   %alloca = alloca i32, addrspace(5)
176   %ptrtoint = ptrtoint ptr addrspace(5) %alloca to i32
177   %cast = bitcast i32 %ptrtoint to float
178   %mul = fmul float %x, %cast
179   ret float %mul
182 ; GFX9: codeLenInByte = 20
183 ; GFX10: codeLenInByte = 20
184 ; GFX11: codeLenInByte = 12
186 define float @v_fma_f32(float %x, float %y, float %z) {
187 ; GFX9-LABEL: v_fma_f32:
188 ; GFX9:       ; %bb.0:
189 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
190 ; GFX9-NEXT:    v_fma_f32 v0, v0, v1, v2 ; encoding: [0x00,0x00,0xcb,0xd1,0x00,0x03,0x0a,0x04]
191 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
193 ; GFX10-LABEL: v_fma_f32:
194 ; GFX10:       ; %bb.0:
195 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
196 ; GFX10-NEXT:    v_fma_f32 v0, v0, v1, v2 ; encoding: [0x00,0x00,0x4b,0xd5,0x00,0x03,0x0a,0x04]
197 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
199 ; GFX11-LABEL: v_fma_f32:
200 ; GFX11:       ; %bb.0:
201 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
202 ; GFX11-NEXT:    v_fma_f32 v0, v0, v1, v2 ; encoding: [0x00,0x00,0x13,0xd6,0x00,0x03,0x0a,0x04]
203 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
204   %fma = call float @llvm.fma.f32(float %x, float %y, float %z)
205   ret float %fma
208 ; CHECK: codeLenInByte = 16
210 define float @v_fma_f32_src_mods(float %x, float %y, float %z) {
211 ; GFX9-LABEL: v_fma_f32_src_mods:
212 ; GFX9:       ; %bb.0:
213 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
214 ; GFX9-NEXT:    v_fma_f32 v0, |v0|, v1, v2 ; encoding: [0x00,0x01,0xcb,0xd1,0x00,0x03,0x0a,0x04]
215 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
217 ; GFX10-LABEL: v_fma_f32_src_mods:
218 ; GFX10:       ; %bb.0:
219 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
220 ; GFX10-NEXT:    v_fma_f32 v0, |v0|, v1, v2 ; encoding: [0x00,0x01,0x4b,0xd5,0x00,0x03,0x0a,0x04]
221 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
223 ; GFX11-LABEL: v_fma_f32_src_mods:
224 ; GFX11:       ; %bb.0:
225 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
226 ; GFX11-NEXT:    v_fma_f32 v0, |v0|, v1, v2 ; encoding: [0x00,0x01,0x13,0xd6,0x00,0x03,0x0a,0x04]
227 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
228   %fabs.x = call float @llvm.fabs.f32(float %x)
229   %fma = call float @llvm.fma.f32(float %fabs.x, float %y, float %z)
230   ret float %fma
233 ; CHECK: codeLenInByte = 16
235 define float @v_fmac_f32(float %x, float %y) {
236 ; GFX9-LABEL: v_fmac_f32:
237 ; GFX9:       ; %bb.0:
238 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
239 ; GFX9-NEXT:    v_fma_f32 v0, v0, v1, v0 ; encoding: [0x00,0x00,0xcb,0xd1,0x00,0x03,0x02,0x04]
240 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
242 ; GFX10-LABEL: v_fmac_f32:
243 ; GFX10:       ; %bb.0:
244 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
245 ; GFX10-NEXT:    v_fmac_f32_e32 v0, v0, v1 ; encoding: [0x00,0x03,0x00,0x56]
246 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
248 ; GFX11-LABEL: v_fmac_f32:
249 ; GFX11:       ; %bb.0:
250 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
251 ; GFX11-NEXT:    v_fmac_f32_e32 v0, v0, v1 ; encoding: [0x00,0x03,0x00,0x56]
252 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
253   %fma = call float @llvm.fma.f32(float %x, float %y, float %x)
254   ret float %fma
257 ; GFX9: codeLenInByte = 16
258 ; GFX10: codeLenInByte = 12
259 ; GFX11: codeLenInByte = 12
261 define float @v_fmaak_f32(float %x, float %y) {
262 ; GFX9-LABEL: v_fmaak_f32:
263 ; GFX9:       ; %bb.0:
264 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
265 ; GFX9-NEXT:    s_mov_b32 s4, 0x43800000 ; encoding: [0xff,0x00,0x84,0xbe,0x00,0x00,0x80,0x43]
266 ; GFX9-NEXT:    v_fma_f32 v0, v0, v1, s4 ; encoding: [0x00,0x00,0xcb,0xd1,0x00,0x03,0x12,0x00]
267 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
269 ; GFX10-LABEL: v_fmaak_f32:
270 ; GFX10:       ; %bb.0:
271 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
272 ; GFX10-NEXT:    v_fmaak_f32 v0, v0, v1, 0x43800000 ; encoding: [0x00,0x03,0x00,0x5a,0x00,0x00,0x80,0x43]
273 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
275 ; GFX11-LABEL: v_fmaak_f32:
276 ; GFX11:       ; %bb.0:
277 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
278 ; GFX11-NEXT:    v_fmaak_f32 v0, v0, v1, 0x43800000 ; encoding: [0x00,0x03,0x00,0x5a,0x00,0x00,0x80,0x43]
279 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
280   %fma = call float @llvm.fma.f32(float %x, float %y, float 256.0)
281   ret float %fma
284 ; GFX9: codeLenInByte = 24
285 ; GFX10: codeLenInByte = 16
286 ; GFX11: codeLenInByte = 16
288 define float @v_fma_k_f32_src_mods(float %x, float %y) {
289 ; GFX9-LABEL: v_fma_k_f32_src_mods:
290 ; GFX9:       ; %bb.0:
291 ; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
292 ; GFX9-NEXT:    s_mov_b32 s4, 0x43800000 ; encoding: [0xff,0x00,0x84,0xbe,0x00,0x00,0x80,0x43]
293 ; GFX9-NEXT:    v_fma_f32 v0, |v0|, v1, s4 ; encoding: [0x00,0x01,0xcb,0xd1,0x00,0x03,0x12,0x00]
294 ; GFX9-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x1d,0x80,0xbe]
296 ; GFX10-LABEL: v_fma_k_f32_src_mods:
297 ; GFX10:       ; %bb.0:
298 ; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
299 ; GFX10-NEXT:    v_fma_f32 v0, |v0|, v1, 0x43800000 ; encoding: [0x00,0x01,0x4b,0xd5,0x00,0x03,0xfe,0x03,0x00,0x00,0x80,0x43]
300 ; GFX10-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x20,0x80,0xbe]
302 ; GFX11-LABEL: v_fma_k_f32_src_mods:
303 ; GFX11:       ; %bb.0:
304 ; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
305 ; GFX11-NEXT:    v_fma_f32 v0, |v0|, v1, 0x43800000 ; encoding: [0x00,0x01,0x13,0xd6,0x00,0x03,0xfe,0x03,0x00,0x00,0x80,0x43]
306 ; GFX11-NEXT:    s_setpc_b64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe]
307   %fabs.x = call float @llvm.fabs.f32(float %x)
308   %fma = call float @llvm.fma.f32(float %fabs.x, float %y, float 256.0)
309   ret float %fma
312 ; GFX9: codeLenInByte = 24
313 ; GFX10: codeLenInByte = 20
314 ; GFX11: codeLenInByte = 20
316 define amdgpu_ps float @s_fmaak_f32(float inreg %x, float inreg %y) {
317 ; GFX9-LABEL: s_fmaak_f32:
318 ; GFX9:       ; %bb.0:
319 ; GFX9-NEXT:    v_mov_b32_e32 v0, s1 ; encoding: [0x01,0x02,0x00,0x7e]
320 ; GFX9-NEXT:    v_mov_b32_e32 v1, 0x43800000 ; encoding: [0xff,0x02,0x02,0x7e,0x00,0x00,0x80,0x43]
321 ; GFX9-NEXT:    v_fma_f32 v0, s0, v0, v1 ; encoding: [0x00,0x00,0xcb,0xd1,0x00,0x00,0x06,0x04]
322 ; GFX9-NEXT:    ; return to shader part epilog
324 ; GFX10-LABEL: s_fmaak_f32:
325 ; GFX10:       ; %bb.0:
326 ; GFX10-NEXT:    v_mov_b32_e32 v0, 0x43800000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x00,0x80,0x43]
327 ; GFX10-NEXT:    v_fmac_f32_e64 v0, s0, s1 ; encoding: [0x00,0x00,0x2b,0xd5,0x00,0x02,0x00,0x00]
328 ; GFX10-NEXT:    ; return to shader part epilog
330 ; GFX1100-LABEL: s_fmaak_f32:
331 ; GFX1100:       ; %bb.0:
332 ; GFX1100-NEXT:    v_mov_b32_e32 v0, 0x43800000 ; encoding: [0xff,0x02,0x00,0x7e,0x00,0x00,0x80,0x43]
333 ; GFX1100-NEXT:    s_delay_alu instid0(VALU_DEP_1) ; encoding: [0x01,0x00,0x87,0xbf]
334 ; GFX1100-NEXT:    v_fmac_f32_e64 v0, s0, s1 ; encoding: [0x00,0x00,0x2b,0xd5,0x00,0x02,0x00,0x00]
335 ; GFX1100-NEXT:    ; return to shader part epilog
337 ; GFX1150-LABEL: s_fmaak_f32:
338 ; GFX1150:       ; %bb.0:
339 ; GFX1150-NEXT:    s_fmaak_f32 s0, s0, s1, 0x43800000 ; encoding: [0x00,0x01,0x80,0xa2,0x00,0x00,0x80,0x43]
340 ; GFX1150-NEXT:    s_delay_alu instid0(SALU_CYCLE_3) ; encoding: [0x0b,0x00,0x87,0xbf]
341 ; GFX1150-NEXT:    v_mov_b32_e32 v0, s0 ; encoding: [0x00,0x02,0x00,0x7e]
342 ; GFX1150-NEXT:    ; return to shader part epilog
343   %fma = call float @llvm.fma.f32(float %x, float %y, float 256.0)
344   ret float %fma
347 ; GFX9: codeLenInByte = 20
348 ; GFX10: codeLenInByte = 16
349 ; GFX1100: codeLenInByte = 20
350 ; GFX1150: codeLenInByte = 16