1 /* { dg-do run { target { power10_hw } } } */
2 /* { dg-do link { target { ! power10_hw } } } */
3 /* { dg-require-effective-target power10_ok } */
4 /* { dg-options "-mdejagnu-cpu=power10" } */
8 extern void abort (void);
10 vector
unsigned long long int
11 do_vec_cnttzm (vector
unsigned long long int source
,
12 vector
unsigned long long int mask
)
14 return vec_cnttzm (source
, mask
);
17 int main (int argc
, char *argv
[])
19 vector
unsigned long long int source_a
= { 0xa5f07e3cull
, 0x7e3ca5f0ull
};
20 vector
unsigned long long int source_b
= { 0x3ca5f07eull
, 0x5a0fe7c3ull
};
22 vector
unsigned long long int mask_a
= { 0xffff0000ull
, 0x0000ffffull
};
23 vector
unsigned long long int mask_b
= { 0x0f0f0f0full
, 0xf0f0f0f0ull
};
25 /* See cnttzdm-0.c for derivation of expected results.
27 result_aa [0] is compute (source [0], mask [0];
28 result_aa [1] is compute (source [1], mask [1].
30 result_ab [0] is compute (source [0], mask [2];
31 result_ab [1] is compute (source [1], mask [3].
33 result_ba [0] is compute (source [2], mask [0];
34 result_ba [1] is compute (source [3], mask [1].
36 result_bb [0] is compute (source [2], mask [2];
37 result_bb [1] is compute (source [3], mask [3]. */
39 vector
unsigned long long int result_aa
= { 4, 4 };
40 vector
unsigned long long int result_ab
= { 2, 0 };
41 vector
unsigned long long int result_ba
= { 0, 0 };
42 vector
unsigned long long int result_bb
= { 1, 2 };
44 if (!vec_all_eq (do_vec_cnttzm (source_a
, mask_a
), result_aa
))
46 if (!vec_all_eq (do_vec_cnttzm (source_a
, mask_b
), result_ab
))
48 if (!vec_all_eq (do_vec_cnttzm (source_b
, mask_a
),result_ba
))
50 if (!vec_all_eq (do_vec_cnttzm (source_b
, mask_b
), result_bb
))