summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderX64.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-01-15 02:48:28 +0100
committerTillmann Karras <tilkax@gmail.com>2015-01-18 13:30:19 +0100
commitf5545477e3d45d575f6656ded9f251676588a11c (patch)
treef2c3396f05f4729ae3ef60b117dba697718d2def /Source/Core/VideoCommon/VertexLoaderX64.cpp
parentb27ba3802e0b28c7c046c955fa33f1361e666e63 (diff)
VertexLoaderX64: suggestions by @magumagu
- avoid register merges - avoid redundant MOV
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderX64.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderX64.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp
index a8a3738c9c..b59de2c71d 100644
--- a/Source/Core/VideoCommon/VertexLoaderX64.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp
@@ -41,10 +41,10 @@ OpArg VertexLoaderX64::GetVertexAddr(int array, u64 attribute)
}
else
{
- MOVZX(64, 16, scratch1, data);
+ MOV(16, R(scratch1), data);
m_src_ofs += 2;
- // Convert to little-endian.
- ROR(16, R(scratch1), Imm8(8));
+ BSWAP(16, scratch1);
+ MOVZX(64, 16, scratch1, R(scratch1));
}
if (array == ARRAY_POSITION)
{
@@ -173,17 +173,16 @@ void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format, int eleme
MOV(32, R(scratch3), R(scratch1));
SHL(32, R(scratch1), Imm8(16));
AND(32, R(scratch1), Imm32(0xF8000000));
- MOV(32, R(scratch2), R(scratch1));
- MOV(32, R(scratch1), R(scratch3));
- SHL(32, R(scratch1), Imm8(13));
- AND(32, R(scratch1), Imm32(0x00FC0000));
- OR(32, R(scratch2), R(scratch1));
+ MOV(32, R(scratch2), R(scratch3));
+ SHL(32, R(scratch2), Imm8(13));
+ AND(32, R(scratch2), Imm32(0x00FC0000));
+ OR(32, R(scratch1), R(scratch2));
SHL(32, R(scratch3), Imm8(11));
AND(32, R(scratch3), Imm32(0x0000F800));
- OR(32, R(scratch2), R(scratch3));
- MOV(32, R(scratch1), R(scratch2));
+ OR(32, R(scratch1), R(scratch3));
+ MOV(32, R(scratch2), R(scratch1));
}
SHR(32, R(scratch1), Imm8(5));