Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coreclr/jit/hwintrinsiccodegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,14 @@ void CodeGen::genBaseIntrinsic(GenTreeHWIntrinsic* node, insOpts instOptions)
}
baseReg = (isEBPbased) ? REG_EBP : REG_ESP;
}
else if (op1->IsCnsVec())
{
CORINFO_FIELD_HANDLE hnd =
GetEmitter()->emitSimdConst(&op1->AsVecCon()->gtSimdVal, emitTypeSize(op1));

baseReg = internalRegisters.GetSingle(node);
GetEmitter()->emitIns_R_C(INS_lea, emitTypeSize(TYP_I_IMPL), baseReg, hnd, 0, INS_OPTS_NONE);
}
else
{
// Require GT_IND addr to be not contained.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10121,7 +10121,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)
MakeSrcContained(node, op2);
}

if (IsContainableMemoryOp(op1) && IsSafeToContainMem(node, op1))
if (op1->IsCnsVec() || (IsContainableMemoryOp(op1) && IsSafeToContainMem(node, op1)))
{
MakeSrcContained(node, op1);
}
Expand Down
7 changes: 6 additions & 1 deletion src/coreclr/jit/lsraxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2304,12 +2304,17 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou

if (!op2->OperIsConst() && !op1->isContained())
{
// If the index is not a constant or op1 is in register,
// If the index is not a constant and op1 is in register,
// we will use the SIMD temp location to store the vector.

var_types requiredSimdTempType = Compiler::getSIMDTypeForSize(intrinsicTree->GetSimdSize());
compiler->getSIMDInitTempVarNum(requiredSimdTempType);
}
else if (op1->IsCnsVec())
{
// We need an int reg to load the address of the CnsVec data.
buildInternalIntRegisterDefForNode(intrinsicTree);
}
break;
}

Expand Down
Loading