ppu: improve vnmsubfp instruction

This commit is contained in:
scribam 2018-06-26 22:23:23 +02:00 committed by Ivan
parent 733efc6b0d
commit 2ed6e51d24
2 changed files with 2 additions and 2 deletions

View file

@ -1363,7 +1363,7 @@ bool ppu_interpreter::VMULOUH(ppu_thread& ppu, ppu_opcode_t op)
bool ppu_interpreter::VNMSUBFP(ppu_thread& ppu, ppu_opcode_t op) bool ppu_interpreter::VNMSUBFP(ppu_thread& ppu, ppu_opcode_t op)
{ {
ppu.vr[op.vd].vf = _mm_sub_ps(ppu.vr[op.vb].vf, _mm_mul_ps(ppu.vr[op.va].vf, ppu.vr[op.vc].vf)); ppu.vr[op.vd].vf = _mm_xor_ps(_mm_sub_ps(_mm_mul_ps(ppu.vr[op.va].vf, ppu.vr[op.vc].vf), ppu.vr[op.vb].vf), _mm_set1_ps(-0.0f));
return true; return true;
} }

View file

@ -1175,7 +1175,7 @@ void PPUTranslator::VMULOUH(ppu_opcode_t op)
void PPUTranslator::VNMSUBFP(ppu_opcode_t op) void PPUTranslator::VNMSUBFP(ppu_opcode_t op)
{ {
const auto acb = GetVrs(VrType::vf, op.va, op.vc, op.vb); const auto acb = GetVrs(VrType::vf, op.va, op.vc, op.vb);
SetVr(op.vd, m_ir->CreateFSub(acb[2], m_ir->CreateFMul(acb[0], acb[1]))); SetVr(op.vd, m_ir->CreateFNeg(m_ir->CreateFSub(m_ir->CreateFMul(acb[0], acb[1]), acb[2])));
} }
void PPUTranslator::VNOR(ppu_opcode_t op) void PPUTranslator::VNOR(ppu_opcode_t op)