tests/fp_min_max: Test FPCR.FZ
This commit is contained in:
parent
2492970039
commit
c63c134582
1 changed files with 55 additions and 53 deletions
|
@ -69,11 +69,12 @@ void run_test(u32 instruction, Fn fn) {
|
|||
env.code_mem.emplace_back(instruction); // FMAX S0, S1, S2
|
||||
env.code_mem.emplace_back(0x14000000); // B .
|
||||
|
||||
for (const auto base_fpcr : {0, 0x01000000}) {
|
||||
for (const auto test_case : test_cases) {
|
||||
INFO(test_case.a);
|
||||
INFO(test_case.b);
|
||||
|
||||
jit.SetFpcr(0);
|
||||
jit.SetFpcr(base_fpcr);
|
||||
|
||||
jit.SetVector(0, {42, 0});
|
||||
jit.SetVector(1, {test_case.a, 0});
|
||||
|
@ -95,7 +96,7 @@ void run_test(u32 instruction, Fn fn) {
|
|||
|
||||
REQUIRE(jit.GetVector(0)[0] == fn(test_case));
|
||||
|
||||
jit.SetFpcr(0x02000000);
|
||||
jit.SetFpcr(base_fpcr | 0x02000000);
|
||||
|
||||
jit.SetVector(0, {42, 0});
|
||||
jit.SetVector(1, {test_case.a, 0});
|
||||
|
@ -122,7 +123,7 @@ void run_test(u32 instruction, Fn fn) {
|
|||
INFO(test_case.a);
|
||||
INFO(test_case.b);
|
||||
|
||||
jit.SetFpcr(0);
|
||||
jit.SetFpcr(base_fpcr);
|
||||
|
||||
jit.SetVector(0, {42, 0});
|
||||
jit.SetVector(1, {test_case.a, 0});
|
||||
|
@ -134,7 +135,7 @@ void run_test(u32 instruction, Fn fn) {
|
|||
|
||||
REQUIRE(jit.GetVector(0)[0] == fn(test_case));
|
||||
|
||||
jit.SetFpcr(0x02000000);
|
||||
jit.SetFpcr(base_fpcr | 0x02000000);
|
||||
|
||||
jit.SetVector(0, {42, 0});
|
||||
jit.SetVector(1, {test_case.a, 0});
|
||||
|
@ -146,6 +147,7 @@ void run_test(u32 instruction, Fn fn) {
|
|||
|
||||
REQUIRE(jit.GetVector(0)[0] == force_default_nan(fn(test_case)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Reference in a new issue