@@ -917,9 +917,25 @@ const SIMDIntrinsicInfo* Compiler::getSIMDIntrinsicInfo(CORINFO_CLASS_HANDLE* in
917
917
GenTreePtr Compiler::impSIMDPopStack (var_types type, bool expectAddr)
918
918
{
919
919
StackEntry se = impPopStack ();
920
- typeInfo ti = se.seTypeInfo ;
920
+ typeInfo* ti = & se.seTypeInfo ;
921
921
GenTreePtr tree = se.val ;
922
922
923
+ return impSIMD (type, tree, ti, expectAddr);
924
+ }
925
+
926
+ // Normalizes TYP_STRUCT value in case of GT_CALL, GT_RET_EXPR and arg nodes and returns GenTree node
927
+ //
928
+ // Arguments:
929
+ // type - the type of value that the caller expects to be passed into function.
930
+ // tree - the GenTree node representing type
931
+ // ti - typeInfo struct containing passed type data
932
+ // expectAddr - if true indicates we are expecting type stack entry to be a TYP_BYREF.
933
+ //
934
+ // Notes:
935
+ // If the passed value is a struct, and the expected type is a simd type, it will be set
936
+ // to that type, otherwise it will assert if the type passed is not the expected type.
937
+ GenTreePtr Compiler::impSIMD (var_types type, GenTreePtr tree, typeInfo* ti, bool expectAddr)
938
+ {
923
939
// If expectAddr is true implies what we have on stack is address and we need
924
940
// SIMD type struct that it points to.
925
941
if (expectAddr)
@@ -957,8 +973,8 @@ GenTreePtr Compiler::impSIMDPopStack(var_types type, bool expectAddr)
957
973
// normalize TYP_STRUCT value
958
974
if (varTypeIsStruct (tree) && ((tree->OperGet () == GT_RET_EXPR) || (tree->OperGet () == GT_CALL) || isParam))
959
975
{
960
- assert (ti. IsType (TI_STRUCT));
961
- CORINFO_CLASS_HANDLE structType = ti. GetClassHandleForValueClass ();
976
+ assert (ti-> IsType (TI_STRUCT));
977
+ CORINFO_CLASS_HANDLE structType = ti-> GetClassHandleForValueClass ();
962
978
tree = impNormStructVal (tree, structType, (unsigned )CHECK_SPILL_ALL);
963
979
}
964
980
0 commit comments