* gcc.target/i386/pr70021.c: Add -mtune=skylake.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx-vround-1.c
blobb760607eacdaa7cb53e8b823adbfaa41e16afbf9
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -mavx -mno-avx2" } */
4 #include <x86intrin.h>
6 __attribute__((noinline, noclone)) double
7 f1 (double x)
9 return __builtin_round (x);
12 __attribute__((noinline, noclone)) float
13 f2 (float x)
15 return __builtin_roundf (x);
18 __attribute__((noinline, noclone)) __m128d
19 f3 (__m128d x, __m128d y)
21 return _mm_round_sd (x, y, _MM_FROUND_NINT);
24 __attribute__((noinline, noclone)) __m128
25 f4 (__m128 x, __m128 y)
27 return _mm_round_ss (x, y, _MM_FROUND_NINT);
30 __attribute__((noinline, noclone)) __m128d
31 f5 (__m128d x)
33 return _mm_round_pd (x, _MM_FROUND_NINT);
36 __attribute__((noinline, noclone)) __m128
37 f6 (__m128 x)
39 return _mm_round_ps (x, _MM_FROUND_NINT);
42 __attribute__((noinline, noclone)) __m256d
43 f7 (__m256d x)
45 return _mm256_round_pd (x, _MM_FROUND_NINT);
48 __attribute__((noinline, noclone)) __m256
49 f8 (__m256 x)
51 return _mm256_round_ps (x, _MM_FROUND_NINT);
54 /* { dg-final { scan-assembler-times "vroundsd\[^\n\r\]*xmm" 2 } } */
55 /* { dg-final { scan-assembler-times "vroundss\[^\n\r\]*xmm" 2 } } */
56 /* { dg-final { scan-assembler-times "vroundpd\[^\n\r\]*xmm" 1 } } */
57 /* { dg-final { scan-assembler-times "vroundps\[^\n\r\]*xmm" 1 } } */
58 /* { dg-final { scan-assembler-times "vroundpd\[^\n\r\]*ymm" 1 } } */
59 /* { dg-final { scan-assembler-times "vroundps\[^\n\r\]*ymm" 1 } } */