From 795947979ea66ac2a3e05af1f69fefdfe597a62b Mon Sep 17 00:00:00 2001 From: Alfred Huang Date: Thu, 7 Oct 2021 15:36:01 -0700 Subject: [PATCH] Fixed SelectVectorFromScalar() for handling 64x_1 scalar --- .../maple_be/src/cg/aarch64/aarch64_cgfunc.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 834575ca2d..d5b7bddcb4 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_cgfunc.cpp @@ -9336,12 +9336,15 @@ RegOperand *AArch64CGFunc::AdjustOneElementVectorOperand(PrimType oType, RegOper } RegOperand *AArch64CGFunc::SelectVectorFromScalar(PrimType rType, Operand *src, PrimType sType) { - if (!IsPrimitiveVector(rType)) { - RegOperand *res = &CreateRegisterOperandOfType(PTY_f64); - Insn *insn = &GetCG()->BuildInstruction(MOP_xvmovdr, *res, *src); - GetCurBB()->AppendInsn(*insn); /* move xreg to dreg */ - static_cast(res)->SetIF64Vec(); - return static_cast(res); + if (!IsPrimitiveVector(rType)) { /* 64x1 type */ + if (src->IsConstImmediate()) { + RegOperand *res = &CreateRegisterOperandOfType(rType); + Insn *insn = &GetCG()->BuildInstruction(MOP_xmovri64, *res, *src); + GetCurBB()->AppendInsn(*insn); + return static_cast(res); + } else { + return &SelectCopy(*src, rType, rType); + } } RegOperand *res = &CreateRegisterOperandOfType(rType); /* result operand */ VectorRegSpec *vecSpec = GetMemoryPool()->New(); -- Gitee