This is a straightforward port.
Curses! Actually it predates me and originally comes from D47725. My only guess is that it's a cute way of indicating a reverse shift by "reversing" the letters S H, in which case I think it's too cute, and not in a good way.
I'll leave it up to you whether to change it to something more understandable or not.
I believe alternate lowerings based on instruction legality should be split into separate lower* functions. That way custom lowering can pick the strategy itself, and the default function would then use these crude legality heuristics to pick which strategy to use.
Looks fine to me modulo the naming nit.
Nit: "opposite" is now the third word we're using for the same thing. The code calls it "reverse", and the equivalent funnel shift function (three lines up) calls it "inverse". Could we standardize on one? I'd vote for "reverse".