Skip to content

Commit

Permalink
Fixing build errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakRajendrakumaran committed Nov 12, 2024
1 parent 23dd7d9 commit eb47ede
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
31 changes: 25 additions & 6 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,11 @@ void CodeGen::genCodeForNegNot(GenTree* tree)
assert(operand->isUsedFromReg());
regNumber operandReg = genConsumeReg(operand);
instruction ins = genGetInsForOper(tree->OperGet(), targetType);

if (JitConfig.JitEnableApxNDD() && GetEmitter()->IsApxNDDEncodableInstruction(ins) && (targetReg != operandReg))
if (
#ifdef DEBUG
JitConfig.JitEnableApxNDD() &&
#endif
GetEmitter()->IsApxNDDEncodableInstruction(ins) && (targetReg != operandReg))
{
GetEmitter()->emitIns_R_R(ins, emitTypeSize(operand), targetReg, operandReg, INS_OPTS_EVEX_nd);
}
Expand Down Expand Up @@ -1201,7 +1204,11 @@ void CodeGen::genCodeForBinary(GenTreeOp* treeNode)
// reg3 = reg3 op reg2
else
{
if (JitConfig.JitEnableApxNDD() && emit->IsApxNDDEncodableInstruction(ins) && !varTypeIsFloating(treeNode))
if (
#ifdef DEBUG
JitConfig.JitEnableApxNDD() &&
#endif
emit->IsApxNDDEncodableInstruction(ins) && !varTypeIsFloating(treeNode))
{
// TODO-xarch-apx:
// APX can provide optimal code gen in this case using NDD feature:
Expand Down Expand Up @@ -1376,7 +1383,11 @@ void CodeGen::genCodeForMul(GenTreeOp* treeNode)
}
assert(regOp->isUsedFromReg());

if (JitConfig.JitEnableApxNDD() && emit->IsApxNDDEncodableInstruction(ins) && regOp->GetRegNum() != mulTargetReg)
if (
#ifdef DEBUG
JitConfig.JitEnableApxNDD() &&
#endif
emit->IsApxNDDEncodableInstruction(ins) && regOp->GetRegNum() != mulTargetReg)
{
// use NDD form to optimize this form:
// mov targetReg, regOp
Expand Down Expand Up @@ -4947,7 +4958,11 @@ void CodeGen::genCodeForShift(GenTree* tree)
}


if (JitConfig.JitEnableApxNDD() && GetEmitter()->IsApxNDDEncodableInstruction(ins) && (tree->GetRegNum() != operandReg))
if (
#ifdef DEBUG
JitConfig.JitEnableApxNDD() &&
#endif
GetEmitter()->IsApxNDDEncodableInstruction(ins) && (tree->GetRegNum() != operandReg))
{
ins = genMapShiftInsToShiftByConstantIns(ins, shiftByValue);
// If APX is available, we can use NDD to optimize the case when LSRA failed to avoid explicit mov.
Expand Down Expand Up @@ -5009,7 +5024,11 @@ void CodeGen::genCodeForShift(GenTree* tree)
// The operand to be shifted must not be in ECX
noway_assert(operandReg != REG_RCX);

if (JitConfig.JitEnableApxNDD() && GetEmitter()->IsApxNDDEncodableInstruction(ins) && (tree->GetRegNum() != operandReg))
if (
#ifdef DEBUG
JitConfig.JitEnableApxNDD() &&
#endif
GetEmitter()->IsApxNDDEncodableInstruction(ins) && (tree->GetRegNum() != operandReg))
{
// If APX is available, we can use NDD to optimize the case when LSRA failed to avoid explicit mov.
// this case might be rarely hit.
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9895,10 +9895,12 @@ class Compiler
//
bool canUseApxEncodings() const
{
#ifdef DEBUG
if(JitConfig.JitBypassAPXCheck())
{
return true;
}
#endif
return compOpportunisticallyDependsOn(InstructionSet_APX);
}

Expand Down

0 comments on commit eb47ede

Please sign in to comment.