Skip to content
Open
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
7 changes: 5 additions & 2 deletions src/coreclr/jit/codegenarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,13 @@ instruction CodeGen::genGetInsForOper(genTreeOps oper, var_types type)
case GT_MUL:
ins = INS_MUL;
break;
#if !defined(USE_HELPERS_FOR_INT_DIV)
#if !USE_HELPERS_FOR_INT_DIV
case GT_DIV:
ins = INS_sdiv;
break;
case GT_UDIV:
ins = INS_udiv;
break;
#endif // !USE_HELPERS_FOR_INT_DIV
case GT_LSH:
ins = INS_SHIFT_LEFT_LOGICAL;
Expand Down Expand Up @@ -1066,7 +1069,7 @@ void CodeGen::genCodeForDivMod(GenTreeOp* tree)
// on float/double args.
noway_assert(tree->OperIs(GT_DIV) || !varTypeIsFloating(tree));

#if defined(USE_HELPERS_FOR_INT_DIV)
#if USE_HELPERS_FOR_INT_DIV
noway_assert(!varTypeIsIntOrI(tree));
#endif // USE_HELPERS_FOR_INT_DIV

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/emitarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3208,7 +3208,7 @@ void emitter::emitIns_R_R_R(instruction ins,
}
}

#if !defined(USE_HELPERS_FOR_INT_DIV)
#if !USE_HELPERS_FOR_INT_DIV
FALLTHROUGH;
case INS_sdiv:
case INS_udiv:
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8086,7 +8086,7 @@ bool Lowering::TryLowerConstIntUDivOrUMod(GenTreeOp* divMod)
{
assert(divMod->OperIs(GT_UDIV, GT_UMOD));

#if defined(USE_HELPERS_FOR_INT_DIV)
#if USE_HELPERS_FOR_INT_DIV
if (!varTypeIsIntegral(divMod->TypeGet()))
{
assert(!"unreachable: integral GT_UDIV/GT_UMOD should get morphed into helper calls");
Expand Down Expand Up @@ -8403,7 +8403,7 @@ bool Lowering::TryLowerConstIntDivOrMod(GenTree* node, GenTree** nextNode)
const var_types type = divMod->TypeGet();
assert((type == TYP_INT) || (type == TYP_LONG));

#if defined(USE_HELPERS_FOR_INT_DIV)
#if USE_HELPERS_FOR_INT_DIV
assert(!"unreachable: integral GT_DIV/GT_MOD should get morphed into helper calls");
#endif // USE_HELPERS_FOR_INT_DIV
#if defined(TARGET_ARM64)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7378,7 +7378,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, bool* optAssertionPropDone)
goto USE_HELPER_FOR_ARITH;
}

#if USE_HELPERS_FOR_INT_DIV
#ifdef TARGET_ARM
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to call the helper even when native instruction is used?

if (typ == TYP_INT)
{
if (oper == GT_UMOD)
Expand All @@ -7392,7 +7392,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, bool* optAssertionPropDone)
goto USE_HELPER_FOR_ARITH;
}
}
#endif
#endif // TARGET_ARM
#endif // !defined(TARGET_64BIT) && !defined(TARGET_WASM)

if (tree->OperIs(GT_UMOD) && op2->IsIntegralConstUnsignedPow2())
Expand Down
Loading