diff options
author | Carol Eidt <carol.eidt@microsoft.com> | 2017-11-06 13:43:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-06 13:43:35 -0800 |
commit | aee95b5490f55512635f8f87c21e54e164fb9a2f (patch) | |
tree | 9d0e6237075bf9aec2e7f9858bd4f9f2439f8952 /src | |
parent | 9c58d21305b7edbc15245f83e0fe054632685c90 (diff) | |
parent | 6a49c7b5ea3aae26bafec5eb057f7b7f9ea5f1a6 (diff) | |
download | coreclr-aee95b5490f55512635f8f87c21e54e164fb9a2f.tar.gz coreclr-aee95b5490f55512635f8f87c21e54e164fb9a2f.tar.bz2 coreclr-aee95b5490f55512635f8f87c21e54e164fb9a2f.zip |
Merge pull request #14024 from mikedn/long-cast-comm
Move genLongToIntCast call to codegenlinear
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/codegenarmarch.cpp | 8 | ||||
-rw-r--r-- | src/jit/codegenlinear.cpp | 6 | ||||
-rw-r--r-- | src/jit/codegenxarch.cpp | 9 |
3 files changed, 8 insertions, 15 deletions
diff --git a/src/jit/codegenarmarch.cpp b/src/jit/codegenarmarch.cpp index 81621c0551..758dd0b931 100644 --- a/src/jit/codegenarmarch.cpp +++ b/src/jit/codegenarmarch.cpp @@ -2842,13 +2842,7 @@ void CodeGen::genIntToIntCast(GenTreePtr treeNode) emitAttr movSize = emitActualTypeSize(dstType); bool movRequired = false; -#ifdef _TARGET_ARM_ - if (varTypeIsLong(srcType)) - { - genLongToIntCast(treeNode); - return; - } -#endif // _TARGET_ARM_ + assert(genTypeSize(srcType) <= genTypeSize(TYP_I_IMPL)); regNumber targetReg = treeNode->gtRegNum; regNumber sourceReg = castOp->gtRegNum; diff --git a/src/jit/codegenlinear.cpp b/src/jit/codegenlinear.cpp index 830183ed5a..de56380922 100644 --- a/src/jit/codegenlinear.cpp +++ b/src/jit/codegenlinear.cpp @@ -1891,6 +1891,12 @@ void CodeGen::genCodeForCast(GenTreeOp* tree) // Casts int32/uint32/int64/uint64 --> float/double genIntToFloatCast(tree); } +#ifndef _TARGET_64BIT_ + else if (varTypeIsLong(tree->gtOp1)) + { + genLongToIntCast(tree); + } +#endif // !_TARGET_64BIT_ else { // Casts int <--> int diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp index 2af7c05536..532187fb12 100644 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -6506,14 +6506,7 @@ void CodeGen::genIntToIntCast(GenTreePtr treeNode) GenTreePtr castOp = treeNode->gtCast.CastOp(); var_types srcType = genActualType(castOp->TypeGet()); noway_assert(genTypeSize(srcType) >= 4); - -#ifdef _TARGET_X86_ - if (varTypeIsLong(srcType)) - { - genLongToIntCast(treeNode); - return; - } -#endif // _TARGET_X86_ + assert(genTypeSize(srcType) <= genTypeSize(TYP_I_IMPL)); regNumber targetReg = treeNode->gtRegNum; regNumber sourceReg = castOp->gtRegNum; |