summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-01-27 16:29:34 +0100
committerGitHub <noreply@github.com>2022-01-27 16:29:34 +0100
commit8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96 (patch)
treeae8ff7aebf61aeb912c39387ee282a6871a2c537 /src/common
parentMerge pull request #7762 from bunnei/un-map-improve (diff)
parentcommon/xbyak_api: Make BuildRegSet() constexpr (diff)
downloadyuzu-8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96.tar
yuzu-8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96.tar.gz
yuzu-8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96.tar.bz2
yuzu-8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96.tar.lz
yuzu-8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96.tar.xz
yuzu-8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96.tar.zst
yuzu-8a244dd3d34e3c9ded99fa3f0cdb7ca8e175cf96.zip
Diffstat (limited to '')
-rw-r--r--src/common/x64/xbyak_abi.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/x64/xbyak_abi.h b/src/common/x64/xbyak_abi.h
index 0ddf9b83e..87b3d63a4 100644
--- a/src/common/x64/xbyak_abi.h
+++ b/src/common/x64/xbyak_abi.h
@@ -37,12 +37,12 @@ constexpr Xbyak::Reg IndexToReg(size_t reg_index) {
}
}
-inline std::bitset<32> BuildRegSet(std::initializer_list<Xbyak::Reg> regs) {
- std::bitset<32> bits;
+constexpr std::bitset<32> BuildRegSet(std::initializer_list<Xbyak::Reg> regs) {
+ size_t bits = 0;
for (const Xbyak::Reg& reg : regs) {
- bits[RegToIndex(reg)] = true;
+ bits |= size_t{1} << RegToIndex(reg);
}
- return bits;
+ return {bits};
}
constexpr inline std::bitset<32> ABI_ALL_GPRS(0x0000FFFF);
@@ -57,7 +57,7 @@ constexpr inline Xbyak::Reg ABI_PARAM2 = Xbyak::util::rdx;
constexpr inline Xbyak::Reg ABI_PARAM3 = Xbyak::util::r8;
constexpr inline Xbyak::Reg ABI_PARAM4 = Xbyak::util::r9;
-const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
+constexpr inline std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
// GPRs
Xbyak::util::rcx,
Xbyak::util::rdx,
@@ -74,7 +74,7 @@ const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
Xbyak::util::xmm5,
});
-const std::bitset<32> ABI_ALL_CALLEE_SAVED = BuildRegSet({
+constexpr inline std::bitset<32> ABI_ALL_CALLEE_SAVED = BuildRegSet({
// GPRs
Xbyak::util::rbx,
Xbyak::util::rsi,
@@ -108,7 +108,7 @@ constexpr inline Xbyak::Reg ABI_PARAM2 = Xbyak::util::rsi;
constexpr inline Xbyak::Reg ABI_PARAM3 = Xbyak::util::rdx;
constexpr inline Xbyak::Reg ABI_PARAM4 = Xbyak::util::rcx;
-const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
+constexpr inline std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
// GPRs
Xbyak::util::rcx,
Xbyak::util::rdx,
@@ -137,7 +137,7 @@ const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
Xbyak::util::xmm15,
});
-const std::bitset<32> ABI_ALL_CALLEE_SAVED = BuildRegSet({
+constexpr inline std::bitset<32> ABI_ALL_CALLEE_SAVED = BuildRegSet({
// GPRs
Xbyak::util::rbx,
Xbyak::util::rbp,