[PATCH] D25198: AMDGPU/SI: Fix LowerParameter() for i16 arguments
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 14 08:26:59 PDT 2016
tstellarAMD added inline comments.
================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:587-592
if (MemVT.isFloatingPoint())
- ExtTy = ISD::EXTLOAD;
+ Val = DAG.getNode(ISD::FP_EXTEND, SL, VT, Load);
+ else if (Signed)
+ Val = DAG.getSExtOrTrunc(Load, SL, VT);
+ else
+ Val = DAG.getZExtOrTrunc(Load, SL, VT);
----------------
arsenm wrote:
> tstellarAMD wrote:
> > tstellarAMD wrote:
> > > arsenm wrote:
> > > > When is the trunc case necessary? Since the FP case only needs to handle extend this looks weird to me
> > > Trunc is required when VT is MVT::i16 and MemVT is MVT::i32.
> > This happens for mesa, because 16-bit kernel arguments are stored as 32-bit values in the kernarg buffer.
> So shouldn't it have the same problem with f16 and need to fptrunc it?
No, because f16 values are always 16-bits in memory. i16/i8 are just a special case when using the mesa ABI, since those areguments are sign/zero extended by the runtime.
https://reviews.llvm.org/D25198
More information about the llvm-commits
mailing list