xref: /openbmc/qemu/tests/tcg/ppc64/byte_reverse.c (revision bb06b014)
1 #include <assert.h>
2 
3 int main(void)
4 {
5     unsigned long var;
6 
7     var = 0xFEDCBA9876543210;
8     asm("brh %0, %0" : "+r"(var));
9     assert(var == 0xDCFE98BA54761032);
10 
11     var = 0xFEDCBA9876543210;
12     asm("brw %0, %0" : "+r"(var));
13     assert(var == 0x98BADCFE10325476);
14 
15     var = 0xFEDCBA9876543210;
16     asm("brd %0, %0" : "+r"(var));
17     assert(var == 0x1032547698BADCFE);
18 
19     return 0;
20 }
21 
22