PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse4_1-rint-inline.c
blob6d60da33cb7f3e0bda9beb1b1292de4f10d4ac88
1 /* Test rint and related functions expanded inline for SSE4.1, even
2 when spurious "inexact" not allowed. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -msse4.1 -mfpmath=sse -fno-fp-int-builtin-inexact" } */
5 /* { dg-add-options c99_runtime } */
6 /* { dg-require-effective-target sse4 } */
8 #define TEST(FN, TYPE) \
9 do \
10 { \
11 volatile TYPE a = 1.5, b; \
12 b = FN (a); \
13 } \
14 while (0)
16 #define FN_TESTS(FN) \
17 do \
18 { \
19 TEST (__builtin_ ## FN, double); \
20 TEST (__builtin_ ## FN ## f, float); \
21 } \
22 while (0)
24 void
25 test (void)
27 FN_TESTS (rint);
28 FN_TESTS (ceil);
29 FN_TESTS (floor);
30 FN_TESTS (trunc);
33 /* { dg-final { scan-assembler-not "\[ \t\]rint" } } */
34 /* { dg-final { scan-assembler-not "\[ \t\]ceil" } } */
35 /* { dg-final { scan-assembler-not "\[ \t\]floor" } } */
36 /* { dg-final { scan-assembler-not "\[ \t\]trunc" } } */