//
// Return Value:
// Returns true if this GenTree is a multi-reg node.
+//
+// Notes:
+// All targets that support multi-reg ops of any kind also support multi-reg return
+// values for calls. Should that change with a future target, this method will need
+// to change accordingly.
+//
inline bool GenTree::IsMultiRegNode() const
{
+#if FEATURE_MULTIREG_RET
if (IsMultiRegCall())
{
return true;
}
+#if FEATURE_ARG_SPLIT
+ if (OperIsPutArgSplit())
+ {
+ return true;
+ }
+#endif
+
#if !defined(_TARGET_64BIT_)
- if (OperIsMultiRegOp() || OperIsPutArgSplit() || (gtOper == GT_COPY))
+ if (OperIsMultiRegOp())
{
return true;
}
#endif
+ if (OperIs(GT_COPY, GT_RELOAD))
+ {
+ return true;
+ }
+#endif // FEATURE_MULTIREG_RET
return false;
}
//-----------------------------------------------------------------------------------
//
// Return Value:
// Returns the number of registers defined by this node.
+//
+// Notes:
+// All targets that support multi-reg ops of any kind also support multi-reg return
+// values for calls. Should that change with a future target, this method will need
+// to change accordingly.
+//
inline unsigned GenTree::GetMultiRegCount()
{
+#if FEATURE_MULTIREG_RET
if (IsMultiRegCall())
{
return AsCall()->GetReturnTypeDesc()->GetReturnRegCount();
return AsPutArgSplit()->gtNumRegs;
}
#endif
+
#if !defined(_TARGET_64BIT_)
if (OperIsMultiRegOp())
{
return AsMultiRegOp()->GetRegCount();
}
+#endif
+
if (OperIs(GT_COPY, GT_RELOAD))
{
return AsCopyOrReload()->GetRegCount();
}
-#endif
+#endif // FEATURE_MULTIREG_RET
assert(!"GetMultiRegCount called with non-multireg node");
return 1;
}
// Return Value:
// The register, if any, assigned to this index for this node.
//
+// Notes:
+// All targets that support multi-reg ops of any kind also support multi-reg return
+// values for calls. Should that change with a future target, this method will need
+// to change accordingly.
+//
inline regNumber GenTree::GetRegByIndex(int regIndex)
{
if (regIndex == 0)
{
return gtRegNum;
}
+
+#if FEATURE_MULTIREG_RET
+
if (IsMultiRegCall())
{
return AsCall()->GetRegNumByIdx(regIndex);
{
return AsMultiRegOp()->GetRegNumByIdx(regIndex);
}
+#endif
+
if (OperIs(GT_COPY, GT_RELOAD))
{
return AsCopyOrReload()->GetRegNumByIdx(regIndex);
}
-#endif
+#endif // FEATURE_MULTIREG_RET
+
assert(!"Invalid regIndex for GetRegFromMultiRegNode");
return REG_NA;
}
// This must be a multireg node that is *not* a copy or reload (which must retrieve the
// type from its source), and 'regIndex' must be a valid index for this node.
//
+// All targets that support multi-reg ops of any kind also support multi-reg return
+// values for calls. Should that change with a future target, this method will need
+// to change accordingly.
+//
inline var_types GenTree::GetRegTypeByIndex(int regIndex)
{
+#if FEATURE_MULTIREG_RET
if (IsMultiRegCall())
{
return AsCall()->AsCall()->GetReturnTypeDesc()->GetReturnRegType(regIndex);
return AsMultiRegOp()->GetRegType(regIndex);
}
#endif
+
+#endif // FEATURE_MULTIREG_RET
assert(!"Invalid node type for GetRegTypeByIndex");
return TYP_UNDEF;
}