Fix gcc.target/aarch64/vec_zeroextend.c for big-endian

vec_zeroextend.c fails on big-endian as it assumes
0 index is the lower part but it is not for
big-endian case.  This fixes the problem by
using the correct index for the lower part
for big-endian.

Committed as obvious after a test on aarch64_be-linux-gnu.

ChangeLog:
* gcc.target/aarch64/vec_zeroextend.c: Fix for big-endian.
This commit is contained in:
Andrew Pinski 2020-01-25 05:20:38 +00:00
parent 9c1179c339
commit 53d172975f
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2020-01-25 Andrew Pinski <apinski@marvell.com>
* gcc.target/aarch64/vec_zeroextend.c: Fix for big-endian.
2020-01-24 Jeff Law <law@redhat.com
PR tree-optimization/92788

View file

@ -3,17 +3,21 @@
#define vector __attribute__((vector_size(16) ))
#define lowull (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1 : 0)
#define lowui (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 3 : 0)
vector unsigned long long
f1(vector unsigned long long b, vector unsigned int a)
{
b[0] = a[0];
b[lowull] = a[lowui];
return b;
}
unsigned long long
f2(vector unsigned int a)
{
return a[0];
return a[lowui];
}
/* { dg-final { scan-assembler-times {fmov} 2 } } */