[Hexagon] Lower funnel shifts for HVX
authorKrzysztof Parzyszek <kparzysz@quicinc.com>
Mon, 10 Oct 2022 22:52:38 +0000 (15:52 -0700)
committerKrzysztof Parzyszek <kparzysz@quicinc.com>
Fri, 14 Oct 2022 21:13:18 +0000 (14:13 -0700)
commit705e77abed0b0fb7c6ab268866d3f841838eaf97
treedd9e499361d80cf30da0ca815d9818017158ed0f
parent16cf666bb7f574bc56cc0a5caf859de7c1c22704
[Hexagon] Lower funnel shifts for HVX

HVX v62+ has bidirectional shifts, which do not mask the shift amount to
the bit width. Instead, the shift amount is sign-extended from the log(BW)
bit value, and a negative value causes a shift in the other direction.
For the shift amount being -log(BW), this reversed shift will shift all
bits out, inserting 0s or sign bits depending on the type and direction.
llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
llvm/lib/Target/Hexagon/HexagonISelLowering.h
llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp
llvm/lib/Target/Hexagon/HexagonPatterns.td
llvm/lib/Target/Hexagon/HexagonPatternsHVX.td
llvm/test/CodeGen/Hexagon/autohvx/funnel-128b.ll [new file with mode: 0644]