aboutsummaryrefslogtreecommitdiff
path: root/tools/gendynarm.cpp
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-05-31 04:18:12 +0200
committercrueter <crueter@eden-emu.dev>2026-05-31 04:18:12 +0200
commit5f4a2860460c1954810be1af6daa419f655b8b5e (patch)
treeded2365cbdec4a1cdb1869c7d40762b961a0b961 /tools/gendynarm.cpp
parentb7fcec49854761b4c86232ee45d6ec8e47ef8d67 (diff)
[dynarmic] cleanup duplicate code and reimpls of std::* bit stuff (#4017)
A bit of a minor cleanup - std::rotr instead of mcl::bit::rotate_right - std::rotl likewise - std::popcount instaed of "count ones" - use ConvertRoundingModeToX64Immediate where appropiate - std integral Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4017 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
Diffstat (limited to 'tools/gendynarm.cpp')
-rw-r--r--tools/gendynarm.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/gendynarm.cpp b/tools/gendynarm.cpp
index 3d1588e7e8..3e28363a10 100644
--- a/tools/gendynarm.cpp
+++ b/tools/gendynarm.cpp
@@ -17,12 +17,6 @@ namespace mcl {
template<typename T>
constexpr std::size_t bitsizeof = CHAR_BIT * sizeof(T);
}
-namespace mcl::bit {
-template<typename T>
-inline size_t count_ones(T x) {
- return std::bitset<bitsizeof<T>>(x).count();
-}
-}
template<size_t N>
inline consteval std::array<char, N> StringToArray(const char (&str)[N + 1]) {
std::array<char, N> result{};
@@ -380,7 +374,7 @@ INST(arm_SRS, "SRS", "1111100--1-0110100000101000-----
};
// If a matcher has more bits in its mask it is more specific, so it should come first.
std::stable_sort(list.begin(), list.end(), [](const auto& matcher1, const auto& matcher2) {
- return mcl::bit::count_ones(matcher1.second) > mcl::bit::count_ones(matcher2.second);
+ return std::popcount(matcher1.second) > std::popcount(matcher2.second);
});
for (auto const& e : list)
printf("%s\n", e.inst_final);
@@ -587,7 +581,7 @@ INST(v8_VLD_single, "VLD{1-4} (single)", "111101001D10nnnnddddzzN
});
// If a matcher has more bits in its mask it is more specific, so it should come first.
std::stable_sort(sort_begin, sort_end, [](const auto& a, const auto& b) {
- return mcl::bit::count_ones(a.second) > mcl::bit::count_ones(b.second);
+ return std::popcount(a.second) > std::popcount(b.second);
});
for (auto const& e : table)
printf("%s\n", e.inst_final);
@@ -1628,7 +1622,7 @@ INST(FNMSUB_float, "FNMSUB", "00011
// If a matcher has more bits in its mask it is more specific, so it should come first.
std::stable_sort(list.begin(), list.end(), [](const auto& a, const auto& b) {
// If a matcher has more bits in its mask it is more specific, so it should come first.
- return mcl::bit::count_ones(a.second) > mcl::bit::count_ones(b.second);
+ return std::popcount(a.second) > std::popcount(b.second);
});
// Exceptions to the above rule of thumb.
std::stable_partition(list.begin(), list.end(), [&](const auto& e) {