@@ -968,22 +968,11 @@ void Lowering::LowerPutArgStkOrSplit(GenTreePutArgStk* putArgNode)
968968// tree - GT_CAST node to be lowered
969969//
970970// Return Value:
971- // nextNode to be lowered if tree is modified else returns nullptr
972- //
973- // Notes:
974- // Casts from float/double to a smaller int type are transformed as follows:
975- // GT_CAST(float/double, byte) = GT_CAST(GT_CAST(float/double, int32), byte)
976- // GT_CAST(float/double, sbyte) = GT_CAST(GT_CAST(float/double, int32), sbyte)
977- // GT_CAST(float/double, int16) = GT_CAST(GT_CAST(double/double, int32), int16)
978- // GT_CAST(float/double, uint16) = GT_CAST(GT_CAST(double/double, int32), uint16)
979- //
980- // Note that for the overflow conversions we still depend on helper calls and
981- // don't expect to see them here.
982- // i) GT_CAST(float/double, int type with overflow detection)
971+ // None.
983972//
984- GenTree* Lowering::LowerCast (GenTree* tree)
973+ void Lowering::LowerCast (GenTree* tree)
985974{
986- assert (tree->OperGet () == GT_CAST);
975+ assert (tree->OperIs ( GT_CAST) );
987976
988977 JITDUMP (" LowerCast for: " );
989978 DISPNODE (tree);
@@ -995,17 +984,16 @@ GenTree* Lowering::LowerCast(GenTree* tree)
995984
996985 if (varTypeIsFloating (srcType))
997986 {
987+ // Overflow casts should have been converted to helper call in morph.
998988 noway_assert (!tree->gtOverflow ());
999- assert (! varTypeIsSmall (dstType)); // fgMorphCast creates intermediate casts when converting from float to small
1000- // int.
989+ // Small types should have had an intermediate int cast inserted in morph.
990+ assert (! varTypeIsSmall (dstType));
1001991 }
1002992
1003993 assert (!varTypeIsSmall (srcType));
1004994
1005995 // Now determine if we have operands that should be contained.
1006996 ContainCheckCast (tree->AsCast ());
1007-
1008- return nullptr ;
1009997}
1010998
1011999// ------------------------------------------------------------------------
0 commit comments