[llvm] [RISCV][P-ext] Recognize vector shifts with splat build_vector shift amount. (PR #184909)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 5 21:56:34 PST 2026
================
@@ -1763,3 +1763,75 @@ define <4 x i8> @test_vselect_v4i8(<4 x i8> %a, <4 x i8> %b, <4 x i8> %c) {
%res = select <4 x i1> %mask, <4 x i8> %c, <4 x i8> %b
ret <4 x i8> %res
}
+
+define <2 x i16> @test_bswap_v2i16(<2 x i16> %a) {
+; CHECK-LABEL: test_bswap_v2i16:
+; CHECK: # %bb.0:
+; CHECK-NEXT: psrli.h a1, a0, 8
+; CHECK-NEXT: pslli.h a0, a0, 8
+; CHECK-NEXT: or a0, a0, a1
----------------
topperc wrote:
Yep. I noticed that too.
https://github.com/llvm/llvm-project/pull/184909
More information about the llvm-commits
mailing list