For a SMRD, if SBase is a Vector register, we need to move it to VAlu. On Vi+,
addr64 buffer loads are not supported, so we will have to use flat loads instead.
This patch implements this "Move".
Differential D17042
AMDGPU/SI: move SMRD to flat if UseFlatForGlobal is true cfang on Feb 9 2016, 2:17 PM. Authored by
Details
For a SMRD, if SBase is a Vector register, we need to move it to VAlu. On Vi+, This patch implements this "Move".
Diff Detail Event Timeline
Comment Actions This is to translate smrd ( with sbase in VGPR) to flat. I can not what other places need this translation.
Comment Actions Functions are also more readable. The various moveToVALU instructions are already too big
Comment Actions I've been discussing a different issue with Nicoli, and I'm wondering if it would be better just to insert v_readfirstlane instructions to copy the pointer back to SGPRs rather than using a VMEM instruction. This would simplify the code a lot. Comment Actions I think this can be dropped, and the test case has no additional value since Thanks; Changpeng |
It would be really great if we could use the InstrMappings in Tablegen to generate this, but I guess it is a pretty small table.
You should simplify it though, since we have multiple case statements returning the same value.