Skip to content

Commit

Permalink
neon-vset_lanes8.c, [...]: Fix for big-endian support.
Browse files Browse the repository at this point in the history
2012-09-11  Christophe Lyon  <[email protected]>

	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
  • Loading branch information
Christophe Lyon authored and Christophe Lyon committed Sep 11, 2012
1 parent 148e45e commit 856ba7a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
6 changes: 6 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2012-09-11 Christophe Lyon <[email protected]>

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 <[email protected]>

* gcc.dg/tree-ssa/forwprop-22.c: New testcase.
Expand Down
7 changes: 5 additions & 2 deletions gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
19 changes: 15 additions & 4 deletions gcc/testsuite/gcc.target/arm/pr48252.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion gcc/testsuite/gcc.target/arm/pr51835.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 } } } } */

0 comments on commit 856ba7a

Please sign in to comment.