tests: Add F{MIN,MAX} tests

Very minimal tests that includes some denormals and {Q,S}NANs
This commit is contained in:
Wunkolo 2021-06-04 14:55:47 -07:00 committed by merry
parent 0c67b913fe
commit 87aac2a46b

View file

@ -454,6 +454,50 @@ TEST_CASE("A64: FABD", "[a64]") {
REQUIRE(jit.GetVector(22) == Vector{0x56d3f0857fc90e2b, 0x6e4b0a4144873176});
}
TEST_CASE("A64: FMIN", "[a64]") {
A64TestEnv env;
A64::Jit jit{A64::UserConfig{&env}};
env.code_mem.emplace_back(0x4ea1f400); // FMIN.4S V0, V0, V1
env.code_mem.emplace_back(0x4ee3f442); // FMIN.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, {0xbff0000000000000, 0x6e4b0a41ffffffff});
env.ticks_left = 2;
jit.Run();
REQUIRE(jit.GetVector(0) == Vector{0x7fc00000'00000001, 0x00000000'7fd84a37});
REQUIRE(jit.GetVector(2) == Vector{0xbff0000000000000, 0x3ff0000000000000});
}
TEST_CASE("A64: FMAX", "[a64]") {
A64TestEnv env;
A64::Jit jit{A64::UserConfig{&env}};
env.code_mem.emplace_back(0x4e21f400); // FMAX.4S V0, V0, V1
env.code_mem.emplace_back(0x4e63f442); // FMAX.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, {0xbff0000000000000, 0x6e4b0a41ffffffff});
env.ticks_left = 2;
jit.Run();
REQUIRE(jit.GetVector(0) == Vector{0x7fc00000'09503366, 0x6e4b0a41'7fd84a37});
REQUIRE(jit.GetVector(2) == Vector{0x7fc0000009503366, 0x6e4b0a41ffffffff});
}
TEST_CASE("A64: 128-bit exclusive read/write", "[a64]") {
A64TestEnv env;
ExclusiveMonitor monitor{1};