================
@@ -825,9 +822,17 @@ ABIArgInfo ZOSXPLinkABIInfo::classifyArgumentType(QualType 
Ty, bool IsNamedArg,
     return getNaturalAlignIndirect(Ty, getDataLayout().getAllocaAddrSpace(),
                                    RAA == CGCXXABI::RAA_DirectInMemory);
 
-  // Integers and enums are extended to full register width.
-  if (isPromotableIntegerTypeForABI(Ty))
-    return ABIArgInfo::getExtend(Ty, CGT.ConvertType(Ty));
+  // Sub-64-bit integer arguments undergo normal C integer promotion (8/16-bit
+  // types are widened to 32 bits) but are NOT sign- or zero-extended to 64
----------------
uweigand wrote:

I'm not sure I understand this comment.  "C integer promotion" only applies to 
unnamed arguments in a variable argument list.  Named arguments are not 
promoted as such during argument passing (they may *get* promoted later when 
the argument is *used*).

In particular "char" and "short" will be passed at the IR level as `i8` and 
`i16`, which are *not* guaranteed to be extended to 32 bits.  (Often they will 
happen to be, but it's not actually guaranteed.)   So the real question is 
whether the XPLINK API *requires* that "char" and "short" are extended to 32 
bit when passed as argument, or not.

https://github.com/llvm/llvm-project/pull/206833
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to