Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13926 from sdmaclea/PR-ARM64-BOUND-CHECK
Browse files Browse the repository at this point in the history
[Arm64] Enable Lowering GT_ARR_BOUNDS_CHECK
  • Loading branch information
CarolEidt authored Sep 18, 2017
2 parents 3cd2e14 + c949331 commit 481a04f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,16 @@ void CodeGen::genRangeCheck(GenTreePtr oper)
jmpKind = genJumpKindForOper(GT_GE, CK_UNSIGNED);
}

getEmitter()->emitInsBinary(INS_cmp, EA_4BYTE, src1, src2);
var_types bndsChkType = genActualType(src2->TypeGet());
#if DEBUG
// Bounds checks can only be 32 or 64 bit sized comparisons.
assert(bndsChkType == TYP_INT || bndsChkType == TYP_LONG);

// The type of the bounds check should always wide enough to compare against the index.
assert(emitTypeSize(bndsChkType) >= emitTypeSize(genActualType(src1->TypeGet())));
#endif // DEBUG

getEmitter()->emitInsBinary(INS_cmp, emitTypeSize(bndsChkType), src1, src2);
genJumpToThrowHlpBlk(jmpKind, SCK_RNGCHK_FAIL, bndsChk->gtIndRngFailBB);
}

Expand Down
2 changes: 1 addition & 1 deletion src/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ GenTree* Lowering::LowerNode(GenTree* node)
LowerCast(node);
break;

#ifdef _TARGET_XARCH_
#if defined(_TARGET_XARCH_) || defined(_TARGET_ARM64_)
case GT_ARR_BOUNDS_CHECK:
#ifdef FEATURE_SIMD
case GT_SIMD_CHK:
Expand Down

0 comments on commit 481a04f

Please sign in to comment.