1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -O2 -emit-llvm -o - | FileCheck %s --check-prefixes=COMMON,COMMONIR,UNCONSTRAINED
3 // RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -ffp-exception-behavior=maytrap -DSTRICT=1 -O2 -emit-llvm -o - | FileCheck %s --check-prefixes=COMMON,COMMONIR,CONSTRAINED
4 // RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -O2 -S -o - | FileCheck %s --check-prefixes=COMMON,CHECK-ASM
5 // RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -O2 -ffp-exception-behavior=maytrap -DSTRICT=1 -S -o - | FileCheck %s --check-prefixes=COMMON,CHECK-ASM
6 // RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -O2 -emit-llvm -o - | FileCheck %s --check-prefixes=COMMON,COMMONIR,UNCONSTRAINED
7 // RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -ffp-exception-behavior=maytrap -DSTRICT=1 -O2 -emit-llvm -o - | FileCheck %s --check-prefixes=COMMON,COMMONIR,CONSTRAINED
8 // RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -O2 -S -o - | FileCheck %s --check-prefixes=COMMON,CHECK-ASM
9 // RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-unknown-linux-gnu -target-feature +fma -O2 -ffp-exception-behavior=maytrap -DSTRICT=1 -S -o - | FileCheck %s --check-prefixes=COMMON,CHECK-ASM
12 // Test that the constrained intrinsics are picking up the exception
13 // metadata from the AST instead of the global default from the command line.
15 #pragma float_control(except, on)
18 #include <immintrin.h>
20 __m128
test_mm_fmadd_ps(__m128 a
, __m128 b
, __m128 c
) {
21 // COMMON-LABEL: test_mm_fmadd_ps
22 // UNCONSTRAINED: call {{.*}}<4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
23 // CONSTRAINED: call {{.*}}<4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
24 // CHECK-ASM: vfmadd213ps
25 return _mm_fmadd_ps(a
, b
, c
);
28 __m128d
test_mm_fmadd_pd(__m128d a
, __m128d b
, __m128d c
) {
29 // COMMON-LABEL: test_mm_fmadd_pd
30 // UNCONSTRAINED: call {{.*}}<2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
31 // CONSTRAINED: call {{.*}}<2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}, metadata !{{.*}})
32 // CHECK-ASM: vfmadd213pd
33 return _mm_fmadd_pd(a
, b
, c
);
36 __m128
test_mm_fmadd_ss(__m128 a
, __m128 b
, __m128 c
) {
37 // COMMON-LABEL: test_mm_fmadd_ss
38 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
39 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
40 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
41 // UNCONSTRAINED: call float @llvm.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
42 // CONSTRAINED: call float @llvm.experimental.constrained.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}, metadata !{{.*}})
43 // CHECK-ASM: vfmadd213ss
44 // COMMONIR: insertelement <4 x float> %{{.*}}, float %{{.*}}, i64 0
45 return _mm_fmadd_ss(a
, b
, c
);
48 __m128d
test_mm_fmadd_sd(__m128d a
, __m128d b
, __m128d c
) {
49 // COMMON-LABEL: test_mm_fmadd_sd
50 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
51 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
52 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
53 // UNCONSTRAINED: call double @llvm.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}})
54 // CONSTRAINED: call double @llvm.experimental.constrained.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}}, metadata !{{.*}})
55 // CHECK-ASM: vfmadd213sd
56 // COMMONIR: insertelement <2 x double> %{{.*}}, double %{{.*}}, i64 0
57 return _mm_fmadd_sd(a
, b
, c
);
60 __m128
test_mm_fmsub_ps(__m128 a
, __m128 b
, __m128 c
) {
61 // COMMON-LABEL: test_mm_fmsub_ps
62 // COMMONIR: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
63 // UNCONSTRAINED: call {{.*}}<4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
64 // CONSTRAINED: call {{.*}}<4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
65 // CHECK-ASM: vfmsub213ps
66 return _mm_fmsub_ps(a
, b
, c
);
69 __m128d
test_mm_fmsub_pd(__m128d a
, __m128d b
, __m128d c
) {
70 // COMMON-LABEL: test_mm_fmsub_pd
71 // COMMONIR: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
72 // UNCONSTRAINED: call {{.*}}<2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
73 // CONSTRAINED: call {{.*}}<2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}, metadata !{{.*}})
74 // CHECK-ASM: vfmsub213pd
75 return _mm_fmsub_pd(a
, b
, c
);
78 __m128
test_mm_fmsub_ss(__m128 a
, __m128 b
, __m128 c
) {
79 // COMMON-LABEL: test_mm_fmsub_ss
80 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
81 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
82 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
83 // COMMONIR: [[NEG:%.+]] = fneg float %{{.+}}
84 // UNCONSTRAINED: call float @llvm.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
85 // CONSTRAINED: call float @llvm.experimental.constrained.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}, metadata !{{.*}})
86 // CHECK-ASM: vfmsub213ss
87 // COMMONIR: insertelement <4 x float> %{{.*}}, float %{{.*}}, i64 0
88 return _mm_fmsub_ss(a
, b
, c
);
91 __m128d
test_mm_fmsub_sd(__m128d a
, __m128d b
, __m128d c
) {
92 // COMMON-LABEL: test_mm_fmsub_sd
93 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
94 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
95 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
96 // COMMONIR: [[NEG:%.+]] = fneg double %{{.+}}
97 // UNCONSTRAINED: call double @llvm.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}})
98 // CONSTRAINED: call double @llvm.experimental.constrained.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}}, metadata !{{.*}})
99 // CHECK-ASM: vfmsub213sd
100 // COMMONIR: insertelement <2 x double> %{{.*}}, double %{{.*}}, i64 0
101 return _mm_fmsub_sd(a
, b
, c
);
104 __m128
test_mm_fnmadd_ps(__m128 a
, __m128 b
, __m128 c
) {
105 // COMMON-LABEL: test_mm_fnmadd_ps
106 // COMMONIR: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
107 // UNCONSTRAINED: call {{.*}}<4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
108 // CONSTRAINED: call {{.*}}<4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
109 // CHECK-ASM: vfnmadd213ps
110 return _mm_fnmadd_ps(a
, b
, c
);
113 __m128d
test_mm_fnmadd_pd(__m128d a
, __m128d b
, __m128d c
) {
114 // COMMON-LABEL: test_mm_fnmadd_pd
115 // COMMONIR: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
116 // UNCONSTRAINED: call {{.*}}<2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
117 // CONSTRAINED: call {{.*}}<2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}, metadata !{{.*}})
118 // CHECK-ASM: vfnmadd213pd
119 return _mm_fnmadd_pd(a
, b
, c
);
122 __m128
test_mm_fnmadd_ss(__m128 a
, __m128 b
, __m128 c
) {
123 // COMMON-LABEL: test_mm_fnmadd_ss
124 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
125 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
126 // COMMONIR: [[NEG:%.+]] = fneg float %{{.+}}
127 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
128 // UNCONSTRAINED: call float @llvm.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
129 // CONSTRAINED: call float @llvm.experimental.constrained.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}, metadata !{{.*}})
130 // CHECK-ASM: vfnmadd213ss
131 // COMMONIR: insertelement <4 x float> %{{.*}}, float %{{.*}}, i64 0
132 return _mm_fnmadd_ss(a
, b
, c
);
135 __m128d
test_mm_fnmadd_sd(__m128d a
, __m128d b
, __m128d c
) {
136 // COMMON-LABEL: test_mm_fnmadd_sd
137 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
138 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
139 // COMMONIR: [[NEG:%.+]] = fneg double %{{.+}}
140 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
141 // UNCONSTRAINED: call double @llvm.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}})
142 // CONSTRAINED: call double @llvm.experimental.constrained.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}}, metadata !{{.*}})
143 // CHECK-ASM: vfnmadd213sd
144 // COMMONIR: insertelement <2 x double> %{{.*}}, double %{{.*}}, i64 0
145 return _mm_fnmadd_sd(a
, b
, c
);
148 __m128
test_mm_fnmsub_ps(__m128 a
, __m128 b
, __m128 c
) {
149 // COMMON-LABEL: test_mm_fnmsub_ps
150 // COMMONIR: [[NEG:%.+]] = fneg <4 x float> %{{.+}}
151 // COMMONIR: [[NEG2:%.+]] = fneg <4 x float> %{{.+}}
152 // UNCONSTRAINED: call {{.*}}<4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
153 // CONSTRAINED: call {{.*}}<4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}, metadata !{{.*}})
154 // CHECK-ASM: vfnmsub213ps
155 return _mm_fnmsub_ps(a
, b
, c
);
158 __m128d
test_mm_fnmsub_pd(__m128d a
, __m128d b
, __m128d c
) {
159 // COMMON-LABEL: test_mm_fnmsub_pd
160 // COMMONIR: [[NEG:%.+]] = fneg <2 x double> %{{.+}}
161 // COMMONIR: [[NEG2:%.+]] = fneg <2 x double> %{{.+}}
162 // UNCONSTRAINED: call {{.*}}<2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
163 // CONSTRAINED: call {{.*}}<2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}, metadata !{{.*}})
164 // CHECK-ASM: vfnmsub213pd
165 return _mm_fnmsub_pd(a
, b
, c
);
168 __m128
test_mm_fnmsub_ss(__m128 a
, __m128 b
, __m128 c
) {
169 // COMMON-LABEL: test_mm_fnmsub_ss
170 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
171 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
172 // COMMONIR: [[NEG:%.+]] = fneg float %{{.+}}
173 // COMMONIR: extractelement <4 x float> %{{.*}}, i64 0
174 // COMMONIR: [[NEG2:%.+]] = fneg float %{{.+}}
175 // UNCONSTRAINED: call float @llvm.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})
176 // CONSTRAINED: call float @llvm.experimental.constrained.fma.f32(float %{{.*}}, float %{{.*}}, float %{{.*}}, metadata !{{.*}})
177 // CHECK-ASM: vfnmsub213ss
178 // COMMONIR: insertelement <4 x float> %{{.*}}, float %{{.*}}, i64 0
179 return _mm_fnmsub_ss(a
, b
, c
);
182 __m128d
test_mm_fnmsub_sd(__m128d a
, __m128d b
, __m128d c
) {
183 // COMMON-LABEL: test_mm_fnmsub_sd
184 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
185 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
186 // COMMONIR: [[NEG:%.+]] = fneg double %{{.+}}
187 // COMMONIR: extractelement <2 x double> %{{.*}}, i64 0
188 // COMMONIR: [[NEG2:%.+]] = fneg double %{{.+}}
189 // UNCONSTRAINED: call double @llvm.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}})
190 // CONSTRAINED: call double @llvm.experimental.constrained.fma.f64(double %{{.*}}, double %{{.*}}, double %{{.*}}, metadata !{{.*}})
191 // CHECK-ASM: vfnmsub213sd
192 // COMMONIR: insertelement <2 x double> %{{.*}}, double %{{.*}}, i64 0
193 return _mm_fnmsub_sd(a
, b
, c
);
196 __m128
test_mm_fmaddsub_ps(__m128 a
, __m128 b
, __m128 c
) {
197 // COMMON-LABEL: test_mm_fmaddsub_ps
198 // COMMONIR-NOT: fneg
199 // COMMONIR: tail call {{.*}}<4 x float> @llvm.x86.fma.vfmaddsub.ps(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
200 // CHECK-ASM: vfmaddsub213ps
201 return _mm_fmaddsub_ps(a
, b
, c
);
204 __m128d
test_mm_fmaddsub_pd(__m128d a
, __m128d b
, __m128d c
) {
205 // COMMON-LABEL: test_mm_fmaddsub_pd
206 // COMMONIR-NOT: fneg
207 // COMMONIR: tail call {{.*}}<2 x double> @llvm.x86.fma.vfmaddsub.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
208 // CHECK-ASM: vfmaddsub213pd
209 return _mm_fmaddsub_pd(a
, b
, c
);
212 __m128
test_mm_fmsubadd_ps(__m128 a
, __m128 b
, __m128 c
) {
213 // COMMON-LABEL: test_mm_fmsubadd_ps
214 // COMMONIR: [[FNEG:%.+]] = fneg <4 x float> %{{.*}}
215 // COMMONIR: tail call {{.*}}<4 x float> @llvm.x86.fma.vfmaddsub.ps(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[FNEG]])
216 // CHECK-ASM: vfmsubadd213ps
217 return _mm_fmsubadd_ps(a
, b
, c
);
220 __m128d
test_mm_fmsubadd_pd(__m128d a
, __m128d b
, __m128d c
) {
221 // COMMON-LABEL: test_mm_fmsubadd_pd
222 // COMMONIR: [[FNEG:%.+]] = fneg <2 x double> %{{.*}}
223 // COMMONIR: tail call {{.*}}<2 x double> @llvm.x86.fma.vfmaddsub.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[FNEG]])
224 // CHECK-ASM: vfmsubadd213pd
225 return _mm_fmsubadd_pd(a
, b
, c
);
228 __m256
test_mm256_fmadd_ps(__m256 a
, __m256 b
, __m256 c
) {
229 // COMMON-LABEL: test_mm256_fmadd_ps
230 // UNCONSTRAINED: call {{.*}}<8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
231 // CONSTRAINED: call {{.*}}<8 x float> @llvm.experimental.constrained.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}, metadata !{{.*}})
232 // CHECK-ASM: vfmadd213ps
233 return _mm256_fmadd_ps(a
, b
, c
);
236 __m256d
test_mm256_fmadd_pd(__m256d a
, __m256d b
, __m256d c
) {
237 // COMMON-LABEL: test_mm256_fmadd_pd
238 // UNCONSTRAINED: call {{.*}}<4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
239 // CONSTRAINED: call {{.*}}<4 x double> @llvm.experimental.constrained.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}, metadata !{{.*}})
240 // CHECK-ASM: vfmadd213pd
241 return _mm256_fmadd_pd(a
, b
, c
);
244 __m256
test_mm256_fmsub_ps(__m256 a
, __m256 b
, __m256 c
) {
245 // COMMON-LABEL: test_mm256_fmsub_ps
246 // COMMONIR: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
247 // UNCONSTRAINED: call {{.*}}<8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
248 // CONSTRAINED: call {{.*}}<8 x float> @llvm.experimental.constrained.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}, metadata !{{.*}})
249 // CHECK-ASM: vfmsub213ps
250 return _mm256_fmsub_ps(a
, b
, c
);
253 __m256d
test_mm256_fmsub_pd(__m256d a
, __m256d b
, __m256d c
) {
254 // COMMON-LABEL: test_mm256_fmsub_pd
255 // COMMONIR: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
256 // UNCONSTRAINED: call {{.*}}<4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
257 // CONSTRAINED: call {{.*}}<4 x double> @llvm.experimental.constrained.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}, metadata !{{.*}})
258 // CHECK-ASM: vfmsub213pd
259 return _mm256_fmsub_pd(a
, b
, c
);
262 __m256
test_mm256_fnmadd_ps(__m256 a
, __m256 b
, __m256 c
) {
263 // COMMON-LABEL: test_mm256_fnmadd_ps
264 // COMMONIR: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
265 // UNCONSTRAINED: call {{.*}}<8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
266 // CONSTRAINED: call {{.*}}<8 x float> @llvm.experimental.constrained.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}, metadata !{{.*}})
267 // CHECK-ASM: vfnmadd213ps
268 return _mm256_fnmadd_ps(a
, b
, c
);
271 __m256d
test_mm256_fnmadd_pd(__m256d a
, __m256d b
, __m256d c
) {
272 // COMMON-LABEL: test_mm256_fnmadd_pd
273 // COMMONIR: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
274 // UNCONSTRAINED: call {{.*}}<4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
275 // CONSTRAINED: call {{.*}}<4 x double> @llvm.experimental.constrained.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}, metadata !{{.*}})
276 // CHECK-ASM: vfnmadd213pd
277 return _mm256_fnmadd_pd(a
, b
, c
);
280 __m256
test_mm256_fnmsub_ps(__m256 a
, __m256 b
, __m256 c
) {
281 // COMMON-LABEL: test_mm256_fnmsub_ps
282 // COMMONIR: [[NEG:%.+]] = fneg <8 x float> %{{.*}}
283 // COMMONIR: [[NEG2:%.+]] = fneg <8 x float> %{{.*}}
284 // UNCONSTRAINED: call {{.*}}<8 x float> @llvm.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
285 // CONSTRAINED: call {{.*}}<8 x float> @llvm.experimental.constrained.fma.v8f32(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}, metadata !{{.*}})
286 // CHECK-ASM: vfnmsub213ps
287 return _mm256_fnmsub_ps(a
, b
, c
);
290 __m256d
test_mm256_fnmsub_pd(__m256d a
, __m256d b
, __m256d c
) {
291 // COMMON-LABEL: test_mm256_fnmsub_pd
292 // COMMONIR: [[NEG:%.+]] = fneg <4 x double> %{{.+}}
293 // COMMONIR: [[NEG2:%.+]] = fneg <4 x double> %{{.+}}
294 // UNCONSTRAINED: call {{.*}}<4 x double> @llvm.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
295 // CONSTRAINED: call {{.*}}<4 x double> @llvm.experimental.constrained.fma.v4f64(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}, metadata !{{.*}})
296 // CHECK-ASM: vfnmsub213pd
297 return _mm256_fnmsub_pd(a
, b
, c
);
300 __m256
test_mm256_fmaddsub_ps(__m256 a
, __m256 b
, __m256 c
) {
301 // COMMON-LABEL: test_mm256_fmaddsub_ps
302 // COMMONIR-NOT: fneg
303 // COMMONIR: tail call {{.*}}<8 x float> @llvm.x86.fma.vfmaddsub.ps.256(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}})
304 // CHECK-ASM: vfmaddsub213ps
305 return _mm256_fmaddsub_ps(a
, b
, c
);
308 __m256d
test_mm256_fmaddsub_pd(__m256d a
, __m256d b
, __m256d c
) {
309 // COMMON-LABEL: test_mm256_fmaddsub_pd
310 // COMMONIR-NOT: fneg
311 // COMMONIR: tail call {{.*}}<4 x double> @llvm.x86.fma.vfmaddsub.pd.256(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}})
312 // CHECK-ASM: vfmaddsub213pd
313 return _mm256_fmaddsub_pd(a
, b
, c
);
316 __m256
test_mm256_fmsubadd_ps(__m256 a
, __m256 b
, __m256 c
) {
317 // COMMON-LABEL: test_mm256_fmsubadd_ps
318 // COMMONIR: [[FNEG:%.+]] = fneg <8 x float> %{{.*}}
319 // COMMONIR: tail call {{.*}}<8 x float> @llvm.x86.fma.vfmaddsub.ps.256(<8 x float> %{{.*}}, <8 x float> %{{.*}}, <8 x float> [[FNEG]])
320 // CHECK-ASM: vfmsubadd213ps
321 return _mm256_fmsubadd_ps(a
, b
, c
);
324 __m256d
test_mm256_fmsubadd_pd(__m256d a
, __m256d b
, __m256d c
) {
325 // COMMON-LABEL: test_mm256_fmsubadd_pd
326 // COMMONIR: [[FNEG:%.+]] = fneg <4 x double> %{{.*}}
327 // COMMONIR: tail call {{.*}}<4 x double> @llvm.x86.fma.vfmaddsub.pd.256(<4 x double> %{{.*}}, <4 x double> %{{.*}}, <4 x double> [[FNEG]])
328 // CHECK-ASM: vfmsubadd213pd
329 return _mm256_fmsubadd_pd(a
, b
, c
);