diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index d1f7a1ec..8a9faa1b 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -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") diff --git a/src/frontend/A64/translate/impl/floating_point_data_processing_one_register.cpp b/src/frontend/A64/translate/impl/floating_point_data_processing_one_register.cpp index 4eea893a..7cb71085 100644 --- a/src/frontend/A64/translate/impl/floating_point_data_processing_one_register.cpp +++ b/src/frontend/A64/translate/impl/floating_point_data_processing_one_register.cpp @@ -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 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