diff --git a/src/coreclr/jit/lsraxarch.cpp b/src/coreclr/jit/lsraxarch.cpp index 4fc56947478aa..9e7bda9988006 100644 --- a/src/coreclr/jit/lsraxarch.cpp +++ b/src/coreclr/jit/lsraxarch.cpp @@ -1467,7 +1467,7 @@ int LinearScan::BuildBlockStore(GenTreeBlk* blkNode) // We need a float temporary if we're doing SIMD operations buildInternalFloatRegisterDefForNode(blkNode, internalFloatRegCandidates()); - SetContainsAVXFlags(size); + SetContainsAVXFlags(regSize); remainder %= regSize; } @@ -3053,18 +3053,9 @@ void LinearScan::SetContainsAVXFlags(unsigned sizeOfSIMDVector /* = 0*/) compiler->GetEmitter()->SetContainsAVX(true); - if (sizeOfSIMDVector == 32) - { - compiler->GetEmitter()->SetContains256bitOrMoreAVX(true); - } - - if (!compiler->canUseEvexEncoding()) - { - return; - } - - if (sizeOfSIMDVector == 64) + if (sizeOfSIMDVector >= 32) { + assert((sizeOfSIMDVector == 32) || ((sizeOfSIMDVector == 64) && compiler->canUseEvexEncoding())); compiler->GetEmitter()->SetContains256bitOrMoreAVX(true); } }