代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/luajit 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e99ac1bc2df5c1d138bbc98d35d1a1892144cf2b Mon Sep 17 00:00:00 2001
From: Sameera Deshpande <sameera.deshpande@linaro.org>
Date: Fri, 15 Feb 2019 07:46:16 +0530
Subject: [PATCH 65/72] Add support for FNMADD and FNMSUB.
---
src/lj_asm_arm64.h | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h
index a826687..470e65d 100644
--- a/src/lj_asm_arm64.h
+++ b/src/lj_asm_arm64.h
@@ -344,6 +344,35 @@ static int asm_fusemadd(ASMState *as, IRIns *ir, A64Ins ai, A64Ins air)
return 0;
}
+/* Fuse FP neg-multiply-add/sub. */
+static int asm_fusenmadd(ASMState *as, IRIns *ir, A64Ins ai, A64Ins air)
+{
+ IRRef ref = ir->op1;
+ IRIns *irn = IR(ref);
+ if (irn->o != IR_ADD && irn->o != IR_SUB)
+ return 0;
+
+ if (!mayfuse(as, ref))
+ return 0;
+
+ IRRef lref = irn->op1, rref = irn->op2;
+ IRIns *irm;
+ if (lref != rref &&
+ ((mayfuse(as, lref) && (irm = IR(lref), irm->o == IR_MUL) &&
+ ra_noreg(irm->r)) ||
+ (mayfuse(as, rref) && (irm = IR(rref), irm->o == IR_MUL) &&
+ (rref = lref, ra_noreg(irm->r))))) {
+ Reg dest = ra_dest(as, ir, RSET_FPR);
+ Reg add = ra_hintalloc(as, rref, dest, RSET_FPR);
+ Reg left = ra_alloc2(as, irm,
+ rset_exclude(rset_exclude(RSET_FPR, dest), add));
+ Reg right = (left >> 8); left &= 255;
+ emit_dnma(as, (irn->o == IR_ADD ? ai : air), (dest & 31), (left & 31), (right & 31), (add & 31));
+ return 1;
+ }
+ return 0;
+}
+
/* Fuse BAND + BSHL/BSHR into UBFM. */
static int asm_fuseandshift(ASMState *as, IRIns *ir)
{
@@ -1481,7 +1510,8 @@ static void asm_mod(ASMState *as, IRIns *ir)
static void asm_neg(ASMState *as, IRIns *ir)
{
if (irt_isnum(ir->t)) {
- asm_fpunary(as, ir, A64I_FNEGd);
+ if (!asm_fusenmadd(as, ir, A64I_FNMADDd))
+ asm_fpunary(as, ir, A64I_FNEGd);
return;
}
asm_intneg(as, ir);
--
2.20.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。