qemu/tests/tcg/ppc64le/byte_reverse.c
Matheus Ferst ec9ad11d69 tests/tcg/ppc64le: tests for brh/brw/brd
Tests for Byte-Reverse Halfword, Word and Doubleword

Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Tested-by: Fabiano Rosas <farosas@linux.ibm.com>
[AJB: tweak to make rules for skip/plugins]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210423205757.1752480-3-matheus.ferst@eldorado.org.br>
Message-Id: <20210512102051.12134-28-alex.bennee@linaro.org>
2021-05-18 09:36:21 +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;
}