neon-vset_lanes8.c, [...]: Fix for big-endian support.

2012-09-11  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/arm/neon-vset_lanes8.c, gcc.target/arm/pr51835.c,
	gcc.target/arm/pr48252.c: Fix for big-endian support.

From-SVN: r191200
This commit is contained in:
Christophe Lyon 2012-09-11 19:52:18 +00:00 committed by Christophe Lyon
parent 148e45e516
commit 856ba7a46e
4 changed files with 28 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2012-09-11 Christophe Lyon <christophe.lyon@linaro.org>
gcc/testsuite/
* gcc.target/arm/neon-vset_lanes8.c, gcc.target/arm/pr51835.c,
gcc.target/arm/pr48252.c: Fix for big-endian support.
2012-09-11 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/tree-ssa/forwprop-22.c: New testcase.

View File

@ -9,11 +9,14 @@
#include <stdlib.h>
#include <string.h>
int8x8_t x = { 1, 2, 3, 4, 5, 6, 7, 8 };
int8x8_t y = { 1, 2, 3, 16, 5, 6, 7, 8 };
int8_t x_init[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
int8_t y_init[8] = { 1, 2, 3, 16, 5, 6, 7, 8 };
int main (void)
{
int8x8_t x = vld1_s8 (x_init);
int8x8_t y = vld1_s8 (y_init);
x = vset_lane_s8 (16, x, 3);
if (memcmp (&x, &y, sizeof (x)) != 0)
abort();

View File

@ -8,11 +8,14 @@
int main(void)
{
uint8x8_t v1 = {1, 1, 1, 1, 1, 1, 1, 1};
uint8x8_t v2 = {2, 2, 2, 2, 2, 2, 2, 2};
uint8_t v1_init[8] = {1, 1, 1, 1, 1, 1, 1, 1};
uint8_t v2_init[8] = {2, 2, 2, 2, 2, 2, 2, 2};
uint8x8_t v1 = vld1_u8 (v1_init);
uint8x8_t v2 = vld1_u8 (v2_init);
uint8x8x2_t vd1, vd2;
union {uint8x8_t v; uint8_t buf[8];} d1, d2, d3, d4;
int i;
uint8_t odd, even;
vd1 = vzip_u8(v1, vdup_n_u8(0));
vd2 = vzip_u8(v2, vdup_n_u8(0));
@ -22,9 +25,17 @@ int main(void)
vst1_u8(d3.buf, vd2.val[0]);
vst1_u8(d4.buf, vd2.val[1]);
#ifdef __ARMEL__
odd = 1;
even = 0;
#else
odd = 0;
even = 1;
#endif
for (i = 0; i < 8; i++)
if ((i % 2 == 0 && d4.buf[i] != 2)
|| (i % 2 == 1 && d4.buf[i] != 0))
if ((i % 2 == even && d4.buf[i] != 2)
|| (i % 2 == odd && d4.buf[i] != 0))
abort ();
return 0;

View File

@ -11,4 +11,5 @@ unsigned int func2 (double d)
return (unsigned int)d;
}
/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r0,\[\\t \]*r1,\[\\t \]*d0" 2 } } */
/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r0,\[\\t \]*r1,\[\\t \]*d0" 2 { target { arm_little_endian } } } } */
/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r1,\[\\t \]*r0,\[\\t \]*d0" 2 { target { ! arm_little_endian } } } } */