summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderX64.cpp
diff options
context:
space:
mode:
authorflacs <tilkax@gmail.com>2015-08-26 16:43:45 +0200
committerflacs <tilkax@gmail.com>2015-08-26 16:43:45 +0200
commit99e88a7af74dd739d1e73447b87f6c2ab78c44a6 (patch)
tree47e026781e355f96fd5d5853c2340b22f2caa638 /Source/Core/VideoCommon/VertexLoaderX64.cpp
parenteb6ac641bea5f959349d1a46334e7fb0c0aae305 (diff)
parentee4a12ffe2cccb41c1cfc136e55903dc03a3e17c (diff)
Merge pull request #2887 from Tilka/swap
Jit64: some byte-swapping changes
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderX64.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderX64.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp
index a298d7e1dd..dd9cd0528d 100644
--- a/Source/Core/VideoCommon/VertexLoaderX64.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp
@@ -53,21 +53,12 @@ OpArg VertexLoaderX64::GetVertexAddr(int array, u64 attribute)
OpArg data = MDisp(src_reg, m_src_ofs);
if (attribute & MASK_INDEXED)
{
- if (attribute == INDEX8)
- {
- MOVZX(64, 8, scratch1, data);
- m_src_ofs += 1;
- }
- else
- {
- MOV(16, R(scratch1), data);
- m_src_ofs += 2;
- BSWAP(16, scratch1);
- MOVZX(64, 16, scratch1, R(scratch1));
- }
+ int bits = attribute == INDEX8 ? 8 : 16;
+ LoadAndSwap(bits, scratch1, data);
+ m_src_ofs += bits / 8;
if (array == ARRAY_POSITION)
{
- CMP(attribute == INDEX8 ? 8 : 16, R(scratch1), Imm8(-1));
+ CMP(bits, R(scratch1), Imm8(-1));
m_skip_vertex = J_CC(CC_E, true);
}
IMUL(32, scratch1, MPIC(&g_main_cp_state.array_strides[array]));