aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/A32
diff options
context:
space:
mode:
authorMerryMage <[email protected]>2021-05-03 22:33:37 +0100
committerMerryMage <[email protected]>2021-05-04 00:09:55 +0100
commitd1e62b99932a3404a4a9ad641ebcf2711af7eb5b (patch)
treefed775764aee6c9896f5c79db2b67073b4bfe058 /tests/A32
parentcd837c5b37d77b0890a1ec01a97bf112e7ec0213 (diff)
downloaddynarmic-d1e62b99932a3404a4a9ad641ebcf2711af7eb5b.tar.gz
dynarmic-d1e62b99932a3404a4a9ad641ebcf2711af7eb5b.zip
T32: Add VFP instructions
Diffstat (limited to 'tests/A32')
-rw-r--r--tests/A32/fuzz_arm.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/A32/fuzz_arm.cpp b/tests/A32/fuzz_arm.cpp
index 89ec80bc..8dcbf7ed 100644
--- a/tests/A32/fuzz_arm.cpp
+++ b/tests/A32/fuzz_arm.cpp
@@ -158,6 +158,12 @@ std::vector<u16> GenRandomThumbInst(u32 pc, bool is_last_inst, A32::ITState it_s
#undef INST
};
+ const std::vector<std::tuple<std::string, const char*>> vfp_list {
+#define INST(fn, name, bitstring) {#fn, bitstring},
+#include "frontend/A32/decoder/vfp.inc"
+#undef INST
+ };
+
std::vector<InstructionGenerator> generators;
std::vector<InstructionGenerator> invalid;
@@ -176,6 +182,13 @@ std::vector<u16> GenRandomThumbInst(u32 pc, bool is_last_inst, A32::ITState it_s
"thumb32_STREXB",
"thumb32_STREXD",
"thumb32_STREXH",
+
+ // FPSCR is inaccurate
+ "vfp_VMRS",
+
+ // Unicorn has incorrect implementation (incorrect rounding and unsets CPSR.T??)
+ "vfp_VCVT_to_fixed",
+ "vfp_VCVT_from_fixed",
};
for (const auto& [fn, bitstring] : list) {
@@ -185,6 +198,17 @@ std::vector<u16> GenRandomThumbInst(u32 pc, bool is_last_inst, A32::ITState it_s
}
generators.emplace_back(InstructionGenerator{bitstring});
}
+ for (const auto& [fn, bs] : vfp_list) {
+ std::string bitstring = bs;
+ if (bitstring.substr(0, 4) == "cccc" || bitstring.substr(0, 4) == "----") {
+ bitstring.replace(0, 4, "1110");
+ }
+ if (std::find(do_not_test.begin(), do_not_test.end(), fn) != do_not_test.end()) {
+ invalid.emplace_back(InstructionGenerator{bitstring.c_str()});
+ continue;
+ }
+ generators.emplace_back(InstructionGenerator{bitstring.c_str()});
+ }
return InstructionGeneratorInfo{generators, invalid};
}();