mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-26 00:52:46 -06:00
fixup! shader_jit_x64_compiler: Use haddps for horizontal summation
This commit is contained in:
parent
efec8fe513
commit
6c199e4699
1 changed files with 4 additions and 24 deletions
|
@ -387,18 +387,8 @@ void JitShader::Compile_DP4(Instruction instr) {
|
||||||
|
|
||||||
Compile_SanitizedMul(SRC1, SRC2, SCRATCH);
|
Compile_SanitizedMul(SRC1, SRC2, SCRATCH);
|
||||||
|
|
||||||
if (Common::GetCPUCaps().sse3) {
|
|
||||||
haddps(SRC1, SRC1);
|
haddps(SRC1, SRC1);
|
||||||
haddps(SRC1, SRC1);
|
haddps(SRC1, SRC1);
|
||||||
} else {
|
|
||||||
movaps(SRC2, SRC1);
|
|
||||||
shufps(SRC1, SRC1, _MM_SHUFFLE(2, 3, 0, 1)); // XYZW -> ZWXY
|
|
||||||
addps(SRC1, SRC2);
|
|
||||||
|
|
||||||
movaps(SRC2, SRC1);
|
|
||||||
shufps(SRC1, SRC1, _MM_SHUFFLE(0, 1, 2, 3)); // XYZW -> WZYX
|
|
||||||
addps(SRC1, SRC2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Compile_DestEnable(instr, SRC1);
|
Compile_DestEnable(instr, SRC1);
|
||||||
}
|
}
|
||||||
|
@ -424,18 +414,8 @@ void JitShader::Compile_DPH(Instruction instr) {
|
||||||
|
|
||||||
Compile_SanitizedMul(SRC1, SRC2, SCRATCH);
|
Compile_SanitizedMul(SRC1, SRC2, SCRATCH);
|
||||||
|
|
||||||
if (Common::GetCPUCaps().sse3) {
|
|
||||||
haddps(SRC1, SRC1);
|
haddps(SRC1, SRC1);
|
||||||
haddps(SRC1, SRC1);
|
haddps(SRC1, SRC1);
|
||||||
} else {
|
|
||||||
movaps(SRC2, SRC1);
|
|
||||||
shufps(SRC1, SRC1, _MM_SHUFFLE(2, 3, 0, 1)); // XYZW -> ZWXY
|
|
||||||
addps(SRC1, SRC2);
|
|
||||||
|
|
||||||
movaps(SRC2, SRC1);
|
|
||||||
shufps(SRC1, SRC1, _MM_SHUFFLE(0, 1, 2, 3)); // XYZW -> WZYX
|
|
||||||
addps(SRC1, SRC2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Compile_DestEnable(instr, SRC1);
|
Compile_DestEnable(instr, SRC1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue