1 /* Verify that overloaded built-ins for vec_extract() with int
2 inputs produce the right code with a P9 (LE) target. */
4 /* { dg-do compile } */
5 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O2 " } */
6 /* { dg-require-effective-target powerpc_vsx } */
8 // Targeting P9 (LE). 6 tests total.
9 // P9 constant: li, vextuwrx, (1:extsw)
10 // P9 variables: slwi, vextuwrx, (1:extsw)
12 /* { dg-final { scan-assembler-times {\mli\M} 3 { target lp64 } } } */
13 /* { dg-final { scan-assembler-times {\mslwi\M} 3 { target lp64 } } } */
14 /* { dg-final { scan-assembler-times {\mvextuwrx\M|\mvextuwlx\M} 6 { target lp64 } } } */
15 /* { dg-final { scan-assembler-times {\mextsw\M} 2 { target lp64 } } } */
17 /* { dg-final { scan-assembler-times {\mrlwinm\M} 3 { target ilp32 } } } */
18 /* { dg-final { scan-assembler-times {\madd\M} 3 { target ilp32 } } } */
19 /* { dg-final { scan-assembler-times {\mstxv\M} 6 { target ilp32 } } } */
20 /* { dg-final { scan-assembler-times {\mlwz\M} 6 { target ilp32 } } } */
26 testbi_var (vector
bool int vbi2
, signed int si
)
28 return vec_extract (vbi2
, si
);
32 testsi_var (vector
signed int vsi2
, signed int si
)
34 return vec_extract (vsi2
, si
);
38 testui_var (vector
unsigned int vui2
, signed int si
)
40 return vec_extract (vui2
, si
);
44 testbi_cst (vector
bool int vbi2
)
46 return vec_extract (vbi2
, 12);
50 testsi_cst (vector
signed int vsi2
)
52 return vec_extract (vsi2
, 12);
56 testui_cst (vector
unsigned int vui2
)
58 return vec_extract (vui2
, 12);