early-access version 1995
This commit is contained in:
53
externals/dynarmic/tests/A64/a64.cpp
vendored
53
externals/dynarmic/tests/A64/a64.cpp
vendored
@@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#include <catch.hpp>
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include "./testenv.h"
|
||||
#include "dynarmic/common/fp/fpsr.h"
|
||||
@@ -675,6 +675,57 @@ TEST_CASE("A64: FMADD", "[a64]") {
|
||||
REQUIRE(jit.GetVector(10) == Vector{0x3f059921bf0dbfff, 0x0000000000000000});
|
||||
}
|
||||
|
||||
TEST_CASE("A64: FMLA.4S(lane)", "[a64]") {
|
||||
A64TestEnv env;
|
||||
A64::Jit jit{A64::UserConfig{&env}};
|
||||
|
||||
env.code_mem.emplace_back(0x4f8f11c0); // FMLA.4S V0, V14, V15[0]
|
||||
env.code_mem.emplace_back(0x4faf11c1); // FMLA.4S V1, V14, V15[1]
|
||||
env.code_mem.emplace_back(0x4f8f19c2); // FMLA.4S V2, V14, V15[2]
|
||||
env.code_mem.emplace_back(0x4faf19c3); // FMLA.4S V3, V14, V15[3]
|
||||
env.code_mem.emplace_back(0x14000000); // B .
|
||||
|
||||
jit.SetPC(0);
|
||||
jit.SetVector(0, {0x3ff00000'3ff00000, 0x00000000'00000000});
|
||||
jit.SetVector(1, {0x3ff00000'3ff00000, 0x00000000'00000000});
|
||||
jit.SetVector(2, {0x3ff00000'3ff00000, 0x00000000'00000000});
|
||||
jit.SetVector(3, {0x3ff00000'3ff00000, 0x00000000'00000000});
|
||||
|
||||
jit.SetVector(14, {0x3ff00000'3ff00000, 0x3ff00000'3ff00000});
|
||||
jit.SetVector(15, {0x3ff00000'40000000, 0x40400000'40800000});
|
||||
|
||||
env.ticks_left = 5;
|
||||
jit.Run();
|
||||
|
||||
REQUIRE(jit.GetVector(0) == Vector{0x40b4000040b40000, 0x4070000040700000});
|
||||
REQUIRE(jit.GetVector(1) == Vector{0x40ac800040ac8000, 0x4061000040610000});
|
||||
REQUIRE(jit.GetVector(2) == Vector{0x4116000041160000, 0x40f0000040f00000});
|
||||
REQUIRE(jit.GetVector(3) == Vector{0x40f0000040f00000, 0x40b4000040b40000});
|
||||
}
|
||||
|
||||
TEST_CASE("A64: FMUL.4S(lane)", "[a64]") {
|
||||
A64TestEnv env;
|
||||
A64::Jit jit{A64::UserConfig{&env}};
|
||||
|
||||
env.code_mem.emplace_back(0x4f8f91c0); // FMUL.4S V0, V14, V15[0]
|
||||
env.code_mem.emplace_back(0x4faf91c1); // FMUL.4S V1, V14, V15[1]
|
||||
env.code_mem.emplace_back(0x4f8f99c2); // FMUL.4S V2, V14, V15[2]
|
||||
env.code_mem.emplace_back(0x4faf99c3); // FMUL.4S V3, V14, V15[3]
|
||||
env.code_mem.emplace_back(0x14000000); // B .
|
||||
|
||||
jit.SetPC(0);
|
||||
jit.SetVector(14, {0x3ff00000'3ff00000, 0x3ff00000'3ff00000});
|
||||
jit.SetVector(15, {0x3ff00000'40000000, 0x40400000'40800000});
|
||||
|
||||
env.ticks_left = 5;
|
||||
jit.Run();
|
||||
|
||||
REQUIRE(jit.GetVector(0) == Vector{0x4070000040700000, 0x4070000040700000});
|
||||
REQUIRE(jit.GetVector(1) == Vector{0x4061000040610000, 0x4061000040610000});
|
||||
REQUIRE(jit.GetVector(2) == Vector{0x40f0000040f00000, 0x40f0000040f00000});
|
||||
REQUIRE(jit.GetVector(3) == Vector{0x40b4000040b40000, 0x40b4000040b40000});
|
||||
}
|
||||
|
||||
TEST_CASE("A64: FMLA.4S (denormal)", "[a64]") {
|
||||
A64TestEnv env;
|
||||
A64::Jit jit{A64::UserConfig{&env}};
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <catch.hpp>
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include "../fuzz_util.h"
|
||||
#include "../rand_int.h"
|
||||
@@ -232,7 +232,7 @@ static void RunTestInstance(Dynarmic::A64::Jit& jit, A64Unicorn& uni, A64TestEnv
|
||||
}
|
||||
const auto uni_vecs = uni.GetVectors();
|
||||
for (size_t i = 0; i < vecs.size(); ++i) {
|
||||
fmt::print("{:3s}: {}{} {}{} {}\n", A64::VecToString(static_cast<A64::Vec>(i)),
|
||||
fmt::print("{:3s}: {:016x}{:016x} {:016x}{:016x} {}\n", A64::VecToString(static_cast<A64::Vec>(i)),
|
||||
uni_vecs[i][1], uni_vecs[i][0],
|
||||
jit.GetVectors()[i][1], jit.GetVectors()[i][0],
|
||||
uni_vecs[i] != jit.GetVectors()[i] ? "*" : "");
|
||||
@@ -276,7 +276,7 @@ static void RunTestInstance(Dynarmic::A64::Jit& jit, A64Unicorn& uni, A64TestEnv
|
||||
fmt::print("{}\n", IR::DumpBlock(ir_block));
|
||||
|
||||
fmt::print("x86_64:\n");
|
||||
fmt::print("{}\n", jit.Disassemble());
|
||||
jit.DumpDisassembly();
|
||||
|
||||
fmt::print("Interrupts:\n");
|
||||
for (auto& i : uni_env.interrupts) {
|
||||
|
@@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#include <catch.hpp>
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include "./testenv.h"
|
||||
#include "dynarmic/interface/A64/a64.h"
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#include <catch.hpp>
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include "../rand_int.h"
|
||||
#include "../unicorn_emu/a64_unicorn.h"
|
||||
|
Reference in New Issue
Block a user