diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2023-09-25 04:20:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-24 22:20:21 +0200 |
| commit | c00cd1d6271b313ea459d0b782bc392af74e1598 (patch) | |
| tree | 392f37492bb8aca62ee40e747a59787e0a34a982 /tests | |
| parent | ab65641eae5c6b6440ab7defe4b798953249a1d3 (diff) | |
| download | box64-c00cd1d6271b313ea459d0b782bc392af74e1598.tar.gz box64-c00cd1d6271b313ea459d0b782bc392af74e1598.zip | |
[RV64_DYNAREC] Added more support for XTheadBb extension (#989)
* Reformat * Use TH_FF0 for LZCNT * Reformat * Reformat * Added MOVBE tests * Reformat * Added a new REVxw macro * Refined test24 * Refined test24 * Fix bugs * [INTERPRETER] Fixed MOVBE * [DYNAREC_ARM64] Fix MOVBE
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref24.txt | 8 | ||||
| -rwxr-xr-x | tests/test24 | bin | 0 -> 16112 bytes | |||
| -rw-r--r-- | tests/test24.c | 74 |
3 files changed, 82 insertions, 0 deletions
diff --git a/tests/ref24.txt b/tests/ref24.txt new file mode 100644 index 00000000..40df3e68 --- /dev/null +++ b/tests/ref24.txt @@ -0,0 +1,8 @@ +ret = 0xedefcdab78563412 +ret = 0x78563412 +ret = 0x3412 +ret = 0xedefcdab78563412 +ret = 0x78563412 +ret = 0x3412 +ret = 0x12345678abcdefed +ret = 0x12345678 diff --git a/tests/test24 b/tests/test24 new file mode 100755 index 00000000..3096380e --- /dev/null +++ b/tests/test24 Binary files differdiff --git a/tests/test24.c b/tests/test24.c new file mode 100644 index 00000000..cd07e139 --- /dev/null +++ b/tests/test24.c @@ -0,0 +1,74 @@ +#include <stdio.h> +#include <string.h> +#include <stddef.h> +#include <stdint.h> +// Build with `gcc -march=core2 -O2 test24.c -o test24` + + +uint64_t a = 0x12345678abcdefed; +uint32_t b = 0x12345678; +uint16_t c = 0x1234; + +int main() +{ + uint64_t ret1; + uint32_t ret2; + uint16_t ret3; + + asm volatile( + "movbe %1, %0\n" + : "=r"(ret1) + : "m"(a) + : "memory"); + printf("ret = 0x%lx\n", ret1); + + asm volatile( + "movbe %1, %0\n" + : "=r"(ret2) + : "m"(b) + : "memory"); + printf("ret = 0x%x\n", ret2); + + asm volatile( + "movbe %1, %0\n" + : "=r"(ret3) + : "m"(c) + : "memory"); + printf("ret = 0x%x\n", ret3); + + asm volatile( + "movbe %1, %0\n" + : "=m"(ret1) + : "r"(a) + : "memory"); + printf("ret = 0x%lx\n", ret1); + + asm volatile( + "movbe %1, %0\n" + : "=m"(ret2) + : "r"(b) + : "memory"); + printf("ret = 0x%x\n", ret2); + + asm volatile( + "movbe %1, %0\n" + : "=m"(ret3) + : "r"(c) + : "memory"); + printf("ret = 0x%x\n", ret3); + + asm volatile( + "bswap %0\n" + : "+r"(ret1) + : + :); + printf("ret = 0x%lx\n", ret1); + + asm volatile( + "bswap %0\n" + : "+r"(ret2) + : + :); + printf("ret = 0x%x\n", ret2); + return 0; +} |