1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
3 ; RUN: < %s -mtriple=powerpc64le-unknown-linux -mcpu=pwr9 | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
5 ; RUN: < %s -mtriple=powerpc64le-unknown-linux -mcpu=pwr8 | FileCheck %s --check-prefix=CHECK-P8
7 declare fp128 @llvm.experimental.constrained.fadd.f128(fp128, fp128, metadata, metadata)
8 declare fp128 @llvm.experimental.constrained.fsub.f128(fp128, fp128, metadata, metadata)
9 declare fp128 @llvm.experimental.constrained.fmul.f128(fp128, fp128, metadata, metadata)
10 declare fp128 @llvm.experimental.constrained.fdiv.f128(fp128, fp128, metadata, metadata)
12 declare fp128 @llvm.experimental.constrained.fma.f128(fp128, fp128, fp128, metadata, metadata)
13 declare fp128 @llvm.experimental.constrained.sqrt.f128(fp128, metadata, metadata)
15 define fp128 @fadd_f128(fp128 %f1, fp128 %f2) #0 {
16 ; CHECK-LABEL: fadd_f128:
18 ; CHECK-NEXT: xsaddqp v2, v2, v3
21 ; CHECK-P8-LABEL: fadd_f128:
23 ; CHECK-P8-NEXT: mflr r0
24 ; CHECK-P8-NEXT: std r0, 16(r1)
25 ; CHECK-P8-NEXT: stdu r1, -32(r1)
26 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
27 ; CHECK-P8-NEXT: .cfi_offset lr, 16
28 ; CHECK-P8-NEXT: bl __addkf3
30 ; CHECK-P8-NEXT: addi r1, r1, 32
31 ; CHECK-P8-NEXT: ld r0, 16(r1)
32 ; CHECK-P8-NEXT: mtlr r0
34 %res = call fp128 @llvm.experimental.constrained.fadd.f128(
36 metadata !"round.dynamic",
37 metadata !"fpexcept.strict") #0
41 define fp128 @fsub_f128(fp128 %f1, fp128 %f2) #0 {
42 ; CHECK-LABEL: fsub_f128:
44 ; CHECK-NEXT: xssubqp v2, v2, v3
47 ; CHECK-P8-LABEL: fsub_f128:
49 ; CHECK-P8-NEXT: mflr r0
50 ; CHECK-P8-NEXT: std r0, 16(r1)
51 ; CHECK-P8-NEXT: stdu r1, -32(r1)
52 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
53 ; CHECK-P8-NEXT: .cfi_offset lr, 16
54 ; CHECK-P8-NEXT: bl __subkf3
56 ; CHECK-P8-NEXT: addi r1, r1, 32
57 ; CHECK-P8-NEXT: ld r0, 16(r1)
58 ; CHECK-P8-NEXT: mtlr r0
60 %res = call fp128 @llvm.experimental.constrained.fsub.f128(
62 metadata !"round.dynamic",
63 metadata !"fpexcept.strict") #0
67 define fp128 @fmul_f128(fp128 %f1, fp128 %f2) #0 {
68 ; CHECK-LABEL: fmul_f128:
70 ; CHECK-NEXT: xsmulqp v2, v2, v3
73 ; CHECK-P8-LABEL: fmul_f128:
75 ; CHECK-P8-NEXT: mflr r0
76 ; CHECK-P8-NEXT: std r0, 16(r1)
77 ; CHECK-P8-NEXT: stdu r1, -32(r1)
78 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
79 ; CHECK-P8-NEXT: .cfi_offset lr, 16
80 ; CHECK-P8-NEXT: bl __mulkf3
82 ; CHECK-P8-NEXT: addi r1, r1, 32
83 ; CHECK-P8-NEXT: ld r0, 16(r1)
84 ; CHECK-P8-NEXT: mtlr r0
86 %res = call fp128 @llvm.experimental.constrained.fmul.f128(
88 metadata !"round.dynamic",
89 metadata !"fpexcept.strict") #0
93 define fp128 @fdiv_f128(fp128 %f1, fp128 %f2) #0 {
94 ; CHECK-LABEL: fdiv_f128:
96 ; CHECK-NEXT: xsdivqp v2, v2, v3
99 ; CHECK-P8-LABEL: fdiv_f128:
101 ; CHECK-P8-NEXT: mflr r0
102 ; CHECK-P8-NEXT: std r0, 16(r1)
103 ; CHECK-P8-NEXT: stdu r1, -32(r1)
104 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
105 ; CHECK-P8-NEXT: .cfi_offset lr, 16
106 ; CHECK-P8-NEXT: bl __divkf3
108 ; CHECK-P8-NEXT: addi r1, r1, 32
109 ; CHECK-P8-NEXT: ld r0, 16(r1)
110 ; CHECK-P8-NEXT: mtlr r0
112 %res = call fp128 @llvm.experimental.constrained.fdiv.f128(
113 fp128 %f1, fp128 %f2,
114 metadata !"round.dynamic",
115 metadata !"fpexcept.strict") #0
119 define fp128 @fmadd_f128(fp128 %f0, fp128 %f1, fp128 %f2) #0 {
120 ; CHECK-LABEL: fmadd_f128:
122 ; CHECK-NEXT: xsmaddqp v4, v2, v3
123 ; CHECK-NEXT: vmr v2, v4
126 ; CHECK-P8-LABEL: fmadd_f128:
128 ; CHECK-P8-NEXT: mflr r0
129 ; CHECK-P8-NEXT: std r0, 16(r1)
130 ; CHECK-P8-NEXT: stdu r1, -32(r1)
131 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
132 ; CHECK-P8-NEXT: .cfi_offset lr, 16
133 ; CHECK-P8-NEXT: bl fmaf128
135 ; CHECK-P8-NEXT: addi r1, r1, 32
136 ; CHECK-P8-NEXT: ld r0, 16(r1)
137 ; CHECK-P8-NEXT: mtlr r0
139 %res = call fp128 @llvm.experimental.constrained.fma.f128(
140 fp128 %f0, fp128 %f1, fp128 %f2,
141 metadata !"round.dynamic",
142 metadata !"fpexcept.strict") #0
146 define fp128 @fmsub_f128(fp128 %f0, fp128 %f1, fp128 %f2) #0 {
147 ; CHECK-LABEL: fmsub_f128:
149 ; CHECK-NEXT: xsmsubqp v4, v2, v3
150 ; CHECK-NEXT: vmr v2, v4
153 ; CHECK-P8-LABEL: fmsub_f128:
155 ; CHECK-P8-NEXT: mflr r0
156 ; CHECK-P8-NEXT: std r0, 16(r1)
157 ; CHECK-P8-NEXT: stdu r1, -48(r1)
158 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
159 ; CHECK-P8-NEXT: .cfi_offset lr, 16
160 ; CHECK-P8-NEXT: addi r3, r1, 32
161 ; CHECK-P8-NEXT: stvx v4, 0, r3
162 ; CHECK-P8-NEXT: lbz r4, 47(r1)
163 ; CHECK-P8-NEXT: xori r4, r4, 128
164 ; CHECK-P8-NEXT: stb r4, 47(r1)
165 ; CHECK-P8-NEXT: lvx v4, 0, r3
166 ; CHECK-P8-NEXT: bl fmaf128
168 ; CHECK-P8-NEXT: addi r1, r1, 48
169 ; CHECK-P8-NEXT: ld r0, 16(r1)
170 ; CHECK-P8-NEXT: mtlr r0
172 %neg = fneg fp128 %f2
173 %res = call fp128 @llvm.experimental.constrained.fma.f128(
174 fp128 %f0, fp128 %f1, fp128 %neg,
175 metadata !"round.dynamic",
176 metadata !"fpexcept.strict") #0
180 define fp128 @fnmadd_f128(fp128 %f0, fp128 %f1, fp128 %f2) #0 {
181 ; CHECK-LABEL: fnmadd_f128:
183 ; CHECK-NEXT: xsnmaddqp v4, v2, v3
184 ; CHECK-NEXT: vmr v2, v4
187 ; CHECK-P8-LABEL: fnmadd_f128:
189 ; CHECK-P8-NEXT: mflr r0
190 ; CHECK-P8-NEXT: std r0, 16(r1)
191 ; CHECK-P8-NEXT: stdu r1, -48(r1)
192 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
193 ; CHECK-P8-NEXT: .cfi_offset lr, 16
194 ; CHECK-P8-NEXT: bl fmaf128
196 ; CHECK-P8-NEXT: addi r3, r1, 32
197 ; CHECK-P8-NEXT: stvx v2, 0, r3
198 ; CHECK-P8-NEXT: lbz r4, 47(r1)
199 ; CHECK-P8-NEXT: xori r4, r4, 128
200 ; CHECK-P8-NEXT: stb r4, 47(r1)
201 ; CHECK-P8-NEXT: lvx v2, 0, r3
202 ; CHECK-P8-NEXT: addi r1, r1, 48
203 ; CHECK-P8-NEXT: ld r0, 16(r1)
204 ; CHECK-P8-NEXT: mtlr r0
206 %fma = call fp128 @llvm.experimental.constrained.fma.f128(
207 fp128 %f0, fp128 %f1, fp128 %f2,
208 metadata !"round.dynamic",
209 metadata !"fpexcept.strict") #0
210 %res = fneg fp128 %fma
214 define fp128 @fnmsub_f128(fp128 %f0, fp128 %f1, fp128 %f2) #0 {
215 ; CHECK-LABEL: fnmsub_f128:
217 ; CHECK-NEXT: xsnmsubqp v4, v2, v3
218 ; CHECK-NEXT: vmr v2, v4
221 ; CHECK-P8-LABEL: fnmsub_f128:
223 ; CHECK-P8-NEXT: mflr r0
224 ; CHECK-P8-NEXT: std r0, 16(r1)
225 ; CHECK-P8-NEXT: stdu r1, -64(r1)
226 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
227 ; CHECK-P8-NEXT: .cfi_offset lr, 16
228 ; CHECK-P8-NEXT: addi r3, r1, 32
229 ; CHECK-P8-NEXT: stvx v4, 0, r3
230 ; CHECK-P8-NEXT: lbz r4, 47(r1)
231 ; CHECK-P8-NEXT: xori r4, r4, 128
232 ; CHECK-P8-NEXT: stb r4, 47(r1)
233 ; CHECK-P8-NEXT: lvx v4, 0, r3
234 ; CHECK-P8-NEXT: bl fmaf128
236 ; CHECK-P8-NEXT: addi r3, r1, 48
237 ; CHECK-P8-NEXT: stvx v2, 0, r3
238 ; CHECK-P8-NEXT: lbz r4, 63(r1)
239 ; CHECK-P8-NEXT: xori r4, r4, 128
240 ; CHECK-P8-NEXT: stb r4, 63(r1)
241 ; CHECK-P8-NEXT: lvx v2, 0, r3
242 ; CHECK-P8-NEXT: addi r1, r1, 64
243 ; CHECK-P8-NEXT: ld r0, 16(r1)
244 ; CHECK-P8-NEXT: mtlr r0
246 %neg = fneg fp128 %f2
247 %fma = call fp128 @llvm.experimental.constrained.fma.f128(
248 fp128 %f0, fp128 %f1, fp128 %neg,
249 metadata !"round.dynamic",
250 metadata !"fpexcept.strict") #0
251 %res = fneg fp128 %fma
256 define fp128 @fsqrt_f128(fp128 %f1) #0 {
257 ; CHECK-LABEL: fsqrt_f128:
259 ; CHECK-NEXT: xssqrtqp v2, v2
262 ; CHECK-P8-LABEL: fsqrt_f128:
264 ; CHECK-P8-NEXT: mflr r0
265 ; CHECK-P8-NEXT: std r0, 16(r1)
266 ; CHECK-P8-NEXT: stdu r1, -32(r1)
267 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
268 ; CHECK-P8-NEXT: .cfi_offset lr, 16
269 ; CHECK-P8-NEXT: bl sqrtf128
271 ; CHECK-P8-NEXT: addi r1, r1, 32
272 ; CHECK-P8-NEXT: ld r0, 16(r1)
273 ; CHECK-P8-NEXT: mtlr r0
275 %res = call fp128 @llvm.experimental.constrained.sqrt.f128(
277 metadata !"round.dynamic",
278 metadata !"fpexcept.strict") #0
282 attributes #0 = { strictfp }