Details
Diff Detail
Event Timeline
For the vector itself and the inserted element, shouldn't this be using G_ANYEXT instead? Looking at the corresponding test, the G_SHL/G_ASHR on $vgpr0 should be unnecessary based on the original code.
For the element index, shouldn't this be using G_ZEXT or G_ANYEXT? I don't recall whether insertelement is supposed to interpret this argument as a signed or unsigned integer, and couldn't quickly find a reference to it. Not that it usually matters, but I find G_SEXT here surprising as well.
I was just copying what the extract does. Signed doesn't particularly make sense because a negative index would be an undefined / out of bounds result
Yeah, it doesn't seem very relevant for the element argument, though precisely because of that I'd feel more comfortable with ANYEXT.
For the value argument it really does seem to make a codegen difference. It should be possible to avoid the SHL/ASHR sequence.