1 /* { dg-do compile { target { powerpc*-*-linux* } } } */
2 /* { dg-require-effective-target powerpc_float128_hw_ok } */
3 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
4 /* { dg-options "-O2 -mpower9-vector -mfloat128-hardware" } */
7 typedef _Complex
float float_complex
;
8 extern float_complex
cfloat1 (void);
9 extern float_complex
cfloat2 (void);
11 #define FLOAT_ARG(NAME, OP) ARG_OP(float, float_complex, NAME, OP)
12 #define FLOAT_PTR(NAME, OP) PTR_OP(float, float_complex, NAME, OP)
13 #define FLOAT_CALL() CALL_OP(float, float_complex, cfloat1, cfloat2)
16 #define FLOAT_ARG(NAME, OP)
17 #define FLOAT_PTR(NAME, OP)
22 typedef _Complex
double double_complex
;
23 extern double_complex
cdouble1 (void);
24 extern double_complex
cdouble2 (void);
26 #define DOUBLE_ARG(NAME, OP) ARG_OP(double, double_complex, NAME, OP)
27 #define DOUBLE_PTR(NAME, OP) PTR_OP(double, double_complex, NAME, OP)
28 #define DOUBLE_CALL() CALL_OP(double, double_complex, cdouble1, cdouble2)
31 #define DOUBLE_ARG(NAME, OP)
32 #define DOUBLE_PTR(NAME, OP)
38 typedef _Complex
float __attribute__((mode(KC
))) float128_complex
;
40 typedef _Complex
float __attribute__((mode(TC
))) float128_complex
;
43 extern float128_complex
cfloat128_1 (void);
44 extern float128_complex
cfloat128_2 (void);
46 #define FLOAT128_ARG(NAME, OP) ARG_OP(float128, float128_complex, NAME, OP)
47 #define FLOAT128_PTR(NAME, OP) PTR_OP(float128, float128_complex, NAME, OP)
48 #define FLOAT128_CALL() CALL_OP(float128, float128_complex, cfloat128_1, cfloat128_2)
51 #define FLOAT128_ARG(NAME, OP)
52 #define FLOAT128_PTR(NAME, OP)
53 #define FLOAT128_CALL()
57 typedef _Complex
long double ldouble_complex
;
58 extern ldouble_complex
cldouble1 (void);
59 extern ldouble_complex
cldouble2 (void);
61 #define LDOUBLE_ARG(NAME, OP) ARG_OP(ldouble, ldouble_complex, NAME, OP)
62 #define LDOUBLE_PTR(NAME, OP) PTR_OP(ldouble, ldouble_complex, NAME, OP)
63 #define LDOUBLE_CALL() CALL_OP(ldouble, ldouble_complex, cldouble1, cldouble2)
66 #define LDOUBLE_ARG(NAME, OP)
67 #define LDOUBLE_PTR(NAME, OP)
68 #define LDOUBLE_CALL()
72 #define ARG_OP(SUFFIX, TYPE, NAME, OP) \
73 TYPE arg_ ## NAME ## _ ## SUFFIX (TYPE a, TYPE b) \
78 #define PTR_OP(SUFFIX, TYPE, NAME, OP) \
79 void ptr_ ## NAME ## _ ## SUFFIX (TYPE *p, TYPE *a, TYPE *b) \
84 #define CALL_OP(SUFFIX, TYPE, FUNC1, FUNC2) \
85 TYPE call_ ## SUFFIX (void) \
87 TYPE value1 = FUNC1 (); \
88 TYPE value2 = FUNC2 (); \
89 return value1 + value2; \
103 FLOAT128_ARG (sub
, -)
110 FLOAT128_ARG (mul
, *)
117 FLOAT128_ARG (div
, /)
126 FLOAT128_PTR (add
, +)
133 FLOAT128_PTR (sub
, -)
140 FLOAT128_PTR (mul
, *)
147 FLOAT128_PTR (div
, /)
159 /* { dg-final { scan-assembler "xsaddqp" } } */
160 /* { dg-final { scan-assembler "xssubqp" } } */