diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index a37012b7..70a2461e 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -899,7 +899,7 @@ INST(FCVTZU_float_int, "FCVTZU (scalar, integer)", "z0011 INST(FMOV_float, "FMOV (register)", "00011110yy100000010000nnnnnddddd") INST(FABS_float, "FABS (scalar)", "00011110yy100000110000nnnnnddddd") INST(FNEG_float, "FNEG (scalar)", "00011110yy100001010000nnnnnddddd") -//INST(FSQRT_float, "FSQRT (scalar)", "00011110yy100001110000nnnnnddddd") +INST(FSQRT_float, "FSQRT (scalar)", "00011110yy100001110000nnnnnddddd") INST(FCVT_float, "FCVT", "00011110yy10001oo10000nnnnnddddd") //INST(FRINTN_float, "FRINTN (scalar)", "00011110yy100100010000nnnnnddddd") //INST(FRINTP_float, "FRINTP (scalar)", "00011110yy100100110000nnnnnddddd") 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 ceef79a8..4eea893a 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 @@ -58,6 +58,18 @@ bool TranslatorVisitor::FNEG_float(Imm<2> type, Vec Vn, Vec Vd) { return true; } +bool TranslatorVisitor::FSQRT_float(Imm<2> type, Vec Vn, Vec Vd) { + boost::optional datasize = GetDataSize(type); + if (!datasize || *datasize == 16) { + return UnallocatedEncoding(); + } + + const IR::U32U64 operand = V_scalar(*datasize, Vn); + const IR::U32U64 result = ir.FPSqrt(operand); + V_scalar(*datasize, Vd, result); + return true; +} + bool TranslatorVisitor::FMOV_float_imm(Imm<2> type, Imm<8> imm8, Vec Vd) { boost::optional datasize = GetDataSize(type); if (!datasize) {