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
Diff Detail
- Build Status
Buildable 78 Build 78: arc lint + arc unit
Event Timeline
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 | 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 | Trunc is required when VT is MVT::i16 and MemVT is MVT::i32. |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 | 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 | So shouldn't it have the same problem with f16 and need to fptrunc it? |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
587–592 | 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. |
When is the trunc case necessary? Since the FP case only needs to handle extend this looks weird to me