This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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: unassigned@gcc.gnu.org
        ReportedBy: johan.kristell@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 <arm_neon.h>
#include <stdio.h>

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]