Message ID | e6303ed9-5ba8-ac10-719c-9eb2a414d5f4@linux.ibm.com |
---|---|
State | New |
Headers | show |
Series | rs6000/test: Adjust fold-vec-extract-double.p9.c for BE [PR108810] | expand |
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c index 6c515035d1a..100f680fd02 100644 --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p9.c @@ -18,9 +18,15 @@ testd_var (vector double vd2, signed int si) return vec_extract (vd2, si); } +#ifdef __BIG_ENDIAN__ +#define LEFTMOST_ELEMENT_INDEX 0 +#else +#define LEFTMOST_ELEMENT_INDEX 1 +#endif + double testd_cst (vector double vd2) { - return vec_extract (vd2, 1); + return vec_extract (vd2, LEFTMOST_ELEMENT_INDEX); }