qemu/tests/tcg/ppc64/byte_reverse.c
Paolo Bonzini 37b0dba45c tests/tcg: unify ppc64 and ppc64le Makefiles
Make tests/tcg/ppc64le include tests/tcg/ppc64 instead of duplicating
the rules.  Because the ppc64le vpath includes tests/tcg/ppc64 but
not vice versa, the tests have to be moved from tests/tcg/ppc64le/
to tests/tcg/ppc64.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220929114231.583801-23-alex.bennee@linaro.org>
2022-10-06 11:53:40 +01:00

22 lines
394 B
C

#include <assert.h>
int main(void)
{
unsigned long var;
var = 0xFEDCBA9876543210;
asm("brh %0, %0" : "+r"(var));
assert(var == 0xDCFE98BA54761032);
var = 0xFEDCBA9876543210;
asm("brw %0, %0" : "+r"(var));
assert(var == 0x98BADCFE10325476);
var = 0xFEDCBA9876543210;
asm("brd %0, %0" : "+r"(var));
assert(var == 0x1032547698BADCFE);
return 0;
}