1 /* { dg-do compile } */
2 /* { dg-options "-mdejagnu-cpu=power10" } */
6 extern void abort (void);
8 vector
unsigned long long int
9 do_vec_pdep (vector
unsigned long long int source
,
10 vector
unsigned long long int mask
) {
11 return vec_pdep (source
, mask
);
15 vectors_equal (vector
unsigned long long int a
,
16 vector
unsigned long long int b
)
18 return (a
[0] == b
[0]) && (a
[1] == b
[1]);
22 main (int argc
, char *argv
[])
24 vector
unsigned long long int source_a
= { 0xa5f07e3cull
, 0x7e3ca5f0ull
};
25 vector
unsigned long long int source_b
= { 0x3ca5f07eull
, 0x5a0fe7c3ull
};
27 vector
unsigned long long int mask_a
= { 0xffff0000ull
, 0x0000ffffull
};
28 vector
unsigned long long int mask_b
= { 0x0f0f0f0full
, 0xf0f0f0f0ull
};
30 /* See pdepd-0.c for derivation of expected results.
32 result_aa [0] is compute (source [0], mask [0];
33 result_aa [1] is compute (source [1], mask [1].
35 result_ab [0] is compute (source [0], mask [2];
36 result_ab [1] is compute (source [1], mask [3].
38 result_ba [0] is compute (source [2], mask [0];
39 result_ba [1] is compute (source [3], mask [1].
41 result_bb [0] is compute (source [2], mask [2];
42 result_bb [1] is compute (source [3], mask [3]. */
44 vector
unsigned long long int result_aa
= { 0x7e3c0000ull
, 0x0000a5f0ull
};
45 vector
unsigned long long int result_ab
= { 0x070e030cull
, 0xa050f000ull
};
46 vector
unsigned long long int result_ba
= { 0xf07e0000ull
, 0x0000e7c3ull
};
47 vector
unsigned long long int result_bb
= { 0x0f00070eull
, 0xe070c030ull
};
49 if (!vec_all_eq (do_vec_pdep (source_a
, mask_a
), result_aa
))
51 if (!vec_all_eq (do_vec_pdep (source_a
, mask_b
), result_ab
))
53 if (!vec_all_eq (do_vec_pdep (source_b
, mask_a
), result_ba
))
55 if (!vec_all_eq (do_vec_pdep (source_b
, mask_b
), result_bb
))
61 /* { dg-final { scan-assembler {\mvpdepd\M} } } */