A64: Implement FRINTA (scalar)

This commit is contained in:
MerryMage 2018-07-16 13:49:32 +01:00
parent b228694012
commit 8718dc1692
2 changed files with 13 additions and 1 deletions

View file

@ -909,7 +909,7 @@ INST(FCVT_float, "FCVT", "00011
//INST(FRINTP_float, "FRINTP (scalar)", "00011110yy100100110000nnnnnddddd")
//INST(FRINTM_float, "FRINTM (scalar)", "00011110yy100101010000nnnnnddddd")
//INST(FRINTZ_float, "FRINTZ (scalar)", "00011110yy100101110000nnnnnddddd")
//INST(FRINTA_float, "FRINTA (scalar)", "00011110yy100110010000nnnnnddddd")
INST(FRINTA_float, "FRINTA (scalar)", "00011110yy100110010000nnnnnddddd")
//INST(FRINTX_float, "FRINTX (scalar)", "00011110yy100111010000nnnnnddddd")
//INST(FRINTI_float, "FRINTI (scalar)", "00011110yy100111110000nnnnnddddd")

View file

@ -152,4 +152,16 @@ bool TranslatorVisitor::FCVT_float(Imm<2> type, Imm<2> opc, Vec Vn, Vec Vd) {
return true;
}
bool TranslatorVisitor::FRINTA_float(Imm<2> type, Vec Vn, Vec Vd) {
const boost::optional<size_t> datasize = GetDataSize(type);
if (!datasize || *datasize == 16) {
return UnallocatedEncoding();
}
const IR::U32U64 operand = V_scalar(*datasize, Vn);
const IR::U32U64 result = ir.FPRoundInt(operand, FP::RoundingMode::ToNearest_TieAwayFromZero, false);
V_scalar(*datasize, Vd, result);
return true;
}
} // namespace Dynarmic::A64