3 #include "qemu/compiler.h"
7 unsigned int result_wi
;
8 vector
unsigned char vbc_bi_src
= { 0xFF, 0xFF, 0, 0xFF, 0xFF, 0xFF,
9 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0,
11 vector
unsigned short vbc_hi_src
= { 0xFFFF, 0, 0, 0xFFFF,
12 0, 0, 0xFFFF, 0xFFFF};
13 vector
unsigned int vbc_wi_src
= {0, 0, 0xFFFFFFFF, 0xFFFFFFFF};
14 vector
unsigned long long vbc_di_src
= {0xFFFFFFFFFFFFFFFF, 0};
15 vector __uint128_t vbc_qi_src
;
17 asm("vextractbm %0, %1" : "=r" (result_wi
) : "v" (vbc_bi_src
));
19 assert(result_wi
== 0b1101111111000011);
21 assert(result_wi
== 0b1100001111111011);
24 asm("vextracthm %0, %1" : "=r" (result_wi
) : "v" (vbc_hi_src
));
26 assert(result_wi
== 0b10010011);
28 assert(result_wi
== 0b11001001);
31 asm("vextractwm %0, %1" : "=r" (result_wi
) : "v" (vbc_wi_src
));
33 assert(result_wi
== 0b0011);
35 assert(result_wi
== 0b1100);
38 asm("vextractdm %0, %1" : "=r" (result_wi
) : "v" (vbc_di_src
));
40 assert(result_wi
== 0b10);
42 assert(result_wi
== 0b01);
46 vbc_qi_src
[0] = vbc_qi_src
[0] << 127;
47 asm("vextractqm %0, %1" : "=r" (result_wi
) : "v" (vbc_qi_src
));
48 assert(result_wi
== 0b1);