6 #define WORD_A 0xAAAAAAAAUL
7 #define WORD_B 0xBBBBBBBBUL
8 #define WORD_C 0xCCCCCCCCUL
9 #define WORD_D 0xDDDDDDDDUL
11 #define DWORD_HI (WORD_A << 32 | WORD_B)
12 #define DWORD_LO (WORD_C << 32 | WORD_D)
14 #define TEST(HI, LO, UIM, RES) \
19 } h = { .u = HI }, l = { .u = LO }; \
21 * Use a pair of FPRs to load the VSR avoiding insns \
22 * newer than xxswapd. \
24 asm("xxmrghd 32, %0, %1\n\t" \
25 "xxspltw 32, 32, %2\n\t" \
26 "xxmrghd %0, 32, %0\n\t" \
27 "xxswapd 32, 32\n\t" \
28 "xxmrghd %1, 32, %1\n\t" \
29 : "+f" (h.f), "+f" (l.f) \
32 printf("xxspltw(0x%016" PRIx64 "%016" PRIx64 ", %d) =" \
33 " %016" PRIx64 "%016" PRIx64 "\n", HI, LO, UIM, \
35 assert(h.u == (RES)); \
36 assert(l.u == (RES)); \
41 TEST(DWORD_HI
, DWORD_LO
, 0, WORD_A
<< 32 | WORD_A
);
42 TEST(DWORD_HI
, DWORD_LO
, 1, WORD_B
<< 32 | WORD_B
);
43 TEST(DWORD_HI
, DWORD_LO
, 2, WORD_C
<< 32 | WORD_C
);
44 TEST(DWORD_HI
, DWORD_LO
, 3, WORD_D
<< 32 | WORD_D
);