1 /* { dg-do run { target { power10_hw } } } */
2 /* { dg-do link { target { ! power10_hw } } } */
3 /* { dg-options "-mdejagnu-cpu=power10 -O2 -save-temps" } */
4 /* { dg-require-effective-target power10_ok } */
5 /* { dg-require-effective-target int128 } */
7 /* Check that the expected 128-bit instructions are generated if the processor
8 supports the 128-bit integer instructions. */
9 /* { dg-final { scan-assembler-times {\mvcntmbb\M} 1 } } */
10 /* { dg-final { scan-assembler-times {\mvcntmbh\M} 1 } } */
11 /* { dg-final { scan-assembler-times {\mvcntmbw\M} 1 } } */
12 /* { dg-final { scan-assembler-times {\mvcntmbd\M} 1 } } */
27 unsigned long long arg1
;
29 vector
unsigned char vbc_result_bi
, vbc_expected_result_bi
;
30 vector
unsigned short vbc_result_hi
, vbc_expected_result_hi
;
31 vector
unsigned int vbc_result_wi
, vbc_expected_result_wi
;
32 vector
unsigned long long vbc_result_di
, vbc_expected_result_di
;
33 vector __uint128_t vbc_result_qi
, vbc_expected_result_qi
;
35 unsigned int result_wi
, expected_result_wi
;
36 unsigned long long result
, expected_result
;
37 const unsigned char mp
=1;
38 vector
unsigned char vbc_bi_src
;
39 vector
unsigned short vbc_hi_src
;
40 vector
unsigned int vbc_wi_src
;
41 vector
unsigned long long vbc_di_src
;
42 vector __uint128_t vbc_qi_src
;
59 vbc_bi_src
[13] = 0xFF;
60 vbc_bi_src
[14] = 0xFF;
61 vbc_bi_src
[15] = 0xFF;
65 result
= vec_cntm (vbc_bi_src
, 1);
66 /* Note count is put in bits[0:7], IBM numbering, of the 64-bit result */
67 result
= result
>> (64-8);
69 if (result
!= expected_result
) {
71 printf("ERROR: char vec_cntm(arg) ");
72 printf("count %llu does not match expected count = %llu\n",
73 result
, expected_result
);
81 vbc_hi_src
[0] = 0xFFFF;
82 vbc_hi_src
[1] = 0xFFFF;
87 vbc_hi_src
[6] = 0xFFFF;
88 vbc_hi_src
[7] = 0xFFFF;
92 result
= vec_cntm (vbc_hi_src
, 1);
93 /* Note count is put in bits[0:6], IBM numbering, of the 64-bit result */
94 result
= result
>> (64-7);
96 if (result
!= expected_result
) {
98 printf("ERROR: short vec_cntm(arg) ");
99 printf("count %llu does not match expected count = %llu\n",
100 result
, expected_result
);
108 vbc_wi_src
[0] = 0xFFFFFFFF;
109 vbc_wi_src
[1] = 0xFFFFFFFF;
115 result
= vec_cntm (vbc_wi_src
, 1);
116 /* Note count is put in bits[0:5], IBM numbering, of the 64-bit result */
117 result
= result
>> (64-6);
119 if (result
!= expected_result
) {
121 printf("ERROR: word vec_cntm(arg) ");
122 printf("count %llu does not match expected count = %llu\n",
123 result
, expected_result
);
131 vbc_di_src
[0] = 0xFFFFFFFFFFFFFFFFULL
;
132 vbc_di_src
[1] = 0xFFFFFFFFFFFFFFFFULL
;
136 result
= vec_cntm (vbc_di_src
, 1);
137 /* Note count is put in bits[0:4], IBM numbering, of the 64-bit result */
138 result
= result
>> (64-5);
140 if (result
!= expected_result
) {
142 printf("ERROR: double vec_cntm(arg) ");
143 printf("count %llu does not match expected count = %llu\n",
144 result
, expected_result
);