xref: /llvm-project/llvm/test/CodeGen/ARM/sdiv_shl.ll (revision ef465bf8b11f667fd5e73fc5abcc121793a18a81)
1*ef465bf8Shstk30-hw; RUN: llc -mtriple armv7-linux -mattr=+neon %s -o - | FileCheck %s --check-prefix=LE
2*ef465bf8Shstk30-hw; RUN: llc -mtriple armebv7-linux -mattr=+neon %s -o - | FileCheck %s --check-prefix=BE
3*ef465bf8Shstk30-hw
4*ef465bf8Shstk30-hw; The key is the last vrev64 should be vrev64.16 instead of vrev64.32
5*ef465bf8Shstk30-hw
6*ef465bf8Shstk30-hwdefine void @sdiv_shl(ptr %x, ptr %y) nounwind {
7*ef465bf8Shstk30-hw; LE-LABEL: sdiv_shl:
8*ef465bf8Shstk30-hw; LE:       @ %bb.0: @ %entry
9*ef465bf8Shstk30-hw; LE-NEXT:    adr r2, .LCPI0_0
10*ef465bf8Shstk30-hw; LE-NEXT:    vld1.64 {d18, d19}, [r1]
11*ef465bf8Shstk30-hw; LE-NEXT:    adr r1, .LCPI0_1
12*ef465bf8Shstk30-hw; LE-NEXT:    vld1.64 {d16, d17}, [r2:128]
13*ef465bf8Shstk30-hw; LE-NEXT:    vshr.s16 q10, q9, #15
14*ef465bf8Shstk30-hw; LE-NEXT:    vneg.s16 q8, q8
15*ef465bf8Shstk30-hw; LE-NEXT:    vld1.64 {d22, d23}, [r1:128]
16*ef465bf8Shstk30-hw; LE-NEXT:    adr r1, .LCPI0_2
17*ef465bf8Shstk30-hw; LE-NEXT:    vshl.u16 q8, q10, q8
18*ef465bf8Shstk30-hw; LE-NEXT:    vneg.s16 q10, q11
19*ef465bf8Shstk30-hw; LE-NEXT:    vadd.i16 q8, q9, q8
20*ef465bf8Shstk30-hw; LE-NEXT:    vshl.s16 q8, q8, q10
21*ef465bf8Shstk30-hw; LE-NEXT:    vld1.64 {d20, d21}, [r1:128]
22*ef465bf8Shstk30-hw; LE-NEXT:    vbit q8, q9, q10
23*ef465bf8Shstk30-hw; LE-NEXT:    vst1.64 {d16, d17}, [r0]
24*ef465bf8Shstk30-hw; LE:         .LCPI0_0:
25*ef465bf8Shstk30-hw; LE-NEXT:    .short 16 @ 0x10
26*ef465bf8Shstk30-hw; LE-NEXT:    .short 14 @ 0xe
27*ef465bf8Shstk30-hw; LE-NEXT:    .short 15 @ 0xf
28*ef465bf8Shstk30-hw; LE-NEXT:    .short 13 @ 0xd
29*ef465bf8Shstk30-hw; LE-NEXT:    .short 12 @ 0xc
30*ef465bf8Shstk30-hw; LE-NEXT:    .short 10 @ 0xa
31*ef465bf8Shstk30-hw; LE-NEXT:    .short 11 @ 0xb
32*ef465bf8Shstk30-hw; LE-NEXT:    .short 9 @ 0x9
33*ef465bf8Shstk30-hw; LE-NEXT:  .LCPI0_1:
34*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
35*ef465bf8Shstk30-hw; LE-NEXT:    .short 2 @ 0x2
36*ef465bf8Shstk30-hw; LE-NEXT:    .short 1 @ 0x1
37*ef465bf8Shstk30-hw; LE-NEXT:    .short 3 @ 0x3
38*ef465bf8Shstk30-hw; LE-NEXT:    .short 4 @ 0x4
39*ef465bf8Shstk30-hw; LE-NEXT:    .short 6 @ 0x6
40*ef465bf8Shstk30-hw; LE-NEXT:    .short 5 @ 0x5
41*ef465bf8Shstk30-hw; LE-NEXT:    .short 7 @ 0x7
42*ef465bf8Shstk30-hw; LE-NEXT:  .LCPI0_2:
43*ef465bf8Shstk30-hw; LE-NEXT:    .short 65535 @ 0xffff
44*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
45*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
46*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
47*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
48*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
49*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
50*ef465bf8Shstk30-hw; LE-NEXT:    .short 0 @ 0x0
51*ef465bf8Shstk30-hw;
52*ef465bf8Shstk30-hw; BE-LABEL: sdiv_shl:
53*ef465bf8Shstk30-hw; BE:       @ %bb.0: @ %entry
54*ef465bf8Shstk30-hw; BE-NEXT:    adr r2, .LCPI0_0
55*ef465bf8Shstk30-hw; BE-NEXT:    vld1.64 {d18, d19}, [r1]
56*ef465bf8Shstk30-hw; BE-NEXT:    adr r1, .LCPI0_1
57*ef465bf8Shstk30-hw; BE-NEXT:    vld1.64 {d16, d17}, [r2:128]
58*ef465bf8Shstk30-hw; BE-NEXT:    vrev64.16 q8, q8
59*ef465bf8Shstk30-hw; BE-NEXT:    vrev64.16 q9, q9
60*ef465bf8Shstk30-hw; BE-NEXT:    vneg.s16 q8, q8
61*ef465bf8Shstk30-hw; BE-NEXT:    vld1.64 {d20, d21}, [r1:128]
62*ef465bf8Shstk30-hw; BE-NEXT:    adr r1, .LCPI0_2
63*ef465bf8Shstk30-hw; BE-NEXT:    vshr.s16 q11, q9, #15
64*ef465bf8Shstk30-hw; BE-NEXT:    vrev64.16 q10, q10
65*ef465bf8Shstk30-hw; BE-NEXT:    vshl.u16 q8, q11, q8
66*ef465bf8Shstk30-hw; BE-NEXT:    vld1.64 {d22, d23}, [r1:128]
67*ef465bf8Shstk30-hw; BE-NEXT:    vneg.s16 q10, q10
68*ef465bf8Shstk30-hw; BE-NEXT:    vrev64.16 q11, q11
69*ef465bf8Shstk30-hw; BE-NEXT:    vadd.i16 q8, q9, q8
70*ef465bf8Shstk30-hw; BE-NEXT:    vshl.s16 q8, q8, q10
71*ef465bf8Shstk30-hw; BE-NEXT:    vbit q8, q9, q11
72*ef465bf8Shstk30-hw; BE-NEXT:    vrev64.16 q8, q8
73*ef465bf8Shstk30-hw; BE-NEXT:    vst1.64 {d16, d17}, [r0]
74*ef465bf8Shstk30-hw; BE:         .LCPI0_0:
75*ef465bf8Shstk30-hw; BE-NEXT:    .short 16 @ 0x10
76*ef465bf8Shstk30-hw; BE-NEXT:    .short 14 @ 0xe
77*ef465bf8Shstk30-hw; BE-NEXT:    .short 15 @ 0xf
78*ef465bf8Shstk30-hw; BE-NEXT:    .short 13 @ 0xd
79*ef465bf8Shstk30-hw; BE-NEXT:    .short 12 @ 0xc
80*ef465bf8Shstk30-hw; BE-NEXT:    .short 10 @ 0xa
81*ef465bf8Shstk30-hw; BE-NEXT:    .short 11 @ 0xb
82*ef465bf8Shstk30-hw; BE-NEXT:    .short 9 @ 0x9
83*ef465bf8Shstk30-hw; BE-NEXT:  .LCPI0_1:
84*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
85*ef465bf8Shstk30-hw; BE-NEXT:    .short 2 @ 0x2
86*ef465bf8Shstk30-hw; BE-NEXT:    .short 1 @ 0x1
87*ef465bf8Shstk30-hw; BE-NEXT:    .short 3 @ 0x3
88*ef465bf8Shstk30-hw; BE-NEXT:    .short 4 @ 0x4
89*ef465bf8Shstk30-hw; BE-NEXT:    .short 6 @ 0x6
90*ef465bf8Shstk30-hw; BE-NEXT:    .short 5 @ 0x5
91*ef465bf8Shstk30-hw; BE-NEXT:    .short 7 @ 0x7
92*ef465bf8Shstk30-hw; BE-NEXT:  .LCPI0_2:
93*ef465bf8Shstk30-hw; BE-NEXT:    .short 65535 @ 0xffff
94*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
95*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
96*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
97*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
98*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
99*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
100*ef465bf8Shstk30-hw; BE-NEXT:    .short 0 @ 0x0
101*ef465bf8Shstk30-hwentry:
102*ef465bf8Shstk30-hw  %0 = load <8 x i16>, ptr %y, align 8
103*ef465bf8Shstk30-hw  %div = sdiv <8 x i16> %0, <i16 1, i16 4, i16 2, i16 8, i16 16, i16 64, i16 32, i16 128>
104*ef465bf8Shstk30-hw  store <8 x i16> %div, ptr %x, align 8
105*ef465bf8Shstk30-hw  ret void
106*ef465bf8Shstk30-hw}
107