If we are loading an i16 value from a 32-bit memory location, then
we need to be able to truncate the loaded value to i16.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 ↗ | (On Diff #73301) | When is the trunc case necessary? Since the FP case only needs to handle extend this looks weird to me |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 ↗ | (On Diff #73301) | Trunc is required when VT is MVT::i16 and MemVT is MVT::i32. |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 ↗ | (On Diff #73301) | This happens for mesa, because 16-bit kernel arguments are stored as 32-bit values in the kernarg buffer. |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 ↗ | (On Diff #73301) | So shouldn't it have the same problem with f16 and need to fptrunc it? |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 ↗ | (On Diff #73301) | 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. |