Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / ppc64 / byte_reverse.c
blob53b76fc2e28ef6c4c292ecf3aaf18d66f7008fd7
1 #include <assert.h>
3 int main(void)
5 unsigned long var;
7 var = 0xFEDCBA9876543210;
8 asm("brh %0, %0" : "+r"(var));
9 assert(var == 0xDCFE98BA54761032);
11 var = 0xFEDCBA9876543210;
12 asm("brw %0, %0" : "+r"(var));
13 assert(var == 0x98BADCFE10325476);
15 var = 0xFEDCBA9876543210;
16 asm("brd %0, %0" : "+r"(var));
17 assert(var == 0x1032547698BADCFE);
19 return 0;