about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorptitSeb <seebastien.chev@gmail.com>2023-09-04 09:29:55 +0200
committerptitSeb <seebastien.chev@gmail.com>2023-09-04 09:29:55 +0200
commit96025a19771dafc7d17d5f22207f64fde957930e (patch)
tree9760ac76ace4393158d872c2bf76c0fcfb06ad73 /tests
parent6e1bcc03a60d105ced5251bac25a52f97e3b6f1c (diff)
downloadbox64-96025a19771dafc7d17d5f22207f64fde957930e.tar.gz
box64-96025a19771dafc7d17d5f22207f64fde957930e.zip
[ARM64_DYNAREC] Fixed 0F 38 00 PSHUFB opcode (thanks @wannacu for the hint)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref23.txt1
-rwxr-xr-xtests/test23bin0 -> 15984 bytes
-rw-r--r--tests/test23.c28
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/ref23.txt b/tests/ref23.txt
new file mode 100644
index 00000000..b06138f6
--- /dev/null
+++ b/tests/ref23.txt
@@ -0,0 +1 @@
+Res = 0xefcd00ef
diff --git a/tests/test23 b/tests/test23
new file mode 100755
index 00000000..e6e84636
--- /dev/null
+++ b/tests/test23
Binary files differdiff --git a/tests/test23.c b/tests/test23.c
new file mode 100644
index 00000000..7328a398
--- /dev/null
+++ b/tests/test23.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <string.h>
+#include <stddef.h>
+#include <stdint.h>
+// Build with `gcc -march=core2 -O2 test23.c -o test23`
+
+uint64_t pshufb(uint64_t Gm, uint64_t Em) {
+uint64_t Res;
+asm(
+"movq %[_Gm], %%mm0\n"
+"movq %[_Em], %%mm1\n"
+"pshufb %%mm1, %%mm0\n"
+"movq %%mm0, %[_Res]\n"
+: [_Res] "+r"(Res)
+: [_Gm] "r"(Gm)
+, [_Em] "r"(Em)
+);
+return Res;
+}
+
+int main() {
+uint64_t Gm = 0x12345678abcdef00;
+uint64_t Em = 0x8182888971727879;
+uint64_t Res = pshufb(Gm, Em);
+printf("Res = 0x%lx\n", Res);
+//assert(Res == 0xefcd00ef);
+return 0;
+}