summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/x64/xbyak_abi.h20
-rw-r--r--src/common/x64/xbyak_util.h6
2 files changed, 11 insertions, 15 deletions
diff --git a/src/common/x64/xbyak_abi.h b/src/common/x64/xbyak_abi.h
index fd3fbdd4b..927da9187 100644
--- a/src/common/x64/xbyak_abi.h
+++ b/src/common/x64/xbyak_abi.h
@@ -9,10 +9,9 @@
9#include "common/assert.h" 9#include "common/assert.h"
10#include "common/bit_set.h" 10#include "common/bit_set.h"
11 11
12namespace Common { 12namespace Common::X64 {
13namespace X64 {
14 13
15int RegToIndex(const Xbyak::Reg& reg) { 14inline int RegToIndex(const Xbyak::Reg& reg) {
16 using Kind = Xbyak::Reg::Kind; 15 using Kind = Xbyak::Reg::Kind;
17 ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0, 16 ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0,
18 "RegSet only support GPRs and XMM registers."); 17 "RegSet only support GPRs and XMM registers.");
@@ -152,8 +151,8 @@ constexpr size_t ABI_SHADOW_SPACE = 0;
152 151
153#endif 152#endif
154 153
155void ABI_CalculateFrameSize(BitSet32 regs, size_t rsp_alignment, size_t needed_frame_size, 154inline void ABI_CalculateFrameSize(BitSet32 regs, size_t rsp_alignment, size_t needed_frame_size,
156 s32* out_subtraction, s32* out_xmm_offset) { 155 s32* out_subtraction, s32* out_xmm_offset) {
157 int count = (regs & ABI_ALL_GPRS).Count(); 156 int count = (regs & ABI_ALL_GPRS).Count();
158 rsp_alignment -= count * 8; 157 rsp_alignment -= count * 8;
159 size_t subtraction = 0; 158 size_t subtraction = 0;
@@ -174,8 +173,8 @@ void ABI_CalculateFrameSize(BitSet32 regs, size_t rsp_alignment, size_t needed_f
174 *out_xmm_offset = (s32)(subtraction - xmm_base_subtraction); 173 *out_xmm_offset = (s32)(subtraction - xmm_base_subtraction);
175} 174}
176 175
177size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs, 176inline size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs,
178 size_t rsp_alignment, size_t needed_frame_size = 0) { 177 size_t rsp_alignment, size_t needed_frame_size = 0) {
179 s32 subtraction, xmm_offset; 178 s32 subtraction, xmm_offset;
180 ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset); 179 ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset);
181 180
@@ -195,8 +194,8 @@ size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs
195 return ABI_SHADOW_SPACE; 194 return ABI_SHADOW_SPACE;
196} 195}
197 196
198void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs, size_t rsp_alignment, 197inline void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs,
199 size_t needed_frame_size = 0) { 198 size_t rsp_alignment, size_t needed_frame_size = 0) {
200 s32 subtraction, xmm_offset; 199 s32 subtraction, xmm_offset;
201 ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset); 200 ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size, &subtraction, &xmm_offset);
202 201
@@ -217,5 +216,4 @@ void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, BitSet32 regs, s
217 } 216 }
218} 217}
219 218
220} // namespace X64 219} // namespace Common::X64
221} // namespace Common
diff --git a/src/common/x64/xbyak_util.h b/src/common/x64/xbyak_util.h
index ec76e0a47..02323a017 100644
--- a/src/common/x64/xbyak_util.h
+++ b/src/common/x64/xbyak_util.h
@@ -8,8 +8,7 @@
8#include <xbyak.h> 8#include <xbyak.h>
9#include "common/x64/xbyak_abi.h" 9#include "common/x64/xbyak_abi.h"
10 10
11namespace Common { 11namespace Common::X64 {
12namespace X64 {
13 12
14// Constants for use with cmpps/cmpss 13// Constants for use with cmpps/cmpss
15enum { 14enum {
@@ -45,5 +44,4 @@ inline void CallFarFunction(Xbyak::CodeGenerator& code, const T f) {
45 } 44 }
46} 45}
47 46
48} // namespace X64 47} // namespace Common::X64
49} // namespace Common