mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- don't use SSE for integer min/max
This commit is contained in:
parent
706a923884
commit
edc05111cd
1 changed files with 26 additions and 32 deletions
|
@ -447,46 +447,40 @@ void JitCompiler::EmitXOR_RK()
|
||||||
|
|
||||||
void JitCompiler::EmitMIN_RR()
|
void JitCompiler::EmitMIN_RR()
|
||||||
{
|
{
|
||||||
auto tmp0 = newTempXmmSs();
|
auto rc = CheckRegD(C, A);
|
||||||
auto tmp1 = newTempXmmSs();
|
if (A != B)
|
||||||
cc.movd(tmp0, regD[B]);
|
cc.mov(regD[A], regD[B]);
|
||||||
cc.movd(tmp1, regD[C]);
|
cc.cmp(rc, regD[A]);
|
||||||
cc.pminsd(tmp0, tmp1);
|
cc.cmovl(regD[A], rc);
|
||||||
cc.movd(regD[A], tmp0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitMIN_RK()
|
void JitCompiler::EmitMIN_RK()
|
||||||
{
|
{
|
||||||
auto tmp0 = newTempXmmSs();
|
auto rc = newTempInt32();
|
||||||
auto tmp1 = newTempXmmSs();
|
if (A != B)
|
||||||
auto konstTmp = newTempIntPtr();
|
cc.mov(regD[A], regD[B]);
|
||||||
cc.mov(konstTmp, asmjit::imm_ptr(&konstd[C]));
|
cc.mov(rc, asmjit::imm(konstd[C]));
|
||||||
cc.movd(tmp0, regD[B]);
|
cc.cmp(rc, regD[A]);
|
||||||
cc.movss(tmp1, asmjit::x86::dword_ptr(konstTmp));
|
cc.cmovl(regD[A], rc);
|
||||||
cc.pminsd(tmp0, tmp1);
|
|
||||||
cc.movd(regD[A], tmp0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitMAX_RR()
|
void JitCompiler::EmitMAX_RR()
|
||||||
{
|
{
|
||||||
auto tmp0 = newTempXmmSs();
|
auto rc = CheckRegD(C, A);
|
||||||
auto tmp1 = newTempXmmSs();
|
if (A != B)
|
||||||
cc.movd(tmp0, regD[B]);
|
cc.mov(regD[A], regD[B]);
|
||||||
cc.movd(tmp1, regD[C]);
|
cc.cmp(rc, regD[A]);
|
||||||
cc.pmaxsd(tmp0, tmp1);
|
cc.cmovg(regD[A], rc);
|
||||||
cc.movd(regD[A], tmp0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitMAX_RK()
|
void JitCompiler::EmitMAX_RK()
|
||||||
{
|
{
|
||||||
auto tmp0 = newTempXmmSs();
|
auto rc = newTempInt32();
|
||||||
auto tmp1 = newTempXmmSs();
|
if (A != B)
|
||||||
auto konstTmp = newTempIntPtr();
|
cc.mov(regD[A], regD[B]);
|
||||||
cc.mov(konstTmp, asmjit::imm_ptr(&konstd[C]));
|
cc.mov(rc, asmjit::imm(konstd[C]));
|
||||||
cc.movd(tmp0, regD[B]);
|
cc.cmp(rc, regD[A]);
|
||||||
cc.movss(tmp1, asmjit::x86::dword_ptr(konstTmp));
|
cc.cmovg(regD[A], rc);
|
||||||
cc.pmaxsd(tmp0, tmp1);
|
|
||||||
cc.movd(regD[A], tmp0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitABS()
|
void JitCompiler::EmitABS()
|
||||||
|
@ -852,7 +846,7 @@ void JitCompiler::EmitMINF_RR()
|
||||||
auto rc = CheckRegF(C, A);
|
auto rc = CheckRegF(C, A);
|
||||||
if (A != B)
|
if (A != B)
|
||||||
cc.movsd(regF[A], regF[B]);
|
cc.movsd(regF[A], regF[B]);
|
||||||
cc.minpd(regF[A], rc); // minsd required SSE 4.1
|
cc.minpd(regF[A], rc); // minsd requires SSE 4.1
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitMINF_RK()
|
void JitCompiler::EmitMINF_RK()
|
||||||
|
@ -861,7 +855,7 @@ void JitCompiler::EmitMINF_RK()
|
||||||
auto tmp = newTempIntPtr();
|
auto tmp = newTempIntPtr();
|
||||||
cc.mov(tmp, asmjit::imm_ptr(&konstf[C]));
|
cc.mov(tmp, asmjit::imm_ptr(&konstf[C]));
|
||||||
cc.movsd(regF[A], asmjit::x86::qword_ptr(tmp));
|
cc.movsd(regF[A], asmjit::x86::qword_ptr(tmp));
|
||||||
cc.minpd(regF[A], rb); // minsd required SSE 4.1
|
cc.minpd(regF[A], rb); // minsd requires SSE 4.1
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitMAXF_RR()
|
void JitCompiler::EmitMAXF_RR()
|
||||||
|
@ -869,7 +863,7 @@ void JitCompiler::EmitMAXF_RR()
|
||||||
auto rc = CheckRegF(C, A);
|
auto rc = CheckRegF(C, A);
|
||||||
if (A != B)
|
if (A != B)
|
||||||
cc.movsd(regF[A], regF[B]);
|
cc.movsd(regF[A], regF[B]);
|
||||||
cc.maxpd(regF[A], rc); // maxsd required SSE 4.1
|
cc.maxpd(regF[A], rc); // maxsd requires SSE 4.1
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitMAXF_RK()
|
void JitCompiler::EmitMAXF_RK()
|
||||||
|
@ -878,7 +872,7 @@ void JitCompiler::EmitMAXF_RK()
|
||||||
auto tmp = newTempIntPtr();
|
auto tmp = newTempIntPtr();
|
||||||
cc.mov(tmp, asmjit::imm_ptr(&konstf[C]));
|
cc.mov(tmp, asmjit::imm_ptr(&konstf[C]));
|
||||||
cc.movsd(regF[A], asmjit::x86::qword_ptr(tmp));
|
cc.movsd(regF[A], asmjit::x86::qword_ptr(tmp));
|
||||||
cc.maxpd(regF[A], rb); // maxsd required SSE 4.1
|
cc.maxpd(regF[A], rb); // maxsd requires SSE 4.1
|
||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::EmitATAN2()
|
void JitCompiler::EmitATAN2()
|
||||||
|
|
Loading…
Reference in a new issue