From 62089aa1e8ac31d39f98f25e9d8c94c6c4263cbb Mon Sep 17 00:00:00 2001 From: William Chen Date: Tue, 8 Jun 2021 12:09:16 -0700 Subject: [PATCH] fix load/store pair of large agg dread for large offset size --- .../maple_be/src/cg/aarch64/aarch64_cgfunc.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp index 5024936740..ef9657d39d 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp @@ -1156,6 +1156,13 @@ void AArch64CGFunc::SelectAggDassign(DassignNode &stmt) { } else { MOperator mOp = PickStInsn(copySize * k8BitSize, PTY_u32); GetCurBB()->AppendInsn(GetCG()->BuildInstruction(mOp, result, *lhsMemOpnd)); + if (doPair) { + AArch64OfstOperand &lhsOfstOpnd1 = GetOrCreateOfstOpnd(lhsBaseOffset + copySize, k32BitSize); + MemOperand *lhsMemOpnd1 = + &GetOrCreateMemOpnd(addrMode, copySize * k8BitSize, lhsBaseReg, nullptr, &lhsOfstOpnd1, sym); + lhsMemOpnd1 = FixLargeMemOpnd(*lhsMemOpnd1, copySize); + GetCurBB()->AppendInsn(GetCG()->BuildInstruction(mOp, *result1, *lhsMemOpnd1)); + } } } /* take care of extra content at the end less than the unit */ @@ -1255,6 +1262,13 @@ void AArch64CGFunc::SelectAggDassign(DassignNode &stmt) { } else { MOperator mOp = PickStInsn(copySize * k8BitSize, PTY_u32); GetCurBB()->AppendInsn(GetCG()->BuildInstruction(mOp, result, *lhsMemOpnd)); + if (doPair) { + AArch64OfstOperand &lhsOfstOpnd1 = GetOrCreateOfstOpnd(lhsBaseOffset + copySize, k32BitSize); + MemOperand *lhsMemOpnd1 = + &GetOrCreateMemOpnd(addrMode, copySize * k8BitSize, lhsBaseReg, nullptr, &lhsOfstOpnd1, sym); + lhsMemOpnd1 = FixLargeMemOpnd(*lhsMemOpnd1, copySize); + GetCurBB()->AppendInsn(GetCG()->BuildInstruction(mOp, *result1, *lhsMemOpnd1)); + } } } /* take care of extra content at the end less than the unit of alignUsed */ -- Gitee