| 1 |
/* The goal is to have both compile tests which verify the desired instruction |
| 2 |
generation and to functionally test the builtins for correctness. This is |
| 3 |
done in separate test files, vsx-vector-6-func-cmp.c and |
| 4 |
vsx-vector-6-func-cmp-run.c. The vsx-vector-6-func-cmp.c test file only |
| 5 |
generates the calls so the instruction counts do not include the counts of |
| 6 |
the instructions generated as part of the result testing. The result |
| 7 |
checking code differs for BE/LE. */ |
| 8 |
|
| 9 |
#include <altivec.h> |
| 10 |
#include <stdio.h> |
| 11 |
#include <stdlib.h> |
| 12 |
|
| 13 |
void abort (void); |
| 14 |
|
| 15 |
#define FLOAT_TEST(NAME) \ |
| 16 |
vector bool int __attribute__ ((noipa)) \ |
| 17 |
float_##NAME (vector float f_src_a, vector float f_src_b) \ |
| 18 |
{ \ |
| 19 |
return vec_##NAME (f_src_a, f_src_b); \ |
| 20 |
} |
| 21 |
|
| 22 |
FLOAT_TEST (cmpeq) |
| 23 |
FLOAT_TEST (cmpgt) |
| 24 |
FLOAT_TEST (cmpge) |
| 25 |
FLOAT_TEST (cmplt) |
| 26 |
FLOAT_TEST (cmple) |
| 27 |
|
| 28 |
#define DOUBLE_TEST(NAME) \ |
| 29 |
vector bool long long __attribute__ ((noipa)) \ |
| 30 |
double_##NAME (vector double d_src_a, vector double d_src_b) \ |
| 31 |
{ \ |
| 32 |
return vec_##NAME (d_src_a, d_src_b); \ |
| 33 |
} |
| 34 |
|
| 35 |
DOUBLE_TEST (cmpeq) |
| 36 |
DOUBLE_TEST (cmpgt) |
| 37 |
DOUBLE_TEST (cmpge) |
| 38 |
DOUBLE_TEST (cmplt) |
| 39 |
DOUBLE_TEST (cmple) |
| 40 |
|