aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorWunkolo <[email protected]>2021-06-14 12:43:06 -0700
committermerry <[email protected]>2021-06-20 10:12:27 +0100
commita1192a51d846e7de9018f0f856595323b977e886 (patch)
treed006cc2cbcdd11c379e06e320fef89b274e5f399 /tests
parente61e771a5f9ead432fa5a2b282b4153f22e1614c (diff)
downloaddynarmic-a1192a51d846e7de9018f0f856595323b977e886.tar.gz
dynarmic-a1192a51d846e7de9018f0f856595323b977e886.zip
tests: add F{MIN,MAX}NM tests
Diffstat (limited to 'tests')
-rw-r--r--tests/A64/a64.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/A64/a64.cpp b/tests/A64/a64.cpp
index 7a258e11..a6e54975 100644
--- a/tests/A64/a64.cpp
+++ b/tests/A64/a64.cpp
@@ -520,6 +520,50 @@ TEST_CASE("A64: FMAX", "[a64]") {
REQUIRE(jit.GetVector(2) == Vector{0x7fc0000009503366, 0x6e4b0a41ffffffff});
}
+TEST_CASE("A64: FMINNM", "[a64]") {
+ A64TestEnv env;
+ A64::Jit jit{A64::UserConfig{&env}};
+
+ env.code_mem.emplace_back(0x4ea1c400); // FMINNM.4S V0, V0, V1
+ env.code_mem.emplace_back(0x4ee3c442); // FMINNM.2D V2, V2, V3
+ env.code_mem.emplace_back(0x14000000); // B .
+
+ jit.SetPC(0);
+ jit.SetVector(0, {0x7fc00000'09503366, 0x00000000'7f984a37});
+ jit.SetVector(1, {0xc1200000'00000001, 0x6e4b0a41'ffffffff});
+
+ jit.SetVector(2, {0x7fc0000009503366, 0x3ff0000000000000});
+ jit.SetVector(3, {0xfff0000000000000, 0xffffffffffffffff});
+
+ env.ticks_left = 2;
+ jit.Run();
+
+ REQUIRE(jit.GetVector(0) == Vector{0xc1200000'00000001, 0x00000000'7fd84a37});
+ REQUIRE(jit.GetVector(2) == Vector{0xfff0000000000000, 0x3ff0000000000000});
+}
+
+TEST_CASE("A64: FMAXNM", "[a64]") {
+ A64TestEnv env;
+ A64::Jit jit{A64::UserConfig{&env}};
+
+ env.code_mem.emplace_back(0x4e21c400); // FMAXNM.4S V0, V0, V1
+ env.code_mem.emplace_back(0x4e63c442); // FMAXNM.2D V2, V2, V3
+ env.code_mem.emplace_back(0x14000000); // B .
+
+ jit.SetPC(0);
+ jit.SetVector(0, {0x7fc00000'09503366, 0x00000000'7f984a37});
+ jit.SetVector(1, {0xc1200000'00000001, 0x6e4b0a41'ffffffff});
+
+ jit.SetVector(2, {0x7fc0000009503366, 0x3ff0000000000000});
+ jit.SetVector(3, {0xfff0000000000000, 0xffffffffffffffff});
+
+ env.ticks_left = 2;
+ jit.Run();
+
+ REQUIRE(jit.GetVector(0) == Vector{0xc1200000'09503366, 0x6e4b0a41'7fd84a37});
+ REQUIRE(jit.GetVector(2) == Vector{0x7fc0000009503366, 0x3ff0000000000000});
+}
+
TEST_CASE("A64: 128-bit exclusive read/write", "[a64]") {
A64TestEnv env;
ExclusiveMonitor monitor{1};