1 /* { dg-do run { target { power10_hw } } } */
2 /* { dg-do link { target { ! power10_hw } } } */
3 /* { dg-options "-mdejagnu-cpu=power10 -O2" } */
4 /* { dg-require-effective-target { int128 && power10_ok } } */
6 /* Check that the expected 128-bit instructions are generated if the processor
7 supports the 128-bit integer instructions. */
8 /* { dg-final { scan-assembler-times {\mvcntmbb\M} 1 } } */
9 /* { dg-final { scan-assembler-times {\mvcntmbh\M} 1 } } */
10 /* { dg-final { scan-assembler-times {\mvcntmbw\M} 1 } } */
11 /* { dg-final { scan-assembler-times {\mvcntmbd\M} 1 } } */
26 unsigned long long arg1
;
28 vector
unsigned char vbc_result_bi
, vbc_expected_result_bi
;
29 vector
unsigned short vbc_result_hi
, vbc_expected_result_hi
;
30 vector
unsigned int vbc_result_wi
, vbc_expected_result_wi
;
31 vector
unsigned long long vbc_result_di
, vbc_expected_result_di
;
32 vector __uint128_t vbc_result_qi
, vbc_expected_result_qi
;
34 unsigned int result_wi
, expected_result_wi
;
35 unsigned long long result
, expected_result
;
36 const unsigned char mp
=1;
37 vector
unsigned char vbc_bi_src
;
38 vector
unsigned short vbc_hi_src
;
39 vector
unsigned int vbc_wi_src
;
40 vector
unsigned long long vbc_di_src
;
41 vector __uint128_t vbc_qi_src
;
58 vbc_bi_src
[13] = 0xFF;
59 vbc_bi_src
[14] = 0xFF;
60 vbc_bi_src
[15] = 0xFF;
64 result
= vec_cntm (vbc_bi_src
, 1);
65 /* Note count is put in bits[0:7], IBM numbering, of the 64-bit result */
66 result
= result
>> (64-8);
68 if (result
!= expected_result
) {
70 printf("ERROR: char vec_cntm(arg) ");
71 printf("count %llu does not match expected count = %llu\n",
72 result
, expected_result
);
80 vbc_hi_src
[0] = 0xFFFF;
81 vbc_hi_src
[1] = 0xFFFF;
86 vbc_hi_src
[6] = 0xFFFF;
87 vbc_hi_src
[7] = 0xFFFF;
91 result
= vec_cntm (vbc_hi_src
, 1);
92 /* Note count is put in bits[0:6], IBM numbering, of the 64-bit result */
93 result
= result
>> (64-7);
95 if (result
!= expected_result
) {
97 printf("ERROR: short vec_cntm(arg) ");
98 printf("count %llu does not match expected count = %llu\n",
99 result
, expected_result
);
107 vbc_wi_src
[0] = 0xFFFFFFFF;
108 vbc_wi_src
[1] = 0xFFFFFFFF;
114 result
= vec_cntm (vbc_wi_src
, 1);
115 /* Note count is put in bits[0:5], IBM numbering, of the 64-bit result */
116 result
= result
>> (64-6);
118 if (result
!= expected_result
) {
120 printf("ERROR: word vec_cntm(arg) ");
121 printf("count %llu does not match expected count = %llu\n",
122 result
, expected_result
);
130 vbc_di_src
[0] = 0xFFFFFFFFFFFFFFFFULL
;
131 vbc_di_src
[1] = 0xFFFFFFFFFFFFFFFFULL
;
135 result
= vec_cntm (vbc_di_src
, 1);
136 /* Note count is put in bits[0:4], IBM numbering, of the 64-bit result */
137 result
= result
>> (64-5);
139 if (result
!= expected_result
) {
141 printf("ERROR: double vec_cntm(arg) ");
142 printf("count %llu does not match expected count = %llu\n",
143 result
, expected_result
);