Skip to content

Commit 1e605fc

Browse files
committed
Precommit tests
1 parent 728e925 commit 1e605fc

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
2+
; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
3+
4+
define <vscale x 4 x i32> @insert_div() {
5+
; CHECK-LABEL: insert_div:
6+
; CHECK: // %bb.0: // %entry
7+
; CHECK-NEXT: mov w8, #43691 // =0xaaab
8+
; CHECK-NEXT: movi v0.4s, #9
9+
; CHECK-NEXT: ptrue p0.s
10+
; CHECK-NEXT: movk w8, #43690, lsl #16
11+
; CHECK-NEXT: mov z1.s, w8
12+
; CHECK-NEXT: umulh z0.s, p0/m, z0.s, z1.s
13+
; CHECK-NEXT: lsr z0.s, z0.s, #1
14+
; CHECK-NEXT: ret
15+
entry:
16+
%0 = tail call <vscale x 4 x i32> @llvm.vector.insert.nxv4i32.v4i32(<vscale x 4 x i32> undef, <4 x i32> splat (i32 9), i64 0)
17+
%div = udiv <vscale x 4 x i32> %0, splat (i32 3)
18+
ret <vscale x 4 x i32> %div
19+
}
20+
21+
define <vscale x 4 x i32> @insert_mul() {
22+
; CHECK-LABEL: insert_mul:
23+
; CHECK: // %bb.0: // %entry
24+
; CHECK-NEXT: movi v0.4s, #1
25+
; CHECK-NEXT: mul z0.s, z0.s, #7
26+
; CHECK-NEXT: ret
27+
entry:
28+
%0 = tail call <vscale x 4 x i32> @llvm.vector.insert.nxv4i32.v4i32(<vscale x 4 x i32> undef, <4 x i32> splat (i32 1), i64 0)
29+
%mul = mul <vscale x 4 x i32> %0, splat (i32 7)
30+
ret <vscale x 4 x i32> %mul
31+
}
32+
33+
define <vscale x 4 x i32> @insert_add() {
34+
; CHECK-LABEL: insert_add:
35+
; CHECK: // %bb.0: // %entry
36+
; CHECK-NEXT: movi v0.4s, #5
37+
; CHECK-NEXT: add z0.s, z0.s, #11 // =0xb
38+
; CHECK-NEXT: ret
39+
entry:
40+
%0 = tail call <vscale x 4 x i32> @llvm.vector.insert.nxv4i32.v4i32(<vscale x 4 x i32> undef, <4 x i32> splat (i32 5), i64 0)
41+
%add = add <vscale x 4 x i32> %0, splat (i32 11)
42+
ret <vscale x 4 x i32> %add
43+
}
44+
45+
define <vscale x 4 x i32> @insert_sub() {
46+
; CHECK-LABEL: insert_sub:
47+
; CHECK: // %bb.0: // %entry
48+
; CHECK-NEXT: movi v0.4s, #11
49+
; CHECK-NEXT: sub z0.s, z0.s, #11 // =0xb
50+
; CHECK-NEXT: ret
51+
entry:
52+
%0 = tail call <vscale x 4 x i32> @llvm.vector.insert.nxv4i32.v4i32(<vscale x 4 x i32> undef, <4 x i32> splat (i32 11), i64 0)
53+
%sub = add <vscale x 4 x i32> %0, splat (i32 -11)
54+
ret <vscale x 4 x i32> %sub
55+
}

0 commit comments

Comments
 (0)