[Bug target/48252] New: problem with consecutive vzip, vuzp and vtrn

2011-03-23 Thread johan.kristell at axis dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48252

   Summary: problem with consecutive vzip, vuzp and vtrn
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: johan.krist...@axis.com


Consecutive vzip, vuzp or vtrn intrinsic overwrite destination register.

Compiler:

gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc/4.6/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc/4.6/libexec/gcc/armv7l-unknown-linux-gnueabi/4.6.0/lto-wrapper
Target: armv7l-unknown-linux-gnueabi
Configured with: ../gcc-4.6/configure --prefix=/usr/local/gcc/4.6
--enable-languages=c --with-arch=armv7-a --with-float=softfp
--with-fpu=vfpv3-d16
Thread model: posix
gcc version 4.6.0 20110323 (prerelease) (GCC) 


Test case:

#include 
#include 

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};
uint8x8x2_t vd1, vd2;
union {uint8x8_t v; uint8_t buf[8];} d1, d2, d3, d4;
int i;

vd1 = vzip_u8(v1, vdup_n_u8(0));
vd2 = vzip_u8(v2, vdup_n_u8(0));

vst1_u8(d1.buf, vd1.val[0]);
vst1_u8(d2.buf, vd1.val[1]);
vst1_u8(d3.buf, vd2.val[0]);
vst1_u8(d4.buf, vd2.val[1]);

printf("  d1  d2  d3  d4\n");
for (i = 0; i < 8; i++) {
printf("%4d%4d%4d%4d\n",
d1.buf[i],
d2.buf[i],
d3.buf[i],
d4.buf[i]);
}

return 0;
}

-

Compile flags: -mfloat-abi=softfp -mfpu=neon -O2

Output:

  d1  d2  d3  d4
   1   1   2   1
   0   0   0   0
   1   1   2   1
   0   0   0   0
   1   1   2   1
   0   0   0   0
   1   1   2   1
   0   0   0   0

d4 is wrong.


[Bug target/48252] ARM neon: problem with consecutive vzip, vuzp and vtrn

2011-03-29 Thread johan.kristell at axis dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48252

--- Comment #1 from Johan Kristell  2011-03-29 
07:18:37 UTC ---
Some additional info about the gcc version tested.

URL: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch
Revision: 171340