4 #define ARRAY_SIZE(X) (sizeof(X) / sizeof(*(X)))
6 static uint64_t test_clo_##N(uint64_t rj) \
10 asm volatile("clo."#N" %0, %1\n\t" \
18 static uint64_t test_clz_##N(uint64_t rj) \
22 asm volatile("clz."#N" %0, %1\n\t" \
30 static uint64_t test_cto_##N(uint64_t rj) \
34 asm volatile("cto."#N" %0, %1\n\t" \
42 static uint64_t test_ctz_##N(uint64_t rj) \
46 asm volatile("ctz."#N" %0, %1\n\t" \
63 uint64_t (*func
)(uint64_t);
68 static struct vector vectors
[] = {
69 {test_clo_w
, 0xfff11fff392476ab, 0},
70 {test_clo_d
, 0xabd28a64000000, 0},
71 {test_clz_w
, 0xfaffff42392476ab, 2},
72 {test_clz_d
, 0xabd28a64000000, 8},
73 {test_cto_w
, 0xfff11fff392476ab, 2},
74 {test_cto_d
, 0xabd28a64000000, 0},
75 {test_ctz_w
, 0xfaffff42392476ab, 0},
76 {test_ctz_d
, 0xabd28a64000000, 26},
83 for (i
= 0; i
< ARRAY_SIZE(vectors
); i
++) {
84 assert((*vectors
[i
].func
)(vectors
[i
].u
) == vectors
[i
].r
);