[PATCH] D25198: AMDGPU/SI: Fix LowerParameter() for i16 arguments

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 18:56:18 PDT 2016


arsenm 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);
----------------
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?


https://reviews.llvm.org/D25198





More information about the llvm-commits mailing list