summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderX64.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-01-26 00:55:33 +0100
committerTillmann Karras <tilkax@gmail.com>2015-01-26 22:24:06 +0100
commit3dbd6cd384b09c1afabe26c607ca60c088515f60 (patch)
tree3ddcaff71961ca481cae94ae9515467872a5d41c /Source/Core/VideoCommon/VertexLoaderX64.cpp
parent8416a86b6deceab44f4ebb446838976d53637149 (diff)
VertexLoaderX64: save XMM0 if the ABI requires it
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderX64.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderX64.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp
index de3b90b449..50c46da027 100644
--- a/Source/Core/VideoCommon/VertexLoaderX64.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp
@@ -11,6 +11,8 @@
using namespace Gen;
+#define VERTEX_LOADER_REGS {XMM0+16}
+
static const X64Reg src_reg = ABI_PARAM1;
static const X64Reg dst_reg = ABI_PARAM2;
static const X64Reg scratch1 = RAX;
@@ -293,10 +295,12 @@ void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format)
void VertexLoaderX64::GenerateVertexLoader()
{
+ ABI_PushRegistersAndAdjustStack(VERTEX_LOADER_REGS, 8);
+
// Backup count since we're going to count it down.
PUSH(32, R(ABI_PARAM3));
- // We use ABI_PARAM3 for scratch2.
+ // ABI_PARAM3 is one of the lower registers, so free it for scratch2.
MOV(32, R(count_reg), R(ABI_PARAM3));
if (m_VtxDesc.Position & MASK_INDEXED)
@@ -427,6 +431,8 @@ void VertexLoaderX64::GenerateVertexLoader()
// Get the original count.
POP(32, R(ABI_RETURN));
+ ABI_PopRegistersAndAdjustStack(VERTEX_LOADER_REGS, 8);
+
if (m_VtxDesc.Position & MASK_INDEXED)
{
SUB(32, R(ABI_RETURN), R(skipped_reg));