summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-08-24 01:46:10 -0300
committerGravatar Yuri Kunde Schlesner2015-08-24 01:46:10 -0300
commit76247170dfc43d1d01f71447893915ec02686990 (patch)
tree2e99549de55953a1928adb52f9dc13a6d1b9a676 /src
parentShader JIT: Fix CMP NaN behavior to match hardware (diff)
downloadyuzu-76247170dfc43d1d01f71447893915ec02686990.tar.gz
yuzu-76247170dfc43d1d01f71447893915ec02686990.tar.xz
yuzu-76247170dfc43d1d01f71447893915ec02686990.zip
Shader JIT: Add name to second scratch register (XMM4)
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/shader_jit_x64.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp
index 2a1e51013..e56bff2b8 100644
--- a/src/video_core/shader/shader_jit_x64.cpp
+++ b/src/video_core/shader/shader_jit_x64.cpp
@@ -115,6 +115,8 @@ static const X64Reg SRC1 = XMM1;
115static const X64Reg SRC2 = XMM2; 115static const X64Reg SRC2 = XMM2;
116/// Loaded with the third swizzled source register, otherwise can be used as a scratch register 116/// Loaded with the third swizzled source register, otherwise can be used as a scratch register
117static const X64Reg SRC3 = XMM3; 117static const X64Reg SRC3 = XMM3;
118/// Additional scratch register
119static const X64Reg SCRATCH2 = XMM4;
118/// Constant vector of [1.0f, 1.0f, 1.0f, 1.0f], used to efficiently set a vector to one 120/// Constant vector of [1.0f, 1.0f, 1.0f, 1.0f], used to efficiently set a vector to one
119static const X64Reg ONE = XMM14; 121static const X64Reg ONE = XMM14;
120/// Constant vector of [-0.f, -0.f, -0.f, -0.f], used to efficiently negate a vector with XOR 122/// Constant vector of [-0.f, -0.f, -0.f, -0.f], used to efficiently negate a vector with XOR
@@ -227,8 +229,8 @@ void JitCompiler::Compile_DestEnable(Instruction instr,X64Reg src) {
227 u8 mask = ((swiz.dest_mask & 1) << 3) | ((swiz.dest_mask & 8) >> 3) | ((swiz.dest_mask & 2) << 1) | ((swiz.dest_mask & 4) >> 1); 229 u8 mask = ((swiz.dest_mask & 1) << 3) | ((swiz.dest_mask & 8) >> 3) | ((swiz.dest_mask & 2) << 1) | ((swiz.dest_mask & 4) >> 1);
228 BLENDPS(SCRATCH, R(src), mask); 230 BLENDPS(SCRATCH, R(src), mask);
229 } else { 231 } else {
230 MOVAPS(XMM4, R(src)); 232 MOVAPS(SCRATCH2, R(src));
231 UNPCKHPS(XMM4, R(SCRATCH)); // Unpack X/Y components of source and destination 233 UNPCKHPS(SCRATCH2, R(SCRATCH)); // Unpack X/Y components of source and destination
232 UNPCKLPS(SCRATCH, R(src)); // Unpack Z/W components of source and destination 234 UNPCKLPS(SCRATCH, R(src)); // Unpack Z/W components of source and destination
233 235
234 // Compute selector to selectively copy source components to destination for SHUFPS instruction 236 // Compute selector to selectively copy source components to destination for SHUFPS instruction
@@ -236,7 +238,7 @@ void JitCompiler::Compile_DestEnable(Instruction instr,X64Reg src) {
236 ((swiz.DestComponentEnabled(1) ? 3 : 2) << 2) | 238 ((swiz.DestComponentEnabled(1) ? 3 : 2) << 2) |
237 ((swiz.DestComponentEnabled(2) ? 0 : 1) << 4) | 239 ((swiz.DestComponentEnabled(2) ? 0 : 1) << 4) |
238 ((swiz.DestComponentEnabled(3) ? 2 : 3) << 6); 240 ((swiz.DestComponentEnabled(3) ? 2 : 3) << 6);
239 SHUFPS(SCRATCH, R(XMM4), sel); 241 SHUFPS(SCRATCH, R(SCRATCH2), sel);
240 } 242 }
241 243
242 // Store dest back to memory 244 // Store dest back to memory