From 6a49c7b5ea3aae26bafec5eb057f7b7f9ea5f1a6 Mon Sep 17 00:00:00 2001 From: Mike Danes Date: Sat, 16 Sep 2017 10:29:07 +0300 Subject: Move genLongToIntCast call to codegenlinear --- src/jit/codegenarmarch.cpp | 8 +------- src/jit/codegenlinear.cpp | 6 ++++++ src/jit/codegenxarch.cpp | 9 +-------- 3 files changed, 8 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/jit/codegenarmarch.cpp b/src/jit/codegenarmarch.cpp index 3883121221..7023c3dda3 100644 --- a/src/jit/codegenarmarch.cpp +++ b/src/jit/codegenarmarch.cpp @@ -2613,13 +2613,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 657d7799c1..643ef1751f 100644 --- a/src/jit/codegenlinear.cpp +++ b/src/jit/codegenlinear.cpp @@ -1895,6 +1895,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 45bcdc2ef8..46d0fae2a6 100644 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -6588,14 +6588,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; -- cgit v1.2.3