A64: Implement FSQRT (scalar)

This commit is contained in:
MerryMage 2018-02-18 12:54:51 +00:00
parent 07520f32c3
commit 0e157b0198
2 changed files with 13 additions and 1 deletions

View file

@ -899,7 +899,7 @@ INST(FCVTZU_float_int, "FCVTZU (scalar, integer)", "z0011
INST(FMOV_float, "FMOV (register)", "00011110yy100000010000nnnnnddddd") INST(FMOV_float, "FMOV (register)", "00011110yy100000010000nnnnnddddd")
INST(FABS_float, "FABS (scalar)", "00011110yy100000110000nnnnnddddd") INST(FABS_float, "FABS (scalar)", "00011110yy100000110000nnnnnddddd")
INST(FNEG_float, "FNEG (scalar)", "00011110yy100001010000nnnnnddddd") INST(FNEG_float, "FNEG (scalar)", "00011110yy100001010000nnnnnddddd")
//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")

View file

@ -58,6 +58,18 @@ bool TranslatorVisitor::FNEG_float(Imm<2> type, Vec Vn, Vec Vd) {
return true; return true;
} }
bool TranslatorVisitor::FSQRT_float(Imm<2> type, Vec Vn, Vec Vd) {
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.FPSqrt(operand);
V_scalar(*datasize, Vd, result);
return true;
}
bool TranslatorVisitor::FMOV_float_imm(Imm<2> type, Imm<8> imm8, Vec Vd) { bool TranslatorVisitor::FMOV_float_imm(Imm<2> type, Imm<8> imm8, Vec Vd) {
boost::optional<size_t> datasize = GetDataSize(type); boost::optional<size_t> datasize = GetDataSize(type);
if (!datasize) { if (!datasize) {