summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderX64.cpp
diff options
context:
space:
mode:
authorMarkus Wick <markus+github@selfnet.de>2015-01-27 09:15:09 +0100
committerMarkus Wick <markus+github@selfnet.de>2015-01-27 09:15:09 +0100
commit8eda3ca844ca9b05682ec57aa3be2cbe07e19d28 (patch)
treeca41a705f6bec4f097243c61f4c2fb7add6b8604 /Source/Core/VideoCommon/VertexLoaderX64.cpp
parentc20ef8bb8ca4f73c11f4874e0fe6008613e57e63 (diff)
parent3dbd6cd384b09c1afabe26c607ca60c088515f60 (diff)
Merge pull request #1956 from Tilka/vertex_loader_jit
VertexLoader: clean up and fix some problems
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));