From f5e11d117ae17355729fd4a3699aa46bd170dbcf Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 2 Aug 2018 14:11:30 +0100 Subject: [PATCH] A64: Implement FMULX, scalar single/double variant --- src/frontend/A64/decoder/a64.inc | 2 +- .../A64/translate/impl/simd_scalar_three_same.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/frontend/A64/decoder/a64.inc b/src/frontend/A64/decoder/a64.inc index 63b40dc1..8d9c9b93 100644 --- a/src/frontend/A64/decoder/a64.inc +++ b/src/frontend/A64/decoder/a64.inc @@ -339,7 +339,7 @@ INST(DUP_elt_1, "DUP (element)", "01011 // Data Processing - FP and SIMD - Scalar three //INST(FMULX_vec_1, "FMULX", "01011110010mmmmm000111nnnnnddddd") -//INST(FMULX_vec_2, "FMULX", "010111100z1mmmmm110111nnnnnddddd") +INST(FMULX_vec_2, "FMULX", "010111100z1mmmmm110111nnnnnddddd") //INST(FCMEQ_reg_1, "FCMEQ (register)", "01011110010mmmmm001001nnnnnddddd") INST(FCMEQ_reg_2, "FCMEQ (register)", "010111100z1mmmmm111001nnnnnddddd") //INST(FRECPS_1, "FRECPS", "01011110010mmmmm001111nnnnnddddd") diff --git a/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp b/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp index dfd4ee10..2e954a32 100644 --- a/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp +++ b/src/frontend/A64/translate/impl/simd_scalar_three_same.cpp @@ -203,6 +203,17 @@ bool TranslatorVisitor::FABD_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { return true; } +bool TranslatorVisitor::FMULX_vec_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { + const size_t esize = sz ? 64 : 32; + + const IR::U32U64 operand1 = V_scalar(esize, Vn); + const IR::U32U64 operand2 = V_scalar(esize, Vm); + const IR::U32U64 result = ir.FPMulX(operand1, operand2); + + V_scalar(esize, Vd, result); + return true; +} + bool TranslatorVisitor::FRECPS_2(bool sz, Vec Vm, Vec Vn, Vec Vd) { const size_t esize = sz ? 64 : 32;