* gcc.target/powerpc/builtins-1-be.c <vclzb>: Rename duplicate test
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-xxbr-1.c
blob7a07d0f8f2ada89a145fd1deceed27998ad4ccad
1 /* { dg-do compile { target { powerpc*-*-* && { lp64 && p9vector_hw } } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
3 /* { dg-require-effective-target powerpc_p9vector_ok } */
4 /* { dg-options "-mcpu=power9 -O3" } */
6 #include <altivec.h>
8 /* Verify P9 vec_revb builtin generates the XXBR{Q,D,W,H} instructions. */
10 vector char
11 rev_char (vector char a)
13 return vec_revb (a); /* Is a NOP, maps to move inst */
16 vector bool char
17 rev_bool_char (vector bool char a)
19 return vec_revb (a); /* Is a NOP, maps to move inst */
22 vector signed char
23 rev_schar (vector signed char a)
25 return vec_revb (a); /* Is a NOP, maps to move inst */
28 vector unsigned char
29 rev_uchar (vector unsigned char a)
31 return vec_revb (a); /* Is a NOP, maps to move inst */
34 vector short
35 rev_short (vector short a)
37 return vec_revb (a); /* XXBRH. */
40 vector bool short
41 rev_bool_short (vector bool short a)
43 return vec_revb (a); /* XXBRH. */
46 vector unsigned short
47 rev_ushort (vector unsigned short a)
49 return vec_revb (a); /* XXBRH. */
52 vector int
53 rev_int (vector int a)
55 return vec_revb (a); /* XXBRW. */
58 vector bool int
59 rev_bool_int (vector bool int a)
61 return vec_revb (a); /* XXBRW. */
64 vector unsigned int
65 rev_uint (vector unsigned int a)
67 return vec_revb (a); /* XXBRW. */
70 vector float
71 rev_float (vector float a)
73 return vec_revb (a); /* XXBRW. */
76 vector double
77 rev_double (vector double a)
79 return vec_revb (a); /* XXBRD. */
82 /* { dg-final { scan-assembler-times "xxbrd" 1 } } */
83 /* { dg-final { scan-assembler-times "xxbrh" 3 } } */
84 /* { dg-final { scan-assembler-times "xxbrw" 4 } } */