1 /* { dg-do compile { target le } } */
2 /* { dg-require-effective-target powerpc_p9vector_ok } */
3 /* { dg-options "-mdejagnu-cpu=power9 -O2" } */
4
5 /* Test generation of VPERMR/XXPERMR on ISA 3.0 in little endian. */
6
7 #include <altivec.h>
8
9 vector long long
permute(vector long long * p,vector long long * q,vector unsigned char mask)10 permute (vector long long *p, vector long long *q, vector unsigned char mask)
11 {
12 vector long long a = *p;
13 vector long long b = *q;
14
15 /* Force a, b to be in altivec registers to select vpermr insn. */
16 __asm__ (" # a: %x0, b: %x1" : "+v" (a), "+v" (b));
17
18 return vec_perm (a, b, mask);
19 }
20
21 /* { dg-final { scan-assembler "vpermr\|xxpermr" } } */
22