@@ -729,7 +729,11 @@ bool Compiler::optPopulateInitInfo(unsigned loopInd, GenTree* init, unsigned ite
729
729
730
730
// RHS can be constant or local var.
731
731
// TODO-CQ: CLONE: Add arr length for descending loops.
732
+ #ifdef STARK
733
+ if (rhs->gtOper == GT_CNS_INT && rhs->TypeGet() == TYP_I_IMPL)
734
+ #else
732
735
if (rhs->gtOper == GT_CNS_INT && rhs->TypeGet() == TYP_INT)
736
+ #endif
733
737
{
734
738
optLoopTable[loopInd].lpFlags |= LPFLG_CONST_INIT;
735
739
optLoopTable[loopInd].lpConstInit = (int)rhs->AsIntCon()->gtIconVal;
@@ -803,7 +807,11 @@ bool Compiler::optCheckIterInLoopTest(
803
807
return false;
804
808
}
805
809
810
+ #ifdef STARK
811
+ if (iterOp->gtType != TYP_I_IMPL)
812
+ #else
806
813
if (iterOp->gtType != TYP_INT)
814
+ #endif
807
815
{
808
816
return false;
809
817
}
@@ -875,7 +883,11 @@ unsigned Compiler::optIsLoopIncrTree(GenTree* incr)
875
883
876
884
// Increment should be by a const int.
877
885
// TODO-CQ: CLONE: allow variable increments.
886
+ #ifdef STARK
887
+ if ((incrVal->gtOper != GT_CNS_INT) || (incrVal->TypeGet() != TYP_I_IMPL))
888
+ #else
878
889
if ((incrVal->gtOper != GT_CNS_INT) || (incrVal->TypeGet() != TYP_INT))
890
+ #endif
879
891
{
880
892
return BAD_VAR_NUM;
881
893
}
@@ -2989,6 +3001,10 @@ bool jitIterSmallOverflow(int iterAtExit, var_types incrType)
2989
3001
2990
3002
case TYP_UINT: // Detected by checking for 32bit ....
2991
3003
case TYP_INT:
3004
+ #ifdef STARK
3005
+ case TYP_ULONG: // Detected by checking for 64bit ....
3006
+ case TYP_LONG:
3007
+ #endif
2992
3008
return false; // ... overflow same as done for TYP_INT
2993
3009
2994
3010
default:
@@ -3030,6 +3046,10 @@ bool jitIterSmallUnderflow(int iterAtExit, var_types decrType)
3030
3046
3031
3047
case TYP_UINT: // Detected by checking for 32bit ....
3032
3048
case TYP_INT:
3049
+ #ifdef STARK
3050
+ case TYP_ULONG: // Detected by checking for 64bit ....
3051
+ case TYP_LONG:
3052
+ #endif
3033
3053
return false; // ... underflow same as done for TYP_INT
3034
3054
3035
3055
default:
@@ -3062,7 +3082,11 @@ bool Compiler::optComputeLoopRep(int constInit,
3062
3082
bool dupCond,
3063
3083
unsigned* iterCount)
3064
3084
{
3085
+ #ifdef STARK
3086
+ noway_assert(genActualType(iterOperType) == TYP_I_IMPL);
3087
+ #else
3065
3088
noway_assert(genActualType(iterOperType) == TYP_INT);
3089
+ #endif
3066
3090
3067
3091
__int64 constInitX;
3068
3092
__int64 constLimitX;
@@ -3115,6 +3139,20 @@ bool Compiler::optComputeLoopRep(int constInit,
3115
3139
}
3116
3140
break;
3117
3141
3142
+ #ifdef STARK
3143
+ case TYP_LONG:
3144
+ case TYP_ULONG:
3145
+ if (unsTest)
3146
+ {
3147
+ constInitX = (unsigned long long)constInit;
3148
+ }
3149
+ else
3150
+ {
3151
+ constInitX = (long long)constInit;
3152
+ }
3153
+ break;
3154
+ #endif
3155
+
3118
3156
default:
3119
3157
noway_assert(!"Bad type");
3120
3158
NO_WAY("Bad type");
@@ -5633,6 +5671,14 @@ bool Compiler::optNarrowTree(GenTree* tree, var_types srct, var_types dstt, Valu
5633
5671
case TYP_UINT:
5634
5672
imask = 0xFFFFFFFF;
5635
5673
break;
5674
+ #ifdef STARK
5675
+ case TYP_LONG:
5676
+ imask = 0x7FFFFFFFFFFFFFFF;
5677
+ break;
5678
+ case TYP_ULONG:
5679
+ imask = 0xFFFFFFFFFFFFFFFF;
5680
+ break;
5681
+ #endif
5636
5682
#endif // _TARGET_64BIT_
5637
5683
default:
5638
5684
return false;
@@ -5646,8 +5692,13 @@ bool Compiler::optNarrowTree(GenTree* tree, var_types srct, var_types dstt, Valu
5646
5692
#ifdef _TARGET_64BIT_
5647
5693
if (doit)
5648
5694
{
5695
+ #ifdef STARK
5696
+ tree->gtType = TYP_I_IMPL;
5697
+ tree->AsIntCon()->gtIconVal = (NATIVE_INT)ival;
5698
+ #else
5649
5699
tree->gtType = TYP_INT;
5650
5700
tree->AsIntCon()->gtIconVal = (int)ival;
5701
+ #endif
5651
5702
if (vnStore != nullptr)
5652
5703
{
5653
5704
fgValueNumberTreeConst(tree);
0 commit comments