Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / float128-hw2.c
blob118bed625375d2e81143121918cd2c294072a10f
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-require-effective-target powerpc_p9vector_ok } */
3 /* { dg-options "-mpower9-vector -O2 -ffast-math -std=gnu11" } */
5 /* Test to make sure the compiler handles the standard _Float128 functions that
6 have hardware support in ISA 3.0/power9. */
8 #define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
10 #ifndef __FP_FAST_FMAF128
11 #error "__FP_FAST_FMAF128 should be defined."
12 #endif
14 extern _Float128 copysignf128 (_Float128, _Float128);
15 extern _Float128 sqrtf128 (_Float128);
16 extern _Float128 fmaf128 (_Float128, _Float128, _Float128);
17 extern _Float128 ceilf128 (_Float128);
18 extern _Float128 floorf128 (_Float128);
19 extern _Float128 truncf128 (_Float128);
20 extern _Float128 roundf128 (_Float128);
22 _Float128
23 do_copysign (_Float128 a, _Float128 b)
25 return copysignf128 (a, b);
28 _Float128
29 do_sqrt (_Float128 a)
31 return sqrtf128 (a);
34 _Float128
35 do_fma (_Float128 a, _Float128 b, _Float128 c)
37 return fmaf128 (a, b, c);
40 _Float128
41 do_fms (_Float128 a, _Float128 b, _Float128 c)
43 return fmaf128 (a, b, -c);
46 _Float128
47 do_nfma (_Float128 a, _Float128 b, _Float128 c)
49 return -fmaf128 (a, b, c);
52 _Float128
53 do_nfms (_Float128 a, _Float128 b, _Float128 c)
55 return -fmaf128 (a, b, -c);
58 _Float128
59 do_ceil (_Float128 a)
61 return ceilf128 (a);
64 _Float128
65 do_floor (_Float128 a)
67 return floorf128 (a);
70 _Float128
71 do_trunc (_Float128 a)
73 return truncf128 (a);
76 _Float128
77 do_round (_Float128 a)
79 return roundf128 (a);
82 /* { dg-final { scan-assembler {\mxscpsgnqp\M} } } */
83 /* { dg-final { scan-assembler {\mxssqrtqp\M} } } */
84 /* { dg-final { scan-assembler {\mxsmaddqp\M} } } */
85 /* { dg-final { scan-assembler {\mxsmsubqp\M} } } */
86 /* { dg-final { scan-assembler {\mxsnmaddqp\M} } } */
87 /* { dg-final { scan-assembler {\mxsnmsubqp\M} } } */
88 /* { dg-final { scan-assembler {\mxsrqpi\M} } } */
89 /* { dg-final { scan-assembler-not {\mbl\M} } } */