1 /* Test that the compiler properly generates floating point multiply
2 and add instructions FMA systems. */
4 /* { dg-do compile } */
5 /* { dg-options "-O2 -mfma" } */
10 check_mm_fmadd_pd (__m128d a
, __m128d b
, __m128d c
)
12 return _mm_fmadd_pd (a
, b
, c
);
16 check_mm256_fmadd_pd (__m256d a
, __m256d b
, __m256d c
)
18 return _mm256_fmadd_pd (a
, b
, c
);
22 check_mm_fmadd_ps (__m128 a
, __m128 b
, __m128 c
)
24 return _mm_fmadd_ps (a
, b
, c
);
28 check_mm256_fmadd_ps (__m256 a
, __m256 b
, __m256 c
)
30 return _mm256_fmadd_ps (a
, b
, c
);
34 check_mm_fmadd_sd (__m128d a
, __m128d b
, __m128d c
)
36 return _mm_fmadd_sd (a
, b
, c
);
40 check_mm_fmadd_ss (__m128 a
, __m128 b
, __m128 c
)
42 return _mm_fmadd_ss (a
, b
, c
);
46 check_mm_fmsub_pd (__m128d a
, __m128d b
, __m128d c
)
48 return _mm_fmsub_pd (a
, b
, c
);
52 check_mm256_fmsub_pd (__m256d a
, __m256d b
, __m256d c
)
54 return _mm256_fmsub_pd (a
, b
, c
);
58 check_mm_fmsub_ps (__m128 a
, __m128 b
, __m128 c
)
60 return _mm_fmsub_ps (a
, b
, c
);
64 check_mm256_fmsub_ps (__m256 a
, __m256 b
, __m256 c
)
66 return _mm256_fmsub_ps (a
, b
, c
);
70 check_mm_fmsub_sd (__m128d a
, __m128d b
, __m128d c
)
72 return _mm_fmsub_sd (a
, b
, c
);
76 check_mm_fmsub_ss (__m128 a
, __m128 b
, __m128 c
)
78 return _mm_fmsub_ss (a
, b
, c
);
82 check_mm_fnmadd_pd (__m128d a
, __m128d b
, __m128d c
)
84 return _mm_fnmadd_pd (a
, b
, c
);
88 check_mm256_fnmadd_pd (__m256d a
, __m256d b
, __m256d c
)
90 return _mm256_fnmadd_pd (a
, b
, c
);
94 check_mm_fnmadd_ps (__m128 a
, __m128 b
, __m128 c
)
96 return _mm_fnmadd_ps (a
, b
, c
);
100 check_mm256_fnmadd_ps (__m256 a
, __m256 b
, __m256 c
)
102 return _mm256_fnmadd_ps (a
, b
, c
);
106 check_mm_fnmadd_sd (__m128d a
, __m128d b
, __m128d c
)
108 return _mm_fnmadd_sd (a
, b
, c
);
112 check_mm_fnmadd_ss (__m128 a
, __m128 b
, __m128 c
)
114 return _mm_fnmadd_ss (a
, b
, c
);
118 check_mm_fnmsub_pd (__m128d a
, __m128d b
, __m128d c
)
120 return _mm_fnmsub_pd (a
, b
, c
);
124 check_mm256_fnmsub_pd (__m256d a
, __m256d b
, __m256d c
)
126 return _mm256_fnmsub_pd (a
, b
, c
);
130 check_mm_fnmsub_ps (__m128 a
, __m128 b
, __m128 c
)
132 return _mm_fnmsub_ps (a
, b
, c
);
136 check_mm256_fnmsub_ps (__m256 a
, __m256 b
, __m256 c
)
138 return _mm256_fnmsub_ps (a
, b
, c
);
142 check_mm_fnmsub_sd (__m128d a
, __m128d b
, __m128d c
)
144 return _mm_fnmsub_sd (a
, b
, c
);
148 check_mm_fnmsub_ss (__m128 a
, __m128 b
, __m128 c
)
150 return _mm_fnmsub_ss (a
, b
, c
);
154 check_mm_fmaddsub_pd (__m128d a
, __m128d b
, __m128d c
)
156 return _mm_fmaddsub_pd (a
, b
, c
);
160 check_mm256_fmaddsub_pd (__m256d a
, __m256d b
, __m256d c
)
162 return _mm256_fmaddsub_pd (a
, b
, c
);
166 check_mm_fmaddsub_ps (__m128 a
, __m128 b
, __m128 c
)
168 return _mm_fmaddsub_ps (a
, b
, c
);
172 check_mm256_fmaddsub_ps (__m256 a
, __m256 b
, __m256 c
)
174 return _mm256_fmaddsub_ps (a
, b
, c
);
178 check_mm_fmsubadd_pd (__m128d a
, __m128d b
, __m128d c
)
180 return _mm_fmsubadd_pd (a
, b
, c
);
184 check_mm256_fmsubadd_pd (__m256d a
, __m256d b
, __m256d c
)
186 return _mm256_fmsubadd_pd (a
, b
, c
);
190 check_mm_fmsubadd_ps (__m128 a
, __m128 b
, __m128 c
)
192 return _mm_fmsubadd_ps (a
, b
, c
);
196 check_mm256_fmsubadd_ps (__m256 a
, __m256 b
, __m256 c
)
198 return _mm256_fmsubadd_ps (a
, b
, c
);
202 /* { dg-final { scan-assembler-times "vfmadd\[^s\]..ps" 2 } } */
203 /* { dg-final { scan-assembler-times "vfmsub\[^s\]..ps" 2 } } */
204 /* { dg-final { scan-assembler-times "vfnmadd...ps" 2 } } */
205 /* { dg-final { scan-assembler-times "vfnmsub...ps" 2 } } */
206 /* { dg-final { scan-assembler-times "vfmaddsub...ps" 2 } } */
207 /* { dg-final { scan-assembler-times "vfmsubadd...ps" 2 } } */
208 /* { dg-final { scan-assembler-times "vfmadd\[^s\]..pd" 2 } } */
209 /* { dg-final { scan-assembler-times "vfmsub\[^s\]..pd" 2 } } */
210 /* { dg-final { scan-assembler-times "vfnmadd...pd" 2 } } */
211 /* { dg-final { scan-assembler-times "vfnmsub...pd" 2 } } */
212 /* { dg-final { scan-assembler-times "vfmaddsub...pd" 2 } } */
213 /* { dg-final { scan-assembler-times "vfmsubadd...pd" 2 } } */
214 /* { dg-final { scan-assembler-times "vfmadd\[^s\]..ss" 1 } } */
215 /* { dg-final { scan-assembler-times "vfmsub\[^s\]..ss" 1 } } */
216 /* { dg-final { scan-assembler-times "vfnmadd...ss" 1 } } */
217 /* { dg-final { scan-assembler-times "vfnmsub...ss" 1 } } */
218 /* { dg-final { scan-assembler-times "vfmadd\[^s\]..sd" 1 } } */
219 /* { dg-final { scan-assembler-times "vfmsub\[^s\]..sd" 1 } } */
220 /* { dg-final { scan-assembler-times "vfnmadd...sd" 1 } } */
221 /* { dg-final { scan-assembler-times "vfnmsub...sd" 1 } } */