[PATCH] D21739: [TLI] Add functions determining if int parameters/returns should be zeroext/signext.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 20 16:57:25 PST 2016


koriakin added inline comments.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:428
+  // Mips, on the other hand, needs signext on i32 parameters corresponding
+  // to both signed and unsigned ints.
+  if (T.getArch() == Triple::mips || T.getArch() == Triple::mipsel ||
----------------
hfinkel wrote:
> sdardis wrote:
> > hfinkel wrote:
> > > To be clear, they sign extend even unsigned numbers?
> > Yes. The N64 and N32 ABIs requires that 32 bit integer parameters are sign extended, even unsigned numbers.
> Ah, okay. In that case, I'll change my suggested interface to be something more direct, how about...
> 
>   Attribute::AttrKind getExtAttrForI32Param(bool Signed = true) const { ... }
> 
> and then the user code can look like this:
> 
>   if (auto AK = TLI->getExtAttrForI32Param())
>     F->addAttribute(n, AK)
> 
Sounds good, done.


Repository:
  rL LLVM

https://reviews.llvm.org/D21739





More information about the llvm-commits mailing list