[PATCH] D49289: [mips64][clang] Provide the signext attribute for i32 return values

Stefan Maksimovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 30 03:45:11 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC338239: [mips64][clang] Provide the signext attribute for i32 return values (authored by smaksimovic, committed by ).

Repository:
  rC Clang

https://reviews.llvm.org/D49289

Files:
  lib/CodeGen/TargetInfo.cpp


Index: lib/CodeGen/TargetInfo.cpp
===================================================================
--- lib/CodeGen/TargetInfo.cpp
+++ lib/CodeGen/TargetInfo.cpp
@@ -6985,8 +6985,14 @@
   if (const EnumType *EnumTy = RetTy->getAs<EnumType>())
     RetTy = EnumTy->getDecl()->getIntegerType();
 
-  return (RetTy->isPromotableIntegerType() ? ABIArgInfo::getExtend(RetTy)
-                                           : ABIArgInfo::getDirect());
+  if (RetTy->isPromotableIntegerType())
+    return ABIArgInfo::getExtend(RetTy);
+
+  if ((RetTy->isUnsignedIntegerOrEnumerationType() ||
+      RetTy->isSignedIntegerOrEnumerationType()) && Size == 32 && !IsO32)
+    return ABIArgInfo::getSignExtend(RetTy);
+
+  return ABIArgInfo::getDirect();
 }
 
 void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49289.157935.patch
Type: text/x-patch
Size: 806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180730/efdc2ff9/attachment-0001.bin>


More information about the cfe-commits mailing list