1 /* { dg-do compile { target { powerpc*-*-linux* } } } */
2 /* { dg-require-effective-target powerpc_float128_sw_ok } */
3 /* { dg-options "-O2 -mvsx" } */
6 typedef _Complex
float float_complex
;
7 extern float_complex
cfloat1 (void);
8 extern float_complex
cfloat2 (void);
10 #define FLOAT_ARG(NAME, OP) ARG_OP(float, float_complex, NAME, OP)
11 #define FLOAT_PTR(NAME, OP) PTR_OP(float, float_complex, NAME, OP)
12 #define FLOAT_CALL() CALL_OP(float, float_complex, cfloat1, cfloat2)
15 #define FLOAT_ARG(NAME, OP)
16 #define FLOAT_PTR(NAME, OP)
21 typedef _Complex
double double_complex
;
22 extern double_complex
cdouble1 (void);
23 extern double_complex
cdouble2 (void);
25 #define DOUBLE_ARG(NAME, OP) ARG_OP(double, double_complex, NAME, OP)
26 #define DOUBLE_PTR(NAME, OP) PTR_OP(double, double_complex, NAME, OP)
27 #define DOUBLE_CALL() CALL_OP(double, double_complex, cdouble1, cdouble2)
30 #define DOUBLE_ARG(NAME, OP)
31 #define DOUBLE_PTR(NAME, OP)
37 typedef _Complex
float __attribute__((mode(KC
))) float128_complex
;
39 typedef _Complex
float __attribute__((mode(TC
))) float128_complex
;
42 extern float128_complex
cfloat128_1 (void);
43 extern float128_complex
cfloat128_2 (void);
45 #define FLOAT128_ARG(NAME, OP) ARG_OP(float128, float128_complex, NAME, OP)
46 #define FLOAT128_PTR(NAME, OP) PTR_OP(float128, float128_complex, NAME, OP)
47 #define FLOAT128_CALL() CALL_OP(float128, float128_complex, cfloat128_1, cfloat128_2)
50 #define FLOAT128_ARG(NAME, OP)
51 #define FLOAT128_PTR(NAME, OP)
52 #define FLOAT128_CALL()
56 typedef _Complex
long double ldouble_complex
;
57 extern ldouble_complex
cldouble1 (void);
58 extern ldouble_complex
cldouble2 (void);
60 #define LDOUBLE_ARG(NAME, OP) ARG_OP(ldouble, ldouble_complex, NAME, OP)
61 #define LDOUBLE_PTR(NAME, OP) PTR_OP(ldouble, ldouble_complex, NAME, OP)
62 #define LDOUBLE_CALL() CALL_OP(ldouble, ldouble_complex, cldouble1, cldouble2)
65 #define LDOUBLE_ARG(NAME, OP)
66 #define LDOUBLE_PTR(NAME, OP)
67 #define LDOUBLE_CALL()
71 #define ARG_OP(SUFFIX, TYPE, NAME, OP) \
72 TYPE arg_ ## NAME ## _ ## SUFFIX (TYPE a, TYPE b) \
77 #define PTR_OP(SUFFIX, TYPE, NAME, OP) \
78 void ptr_ ## NAME ## _ ## SUFFIX (TYPE *p, TYPE *a, TYPE *b) \
83 #define CALL_OP(SUFFIX, TYPE, FUNC1, FUNC2) \
84 TYPE call_ ## SUFFIX (void) \
86 TYPE value1 = FUNC1 (); \
87 TYPE value2 = FUNC2 (); \
88 return value1 + value2; \
102 FLOAT128_ARG (sub
, -)
109 FLOAT128_ARG (mul
, *)
116 FLOAT128_ARG (div
, /)
125 FLOAT128_PTR (add
, +)
132 FLOAT128_PTR (sub
, -)
139 FLOAT128_PTR (mul
, *)
146 FLOAT128_PTR (div
, /)