1 /* { dg-do run { target lp64 } } */
2 /* { dg-require-effective-target vsx_hw } */
3 /* { dg-options "-O2 -mvsx" } */
7 /* This file just generates calls to the various builtins and verifies the
8 expected number of instructions for each builtin were generated. */
10 #include "vsx-vector-6-func-cmp.h"
12 /* Macros to check the results of the builtin tests. */
13 #define FLOAT_CHECK(NAME) \
14 f_result = vec_##NAME (f_src_a, f_src_b); \
16 if ((f_result[0] != f_##NAME##_expected[0]) \
17 || (f_result[1] != f_##NAME##_expected[1]) \
18 || (f_result[2] != f_##NAME##_expected[2]) \
19 || (f_result[3] != f_##NAME##_expected[3])) \
23 printf("ERROR: vec_%s (float) expected value does not match\n", \
25 printf(" expected[0] = 0x%x; result[0] =0x%x\n", \
26 f_##NAME##_expected[0], f_result[0]); \
27 printf(" expected[1] = 0x%x; result[1] = 0x%x\n", \
28 f_##NAME##_expected[1], f_result[1]); \
29 printf(" expected[2] = 0x%x; result[2] = 0x%x\n", \
30 f_##NAME##_expected[2], f_result[2]); \
31 printf(" expected[3] = 0x%x; result[3] = 0x%x\n", \
32 f_##NAME##_expected[3], f_result[3]); \
38 #define DOUBLE_CHECK(NAME) \
39 d_result = vec_##NAME (d_src_a, d_src_b); \
41 if ((d_result[0] != d_##NAME##_expected[0]) \
42 || (d_result[1] != d_##NAME##_expected[1])) \
46 printf("ERROR: vec_%s (double) expected value does not match\n", \
48 printf(" expected[0] = 0x%lx; result[0] = 0x%lx\n", \
49 d_##NAME##_expected[0], d_result[0]); \
50 printf(" expected[1] = 0x%lx; result[1] = 0x%lx\n", \
51 d_##NAME##_expected[1], d_result[1]); \
60 vector
float f_src_a
= { 126.0, 23.0, -338.0, 17.0};
61 vector
float f_src_b
= { 2.00, 23.0, 1.0, 4.0};
63 vector
bool int f_cmpeq_expected
= {0x0, 0xFFFFFFFF, 0x0, 0x0};
64 vector
bool int f_cmpgt_expected
= {0xFFFFFFFF, 0x0, 0x0, 0xFFFFFFFF};
65 vector
bool int f_cmpge_expected
= {0xFFFFFFFF, 0xFFFFFFFF, 0x0, 0xFFFFFFFF};
66 vector
bool int f_cmplt_expected
= {0x0, 0x0, 0xFFFFFFFF, 0x0};
67 vector
bool int f_cmple_expected
= {0x0, 0xFFFFFFFF, 0xFFFFFFFF, 0x0};
69 vector
double d_src_a
= { 125.44, -338.56};
70 vector
double d_src_b
= { 4.0, -338.56};
71 vector
bool long long d_result
;
72 vector
bool long long d_cmpeq_expected
= {0x0, 0xFFFFFFFFFFFFFFFF};
73 vector
bool long long d_cmpgt_expected
= {0xFFFFFFFFFFFFFFFF, 0x0};
74 vector
bool long long d_cmpge_expected
= {0xFFFFFFFFFFFFFFFF,
76 vector
bool long long d_cmplt_expected
= {0x0, 0x0};
77 vector
bool long long d_cmple_expected
= {0x0, 0xFFFFFFFFFFFFFFFF};