aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorzmt00 <[email protected]>2023-12-09 15:40:27 -0800
committermerry <[email protected]>2023-12-11 13:18:19 +0000
commit7ef11ee31174d22c5238969eee59d8aab911c3a6 (patch)
tree38defe228fa61ec12ded2d6b264789a7ba190724
parent4c2bd4ed296170be02ee67d5164d75f5af84ac40 (diff)
downloaddynarmic-7ef11ee31174d22c5238969eee59d8aab911c3a6.tar.gz
dynarmic-7ef11ee31174d22c5238969eee59d8aab911c3a6.zip
tests/A64: Add VUZP{1,2}.H unit tests
-rw-r--r--tests/A64/a64.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/A64/a64.cpp b/tests/A64/a64.cpp
index 900ca0b4..0ecccc6f 100644
--- a/tests/A64/a64.cpp
+++ b/tests/A64/a64.cpp
@@ -1541,3 +1541,26 @@ TEST_CASE("A64: UZP{1,2}.S", "[a64]") {
REQUIRE(jit.GetVector(4) == Vector{0x34564567'0BADC0DE, 0x0F1E2D3C'44332211});
REQUIRE(jit.GetVector(5) == Vector{0x6789ABCD'76543210, 0x43424140'F3F2F1F0});
}
+
+TEST_CASE("A64: UZP{1,2}.H", "[a64]") {
+ A64TestEnv env;
+ A64::Jit jit{A64::UserConfig{&env}};
+
+ env.code_mem.emplace_back(0x0e411802); // UZP1 V2.4H, V0.4H, V1.4H
+ env.code_mem.emplace_back(0x0e415803); // UZP2 V3.4H, V0.4H, V1.4H
+ env.code_mem.emplace_back(0x4e411804); // UZP1 V4.8H, V0.8H, V1.8H
+ env.code_mem.emplace_back(0x4e415805); // UZP2 V5.8H, V0.8H, V1.8H
+ env.code_mem.emplace_back(0x14000000); // B .
+
+ jit.SetPC(0);
+ jit.SetVector(0, {0xF6F7'F4F5'F2F3'F0F1, 0xE6E7'E4E5'E2E3'E0E1});
+ jit.SetVector(1, {0xA6A7'A4A5'A2A3'A0A1, 0xB6B7'B4B5'B2B3'B0B1});
+
+ env.ticks_left = 5;
+ jit.Run();
+
+ REQUIRE(jit.GetVector(2) == Vector{0xA4A5'A0A1'F4F5'F0F1, 0});
+ REQUIRE(jit.GetVector(3) == Vector{0xA6A7'A2A3'F6F7'F2F3, 0});
+ REQUIRE(jit.GetVector(4) == Vector{0xE4E5'E0E1'F4F5'F0F1, 0xB4B5'B0B1'A4A5'A0A1});
+ REQUIRE(jit.GetVector(5) == Vector{0xE6E7'E2E3'F6F7'F2F3, 0xB6B7'B2B3'A6A7'A2A3});
+}