aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorWunkolo <[email protected]>2024-02-04 12:12:33 -0800
committermerry <[email protected]>2024-02-06 18:15:34 +0000
commit1e5e7a7ae642e182230ee1df64f0fde4698fd2a4 (patch)
treeb5de5d82689582685e1477ab06e3f1fb1f900cb2 /tests
parent75235ffedb5a0eccfe31f58480c84187706e1ecb (diff)
downloaddynarmic-1e5e7a7ae642e182230ee1df64f0fde4698fd2a4.tar.gz
dynarmic-1e5e7a7ae642e182230ee1df64f0fde4698fd2a4.zip
tests/A64: Add CLZ vector unit-tests
Diffstat (limited to 'tests')
-rw-r--r--tests/A64/a64.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/A64/a64.cpp b/tests/A64/a64.cpp
index 2d4607e9..7f946019 100644
--- a/tests/A64/a64.cpp
+++ b/tests/A64/a64.cpp
@@ -58,6 +58,28 @@ TEST_CASE("A64: ADD{V,P}", "[a64]") {
REQUIRE(jit.GetVector(6) == Vector{0x0000000004040404, 0x0000000000000000});
}
+TEST_CASE("A64: CLZ", "[a64]") {
+ A64TestEnv env;
+ A64::Jit jit{A64::UserConfig{&env}};
+
+ env.code_mem.emplace_back(0x6E204803); // CLZ v3.16b, v0.16b
+ env.code_mem.emplace_back(0x6E604824); // CLZ v4.8h, v1.8h
+ env.code_mem.emplace_back(0x6EA04845); // CLZ v5.4s, v2.4s
+ env.code_mem.emplace_back(0x14000000); // B .
+
+ jit.SetPC(0);
+ jit.SetVector(0, {0xeff0fafbfcfdfeff, 0xff7f3f1f0f070301});
+ jit.SetVector(1, {0xfffcfffdfffeffff, 0x000F000700030001});
+ jit.SetVector(2, {0xfffffffdfffffffe, 0x0000000300000001});
+
+ env.ticks_left = 4;
+ jit.Run();
+
+ REQUIRE(jit.GetVector(3) == Vector{0x0, 0x0001020304050607});
+ REQUIRE(jit.GetVector(4) == Vector{0x0, 0x000c000d000e000f});
+ REQUIRE(jit.GetVector(5) == Vector{0x0, 0x0000001e0000001f});
+}
+
TEST_CASE("A64: UADDL{V,P}", "[a64]") {
A64TestEnv env;
A64::Jit jit{A64::UserConfig{&env}};