[RS6000] Tests that use int128_t and -m32
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / float128-odd.c
blob8c8a34c74caeb5bb06985e8e5d0a5f9819c9827f
1 /* { dg-do compile { target lp64 } } */
2 /* { dg-require-effective-target powerpc_p9vector_ok } */
3 /* { dg-require-effective-target float128 } */
4 /* { dg-options "-mpower9-vector -O2" } */
6 /* Test the generation of the round to odd instructions. */
7 __float128
8 f128_add(__float128 a, __float128 b)
10 return __builtin_addf128_round_to_odd (a, b);
13 __float128
14 f128_sub (__float128 a, __float128 b)
16 return __builtin_subf128_round_to_odd (a, b);
19 __float128
20 f128_mul (__float128 a, __float128 b)
22 return __builtin_mulf128_round_to_odd (a, b);
25 __float128
26 f128_div (__float128 a, __float128 b)
28 return __builtin_divf128_round_to_odd (a, b);
31 __float128
32 f128_sqrt (__float128 a)
34 return __builtin_sqrtf128_round_to_odd (a);
37 double
38 f128_trunc (__float128 a)
40 return __builtin_truncf128_round_to_odd (a);
43 __float128
44 f128_fma (__float128 a, __float128 b, __float128 c)
46 return __builtin_fmaf128_round_to_odd (a, b, c);
49 __float128
50 f128_fms (__float128 a, __float128 b, __float128 c)
52 return __builtin_fmaf128_round_to_odd (a, b, -c);
55 __float128
56 f128_nfma (__float128 a, __float128 b, __float128 c)
58 return - __builtin_fmaf128_round_to_odd (a, b, c);
61 __float128
62 f128_nfms (__float128 a, __float128 b, __float128 c)
64 return - __builtin_fmaf128_round_to_odd (a, b, -c);
67 /* { dg-final { scan-assembler {\mxsaddqpo\M} } } */
68 /* { dg-final { scan-assembler {\mxssubqpo\M} } } */
69 /* { dg-final { scan-assembler {\mxsmulqpo\M} } } */
70 /* { dg-final { scan-assembler {\mxsdivqpo\M} } } */
71 /* { dg-final { scan-assembler {\mxssqrtqpo\M} } } */
72 /* { dg-final { scan-assembler {\mxscvqpdpo\M} } } */
73 /* { dg-final { scan-assembler {\mxsmaddqpo\M} } } */
74 /* { dg-final { scan-assembler {\mxsmsubqpo\M} } } */
75 /* { dg-final { scan-assembler {\mxsnmaddqpo\M} } } */
76 /* { dg-final { scan-assembler {\mxsnmsubqpo\M} } } */