From: Michael Meissner Date: Tue, 24 May 2016 17:21:18 +0000 (+0000) Subject: p9-vpermr.c: New test for ISA 3.0 vpermr support. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27bad558289e5d2a8e9d974ebcf9715c896139af;p=gcc.git p9-vpermr.c: New test for ISA 3.0 vpermr support. gcc/testsuite/ChangeLog: 2016-05-24 Michael Meissner Kelvin Nilsen * gcc.target/powerpc/p9-vpermr.c: New test for ISA 3.0 vpermr support. Co-Authored-By: Kelvin Nilsen From-SVN: r236655 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d27369c87f5..3eef44ef92e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-05-24 Michael Meissner + Kelvin Nilsen + + * gcc.target/powerpc/p9-vpermr.c: New test for ISA 3.0 vpermr + support. + 2016-05-24 Paolo Carlini PR c++/69872 diff --git a/gcc/testsuite/gcc.target/powerpc/p9-vpermr.c b/gcc/testsuite/gcc.target/powerpc/p9-vpermr.c new file mode 100644 index 00000000000..7e7a266e1ec --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/p9-vpermr.c @@ -0,0 +1,21 @@ +/* { dg-do compile { target { powerpc64le-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-options "-mcpu=power9 -O2" } */ + +/* Test generation of VPERMR/XXPERMR on ISA 3.0 in little endian. */ + +#include + +vector long long +permute (vector long long *p, vector long long *q, vector unsigned char mask) +{ + vector long long a = *p; + vector long long b = *q; + + /* Force a, b to be in altivec registers to select vpermr insn. */ + __asm__ (" # a: %x0, b: %x1" : "+v" (a), "+v" (b)); + + return vec_perm (a, b, mask); +} + +/* { dg-final { scan-assembler "vpermr\|xxpermr" } } */