It would be nice if there was a way to avoid the tied operand, but as far as I can tell there isn't a way to use or with op_sel to achieve this
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM.
llvm/test/CodeGen/AMDGPU/GlobalISel/trunc.ll | ||
---|---|---|
95 | Could also do this with a single v_perm instruction, but I don't know if there's any reason to prefer it (e.g. are there any processors that have v_perm but don't have sdwa?). |
llvm/test/CodeGen/AMDGPU/GlobalISel/trunc.ll | ||
---|---|---|
95 | That would require materializing the constant in a register, so it would be 2 instructions, and 16 bytes, vs 1 8 byte instruction |
Could also do this with a single v_perm instruction, but I don't know if there's any reason to prefer it (e.g. are there any processors that have v_perm but don't have sdwa?).