mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
PPU LLVM: Implement inline __add_get_ov
This commit is contained in:
parent
f9ee8978ff
commit
382509d778
1 changed files with 8 additions and 1 deletions
|
@ -2961,8 +2961,15 @@ void PPUTranslator::ADD(ppu_opcode_t op)
|
||||||
const auto b = GetGpr(op.rb);
|
const auto b = GetGpr(op.rb);
|
||||||
const auto result = m_ir->CreateAdd(a, b);
|
const auto result = m_ir->CreateAdd(a, b);
|
||||||
SetGpr(op.rd, result);
|
SetGpr(op.rd, result);
|
||||||
|
|
||||||
|
if (op.oe)
|
||||||
|
{
|
||||||
|
//const auto s = m_ir->CreateCall(get_intrinsic<u64>(llvm::Intrinsic::sadd_with_overflow), {a, b});
|
||||||
|
//SetOverflow(m_ir->CreateExtractValue(s, {1}));
|
||||||
|
SetOverflow(m_ir->CreateICmpSLT(m_ir->CreateAnd(m_ir->CreateXor(a, m_ir->CreateNot(b)), m_ir->CreateXor(a, result)), m_ir->getInt64(0)));
|
||||||
|
}
|
||||||
|
|
||||||
if (op.rc) SetCrFieldSignedCmp(0, result, m_ir->getInt64(0));
|
if (op.rc) SetCrFieldSignedCmp(0, result, m_ir->getInt64(0));
|
||||||
if (op.oe) SetOverflow(Call(GetType<bool>(), m_pure_attr, "__add_get_ov", a, b));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPUTranslator::DCBT(ppu_opcode_t op)
|
void PPUTranslator::DCBT(ppu_opcode_t op)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue