- Added code to recognize insertelement on v8i16/v16i8 vectors and transform to use vinserth/vinsertb instructions.
- Added code to recognize extractelement on v8i16/v16i8 vectors, specifically extracting the elements from doubleword element 1 of a VSR, to use vextractuh/vextractub instructions. The normal code-gen requires an extra xxswapd instruction to get the elements into the proper half of the register before a mfvsrd.
- Added LIT tests for above patterns.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I think the vector extract portion of this interacts with https://reviews.llvm.org/D34032. We should figure out which of the two sequences is optimal and settle on that.
Comment Actions
@nemanjai @kbarton I believe the code sequences that 'https://reviews.llvm.org/D34032' generate have equal or less than the number of cycles these 'vextractu[h|b] + mfvsrd' sequences. Also, they are more general and can handle more cases. Therefore I don't think the extract portion of this patch is useful anymore. However, the insertelement patterns are still good to have IMO.
Comment Actions
- Removed extract element patterns as changes from 'https://reviews.llvm.org/D34032' generate better code in terms of total cycles. Also it catches more cases than the vextractu[hb] instructions, as it's only beneficial when operating on dword[1] of the vector register.