From 962fa3b65eecba9ca0962fb79e93a70d09e9aaa0 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 16 Jul 2018 13:58:58 +0100 Subject: [PATCH] A64: Implement FRINTP, FRINTM, FRINTZ (scalar) --- src/frontend/A64/decoder/a64.inc | 6 +++--- .../floating_point_data_processing_one_register.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index c929ee3a..38494aaa 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -906,9 +906,9 @@ INST(FNEG_float, "FNEG (scalar)", "00011 INST(FSQRT_float, "FSQRT (scalar)", "00011110yy100001110000nnnnnddddd") INST(FCVT_float, "FCVT", "00011110yy10001oo10000nnnnnddddd") INST(FRINTN_float, "FRINTN (scalar)", "00011110yy100100010000nnnnnddddd") -//INST(FRINTP_float, "FRINTP (scalar)", "00011110yy100100110000nnnnnddddd") -//INST(FRINTM_float, "FRINTM (scalar)", "00011110yy100101010000nnnnnddddd") -//INST(FRINTZ_float, "FRINTZ (scalar)", "00011110yy100101110000nnnnnddddd") +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(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 fe1c1f2c..fd9d7467 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 @@ -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); } +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) { return FloatingPointRoundToIntegral(*this, type, Vn, Vd, FP::RoundingMode::ToNearest_TieAwayFromZero, false); }