1
0
Fork 0
forked from suyu/suyu

common/xbyak_abi: Mark defined functions in header as inline

Avoids potential One Definition Rule violations when these are used in
the future.
This commit is contained in:
Lioncash 2018-08-14 18:29:53 -04:00
parent 0ce0905380
commit 6d549abb4e

View file

@ -11,7 +11,7 @@
namespace Common::X64 { namespace Common::X64 {
int RegToIndex(const Xbyak::Reg& reg) { inline int RegToIndex(const Xbyak::Reg& reg) {
using Kind = Xbyak::Reg::Kind; using Kind = Xbyak::Reg::Kind;
ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0, ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0,
"RegSet only support GPRs and XMM registers."); "RegSet only support GPRs and XMM registers.");
@ -151,7 +151,7 @@ constexpr size_t ABI_SHADOW_SPACE = 0;
#endif #endif
void ABI_CalculateFrameSize(BitSet32 regs, size_t rsp_alignment, size_t needed_frame_size, inline void ABI_CalculateFrameSize(BitSet32 regs, size_t rsp_alignment, size_t needed_frame_size,
s32* out_subtraction, s32* out_xmm_offset) { s32* out_subtraction, s32* out_xmm_offset) {
int count = (regs & ABI_ALL_GPRS).Count(); int count = (regs & ABI_ALL_GPRS).Count();
rsp_alignment -= count * 8; rsp_alignment -= count * 8;
@ -173,7 +173,7 @@ void ABI_CalculateFrameSize(BitSet32 regs, size_t rsp_alignment, size_t needed_f
*out_xmm_offset = (s32)(subtraction - xmm_base_subtraction); *out_xmm_offset = (s32)(subtraction - xmm_base_subtraction);
} }
size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs, inline size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs,
size_t rsp_alignment, size_t needed_frame_size = 0) { size_t rsp_alignment, size_t needed_frame_size = 0) {
s32 subtraction, xmm_offset; s32 subtraction, xmm_offset;
ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset); ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset);
@ -194,8 +194,8 @@ size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs
return ABI_SHADOW_SPACE; return ABI_SHADOW_SPACE;
} }
void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs, size_t rsp_alignment, inline void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs,
size_t needed_frame_size = 0) { size_t rsp_alignment, size_t needed_frame_size = 0) {
s32 subtraction, xmm_offset; s32 subtraction, xmm_offset;
ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset); ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset);