Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / float128-hw.c
blob88f09a5adeb301a2cd8f3deea1c4fda9e486bf63
1 /* { dg-do compile { target lp64 } } */
2 /* { dg-options "-mvsx -O2" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power9" { target { ! has_arch_pwr9 } } } */
4 /* { dg-require-effective-target powerpc_vsx } */
5 /* { dg-require-effective-target float128 } */
7 #ifndef TYPE
8 #define TYPE _Float128
9 #endif
11 /* Test the code generation of the various _Float128 operations. */
12 TYPE f128_add (TYPE a, TYPE b) { return a+b; }
13 TYPE f128_sub (TYPE a, TYPE b) { return a-b; }
14 TYPE f128_mul (TYPE a, TYPE b) { return a*b; }
15 TYPE f128_div (TYPE a, TYPE b) { return a/b; }
16 TYPE f128_fma (TYPE a, TYPE b, TYPE c) { return (a*b)+c; }
17 TYPE f128_fms (TYPE a, TYPE b, TYPE c) { return (a*b)-c; }
18 TYPE f128_nfma (TYPE a, TYPE b, TYPE c) { return -((a*b)+c); }
19 TYPE f128_nfms (TYPE a, TYPE b, TYPE c) { return -((a*b)-c); }
20 TYPE f128_neg (TYPE a) { return -a; }
22 long f128_cmove (TYPE a, TYPE b, long c, long d) { return (a == b) ? c : d; }
24 double f128_to_double (TYPE a) { return (double)a; }
25 float f128_to_float (TYPE a) { return (float)a; }
26 long f128_to_long (TYPE a) { return (long)a; }
27 unsigned long f128_to_ulong (TYPE a) { return (unsigned long)a; }
28 int f128_to_int (TYPE a) { return (int)a; }
29 unsigned int f128_to_uint (TYPE a) { return (unsigned int)a; }
31 TYPE double_to_f128 (double a) { return (TYPE)a; }
32 TYPE float_to_f128 (float a) { return (TYPE)a; }
33 TYPE long_to_f128 (long a) { return (TYPE)a; }
34 TYPE ulong_to_f128 (unsigned long a) { return (TYPE)a; }
35 TYPE int_to_f128 (int a) { return (TYPE)a; }
36 TYPE uint_to_f128 (unsigned int a) { return (TYPE)a; }
38 /* { dg-final { scan-assembler {\mmfvsrd\M} } } */
39 /* { dg-final { scan-assembler {\mmfvsrwz\M} } } */
40 /* { dg-final { scan-assembler {\mmtvsrd\M} } } */
41 /* { dg-final { scan-assembler {\mmtvsrwa\M} } } */
42 /* { dg-final { scan-assembler {\mxscmpuqp\M} } } */
43 /* { dg-final { scan-assembler {\mxscvdpqp\M} } } */
44 /* { dg-final { scan-assembler {\mxscvqpdp\M} } } */
45 /* { dg-final { scan-assembler {\mxscvqpdpo\M} } } */
46 /* { dg-final { scan-assembler {\mxscvqpsdz\M} } } */
47 /* { dg-final { scan-assembler {\mxscvqpswz\M} } } */
48 /* { dg-final { scan-assembler {\mxscvqpudz\M} } } */
49 /* { dg-final { scan-assembler {\mxscvqpuwz\M} } } */
50 /* { dg-final { scan-assembler {\mxscvsdqp\M} } } */
51 /* { dg-final { scan-assembler {\mxscvudqp\M} } } */
52 /* { dg-final { scan-assembler {\mxsdivqp\M} } } */
53 /* { dg-final { scan-assembler {\mxsmaddqp\M} } } */
54 /* { dg-final { scan-assembler {\mxsmsubqp\M} } } */
55 /* { dg-final { scan-assembler {\mxsmulqp\M} } } */
56 /* { dg-final { scan-assembler {\mxsnegqp\M} } } */
57 /* { dg-final { scan-assembler {\mxsnmaddqp\M} } } */
58 /* { dg-final { scan-assembler {\mxsnmsubqp\M} } } */
59 /* { dg-final { scan-assembler {\mxssubqp\M} } } */
60 /* { dg-final { scan-assembler-not {\mbl\M} } } */