1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-none-linux-gnu -mattr=+neon | FileCheck %s
4 define <16 x i8> @div16xi8(<16 x i8> %x) {
5 ; CHECK-LABEL: div16xi8:
7 ; CHECK-NEXT: movi v1.16b, #41
8 ; CHECK-NEXT: smull2 v2.8h, v0.16b, v1.16b
9 ; CHECK-NEXT: smull v0.8h, v0.8b, v1.8b
10 ; CHECK-NEXT: uzp2 v0.16b, v0.16b, v2.16b
11 ; CHECK-NEXT: sshr v0.16b, v0.16b, #2
12 ; CHECK-NEXT: usra v0.16b, v0.16b, #7
14 %div = sdiv <16 x i8> %x, <i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25, i8 25>
18 define <8 x i16> @div8xi16(<8 x i16> %x) {
19 ; CHECK-LABEL: div8xi16:
21 ; CHECK-NEXT: mov w8, #40815 // =0x9f6f
22 ; CHECK-NEXT: dup v1.8h, w8
23 ; CHECK-NEXT: smull2 v2.4s, v0.8h, v1.8h
24 ; CHECK-NEXT: smull v1.4s, v0.4h, v1.4h
25 ; CHECK-NEXT: uzp2 v1.8h, v1.8h, v2.8h
26 ; CHECK-NEXT: add v0.8h, v1.8h, v0.8h
27 ; CHECK-NEXT: sshr v0.8h, v0.8h, #12
28 ; CHECK-NEXT: usra v0.8h, v0.8h, #15
30 %div = sdiv <8 x i16> %x, <i16 6577, i16 6577, i16 6577, i16 6577, i16 6577, i16 6577, i16 6577, i16 6577>
34 define <4 x i32> @div32xi4(<4 x i32> %x) {
35 ; CHECK-LABEL: div32xi4:
37 ; CHECK-NEXT: mov w8, #7527 // =0x1d67
38 ; CHECK-NEXT: movk w8, #28805, lsl #16
39 ; CHECK-NEXT: dup v1.4s, w8
40 ; CHECK-NEXT: smull2 v2.2d, v0.4s, v1.4s
41 ; CHECK-NEXT: smull v0.2d, v0.2s, v1.2s
42 ; CHECK-NEXT: uzp2 v1.4s, v0.4s, v2.4s
43 ; CHECK-NEXT: sshr v0.4s, v1.4s, #22
44 ; CHECK-NEXT: usra v0.4s, v1.4s, #31
46 %div = sdiv <4 x i32> %x, <i32 9542677, i32 9542677, i32 9542677, i32 9542677>
50 define <16 x i8> @udiv16xi8(<16 x i8> %x) {
51 ; CHECK-LABEL: udiv16xi8:
53 ; CHECK-NEXT: movi v1.16b, #121
54 ; CHECK-NEXT: umull2 v2.8h, v0.16b, v1.16b
55 ; CHECK-NEXT: umull v0.8h, v0.8b, v1.8b
56 ; CHECK-NEXT: uzp2 v0.16b, v0.16b, v2.16b
57 ; CHECK-NEXT: ushr v0.16b, v0.16b, #5
59 %div = udiv <16 x i8> %x, <i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68, i8 68>
63 define <8 x i16> @udiv8xi16(<8 x i16> %x) {
64 ; CHECK-LABEL: udiv8xi16:
66 ; CHECK-NEXT: mov w8, #16593 // =0x40d1
67 ; CHECK-NEXT: dup v1.8h, w8
68 ; CHECK-NEXT: umull2 v2.4s, v0.8h, v1.8h
69 ; CHECK-NEXT: umull v1.4s, v0.4h, v1.4h
70 ; CHECK-NEXT: uzp2 v1.8h, v1.8h, v2.8h
71 ; CHECK-NEXT: sub v0.8h, v0.8h, v1.8h
72 ; CHECK-NEXT: usra v1.8h, v0.8h, #1
73 ; CHECK-NEXT: ushr v0.8h, v1.8h, #12
75 %div = udiv <8 x i16> %x, <i16 6537, i16 6537, i16 6537, i16 6537, i16 6537, i16 6537, i16 6537, i16 6537>
79 define <4 x i32> @udiv32xi4(<4 x i32> %x) {
80 ; CHECK-LABEL: udiv32xi4:
82 ; CHECK-NEXT: mov w8, #16747 // =0x416b
83 ; CHECK-NEXT: movk w8, #31439, lsl #16
84 ; CHECK-NEXT: dup v1.4s, w8
85 ; CHECK-NEXT: umull2 v2.2d, v0.4s, v1.4s
86 ; CHECK-NEXT: umull v0.2d, v0.2s, v1.2s
87 ; CHECK-NEXT: uzp2 v0.4s, v0.4s, v2.4s
88 ; CHECK-NEXT: ushr v0.4s, v0.4s, #22
90 %div = udiv <4 x i32> %x, <i32 8743143, i32 8743143, i32 8743143, i32 8743143>