Skip to content

Commit 2c0c71a

Browse files
preamesflovent
authored andcommitted
[RISCV] Add coverage for vmerge.vim shuffle lowering
1 parent efa1101 commit 2c0c71a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-shuffles.ll

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,3 +1368,38 @@ define <16 x i32> @shuffle_m2_prefix(<16 x i32> %a) {
13681368
%out = shufflevector <16 x i32> %a, <16 x i32> poison, <16 x i32> <i32 2, i32 3, i32 5, i32 2, i32 3, i32 5, i32 7, i32 4, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
13691369
ret <16 x i32> %out
13701370
}
1371+
1372+
define <4 x i16> @vmerge_1(<4 x i16> %x) {
1373+
; CHECK-LABEL: vmerge_1:
1374+
; CHECK: # %bb.0:
1375+
; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
1376+
; CHECK-NEXT: vmv.v.i v0, 6
1377+
; CHECK-NEXT: vmerge.vim v8, v8, 5, v0
1378+
; CHECK-NEXT: ret
1379+
%s = shufflevector <4 x i16> %x, <4 x i16> <i16 5, i16 5, i16 5, i16 5>, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
1380+
ret <4 x i16> %s
1381+
}
1382+
1383+
define <4 x i16> @vmerge_2(<4 x i16> %x) {
1384+
; CHECK-LABEL: vmerge_2:
1385+
; CHECK: # %bb.0:
1386+
; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
1387+
; CHECK-NEXT: vmv.v.i v0, 9
1388+
; CHECK-NEXT: vmv.v.i v9, 5
1389+
; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
1390+
; CHECK-NEXT: ret
1391+
%s = shufflevector <4 x i16> %x, <4 x i16> <i16 poison, i16 5, i16 5, i16 poison>, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
1392+
ret <4 x i16> %s
1393+
}
1394+
1395+
define <4 x i16> @vmerge_3(<4 x i16> %x) {
1396+
; CHECK-LABEL: vmerge_3:
1397+
; CHECK: # %bb.0:
1398+
; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, mu
1399+
; CHECK-NEXT: vmv.v.i v0, 6
1400+
; CHECK-NEXT: vmv.v.i v9, 5
1401+
; CHECK-NEXT: vrgather.vi v8, v9, 1, v0.t
1402+
; CHECK-NEXT: ret
1403+
%s = shufflevector <4 x i16> %x, <4 x i16> <i16 poison, i16 5, i16 poison, i16 poison>, <4 x i32> <i32 0, i32 5, i32 5, i32 3>
1404+
ret <4 x i16> %s
1405+
}

0 commit comments

Comments
 (0)