Support FCTID/FCTIW instructions

This commit is contained in:
raven02 2014-10-24 00:46:04 +08:00 committed by raven02
parent 5d1cafdebc
commit 4eb4186b5c
3 changed files with 16 additions and 4 deletions

View file

@ -3919,7 +3919,12 @@ void PPULLVMRecompiler::FRSP(u32 frd, u32 frb, bool rc) {
}
void PPULLVMRecompiler::FCTIW(u32 frd, u32 frb, bool rc) {
InterpreterCall("FCTIW", &PPUInterpreter::FCTIW, frd, frb, rc);
auto rb_f64 = GetFpr(frb);
auto res_i32 = m_ir_builder->CreateFPToSI(rb_f64, m_ir_builder->getInt32Ty());
SetFpr(frd, res_i32);
// TODO: Set flags / Handle NaN / Implement Saturation
//InterpreterCall("FCTIW", &PPUInterpreter::FCTIW, frd, frb, rc);
}
void PPULLVMRecompiler::FCTIWZ(u32 frd, u32 frb, bool rc) {
@ -4070,7 +4075,12 @@ void PPULLVMRecompiler::FABS(u32 frd, u32 frb, bool rc) {
}
void PPULLVMRecompiler::FCTID(u32 frd, u32 frb, bool rc) {
InterpreterCall("FCTID", &PPUInterpreter::FCTID, frd, frb, rc);
auto rb_f64 = GetFpr(frb);
auto res_i64 = m_ir_builder->CreateFPToSI(rb_f64, m_ir_builder->getInt64Ty());
SetFpr(frd, res_i64);
// TODO: Set flags / Handle NaN / Implement Saturation
//InterpreterCall("FCTID", &PPUInterpreter::FCTID, frd, frb, rc);
}
void PPULLVMRecompiler::FCTIDZ(u32 frd, u32 frb, bool rc) {