A64: Implement FRINTP, FRINTM, FRINTZ (scalar)

This commit is contained in:
MerryMage 2018-07-16 13:58:58 +01:00
parent 5200bf41cf
commit 962fa3b65e
2 changed files with 15 additions and 3 deletions

View file

@ -906,9 +906,9 @@ INST(FNEG_float, "FNEG (scalar)", "00011
INST(FSQRT_float, "FSQRT (scalar)", "00011110yy100001110000nnnnnddddd") INST(FSQRT_float, "FSQRT (scalar)", "00011110yy100001110000nnnnnddddd")
INST(FCVT_float, "FCVT", "00011110yy10001oo10000nnnnnddddd") INST(FCVT_float, "FCVT", "00011110yy10001oo10000nnnnnddddd")
INST(FRINTN_float, "FRINTN (scalar)", "00011110yy100100010000nnnnnddddd") INST(FRINTN_float, "FRINTN (scalar)", "00011110yy100100010000nnnnnddddd")
//INST(FRINTP_float, "FRINTP (scalar)", "00011110yy100100110000nnnnnddddd") INST(FRINTP_float, "FRINTP (scalar)", "00011110yy100100110000nnnnnddddd")
//INST(FRINTM_float, "FRINTM (scalar)", "00011110yy100101010000nnnnnddddd") INST(FRINTM_float, "FRINTM (scalar)", "00011110yy100101010000nnnnnddddd")
//INST(FRINTZ_float, "FRINTZ (scalar)", "00011110yy100101110000nnnnnddddd") 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(FRINTX_float, "FRINTX (scalar)", "00011110yy100111010000nnnnnddddd")
//INST(FRINTI_float, "FRINTI (scalar)", "00011110yy100111110000nnnnnddddd") //INST(FRINTI_float, "FRINTI (scalar)", "00011110yy100111110000nnnnnddddd")

View file

@ -168,6 +168,18 @@ bool TranslatorVisitor::FRINTN_float(Imm<2> type, Vec Vn, Vec Vd) {
return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::ToNearest_TieEven, false); return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::ToNearest_TieEven, false);
} }
bool TranslatorVisitor::FRINTP_float(Imm<2> type, Vec Vn, Vec Vd) {
return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::TowardsPlusInfinity, false);
}
bool TranslatorVisitor::FRINTM_float(Imm<2> type, Vec Vn, Vec Vd) {
return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::TowardsMinusInfinity, false);
}
bool TranslatorVisitor::FRINTZ_float(Imm<2> type, Vec Vn, Vec Vd) {
return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::TowardsZero, false);
}
bool TranslatorVisitor::FRINTA_float(Imm<2> type, Vec Vn, Vec Vd) { bool TranslatorVisitor::FRINTA_float(Imm<2> type, Vec Vn, Vec Vd) {
return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::ToNearest_TieAwayFromZero, false); return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::ToNearest_TieAwayFromZero, false);
} }