From 3a3542414b3989693075a4aeabae997f1ec4154d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 9 Mar 2019 17:39:08 -0500 Subject: [PATCH] A64: Implement FRECPX's half-precision floating point variant --- src/frontend/A64/decoder/a64.inc | 2 +- .../A64/translate/impl/simd_scalar_two_register_misc.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index 6bef2c70..707f1a0d 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -420,7 +420,7 @@ INST(FCVTPS_2, "FCVTPS (vector)", "01011 INST(FCVTZS_int_2, "FCVTZS (vector, integer)", "010111101z100001101110nnnnnddddd") //INST(FRECPE_1, "FRECPE", "0101111011111001110110nnnnnddddd") INST(FRECPE_2, "FRECPE", "010111101z100001110110nnnnnddddd") -//INST(FRECPX_1, "FRECPX", "0101111011111001111110nnnnnddddd") +INST(FRECPX_1, "FRECPX", "0101111011111001111110nnnnnddddd") INST(FRECPX_2, "FRECPX", "010111101z100001111110nnnnnddddd") //INST(FCVTNU_1, "FCVTNU (vector)", "0111111001111001101010nnnnnddddd") INST(FCVTNU_2, "FCVTNU (vector)", "011111100z100001101010nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp b/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp index 7dcc89d3..d9b3e29c 100644 --- a/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp +++ b/src/frontend/A64/translate/impl/simd_scalar_two_register_misc.cpp @@ -182,6 +182,14 @@ bool TranslatorVisitor::FRECPE_2(bool sz, Vec Vn, Vec Vd) { return true; } +bool TranslatorVisitor::FRECPX_1(Vec Vn, Vec Vd) { + const IR::U16 operand = V_scalar(16, Vn); + const IR::U16 result = ir.FPRecipExponent(operand); + + V_scalar(16, Vd, result); + return true; +} + bool TranslatorVisitor::FRECPX_2(bool sz, Vec Vn, Vec Vd) { const size_t esize = sz ? 64 : 32;