1 /* Test vadd works correctly. */
3 /* { dg-options "--save-temps" } */
7 #define FLT_EPSILON __FLT_EPSILON__
8 #define DBL_EPSILON __DBL_EPSILON__
10 #define TESTA0 0.33333
11 #define TESTA1 -1.7777
13 #define TESTA3 1.23456
14 /* 2^54, double has 53 significand bits
15 according to Double-precision floating-point format. */
16 #define TESTA4 18014398509481984
17 #define TESTA5 (1.0 / TESTA4)
19 #define TESTB0 0.66667
29 #define ANSW3 -0.76544
33 extern void abort (void);
35 #define EPSILON __DBL_EPSILON__
36 #define ABS(a) __builtin_fabs (a)
37 #define ISNAN(a) __builtin_isnan (a)
38 #define FP_equals(a, b, epsilon) \
41 || (ISNAN (a) && ISNAN (b)) \
42 || (ABS (a - b) < epsilon) \
57 if (!FP_equals (a
, c
, EPSILON
))
65 if (!FP_equals (a
, c
, EPSILON
))
73 if (!FP_equals (a
, c
, EPSILON
))
81 if (!FP_equals (a
, c
, EPSILON
))
89 if (!FP_equals (a
, c
, EPSILON
))
97 if (!FP_equals (a
, c
, EPSILON
))
103 /* { dg-final { scan-assembler-times "fadd\\td\[0-9\]+, d\[0-9\]+, d\[0-9\]+" 6 } } */
106 main (int argc
, char **argv
)
108 if (test_vadd_f64 ())
114 /* { dg-final { cleanup-saved-temps } } */