1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -mtriple=aarch64 | FileCheck %s --check-prefixes=CHECK,CHECK-NOFP16
3 ; RUN: llc < %s -mtriple=aarch64 -mattr=+fullfp16 | FileCheck %s --check-prefixes=CHECK,CHECK-FP16
5 define <4 x i32> @deinterleave_shuffle_v8i32(<8 x i32> %a) {
6 ; CHECK-LABEL: deinterleave_shuffle_v8i32:
8 ; CHECK-NEXT: addp v0.4s, v0.4s, v1.4s
10 %r0 = shufflevector <8 x i32> %a, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
11 %r1 = shufflevector <8 x i32> %a, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
12 %o = add <4 x i32> %r0, %r1
16 define <4 x i32> @deinterleave_shuffle_v8i32_c(<8 x i32> %a) {
17 ; CHECK-LABEL: deinterleave_shuffle_v8i32_c:
19 ; CHECK-NEXT: addp v0.4s, v0.4s, v1.4s
21 %r0 = shufflevector <8 x i32> %a, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
22 %r1 = shufflevector <8 x i32> %a, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
23 %o = add <4 x i32> %r1, %r0
27 define <2 x i32> @deinterleave_shuffle_v4i32(<4 x i32> %a) {
28 ; CHECK-LABEL: deinterleave_shuffle_v4i32:
30 ; CHECK-NEXT: ext v1.16b, v0.16b, v0.16b, #8
31 ; CHECK-NEXT: zip1 v2.2s, v0.2s, v1.2s
32 ; CHECK-NEXT: zip2 v0.2s, v0.2s, v1.2s
33 ; CHECK-NEXT: add v0.2s, v2.2s, v0.2s
35 %r0 = shufflevector <4 x i32> %a, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
36 %r1 = shufflevector <4 x i32> %a, <4 x i32> poison, <2 x i32> <i32 1, i32 3>
37 %o = add <2 x i32> %r0, %r1
41 define <8 x i16> @deinterleave_shuffle_v16i16(<16 x i16> %a) {
42 ; CHECK-LABEL: deinterleave_shuffle_v16i16:
44 ; CHECK-NEXT: addp v0.8h, v0.8h, v1.8h
46 %r0 = shufflevector <16 x i16> %a, <16 x i16> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
47 %r1 = shufflevector <16 x i16> %a, <16 x i16> poison, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
48 %o = add <8 x i16> %r0, %r1
52 define <16 x i8> @deinterleave_shuffle_v32i8(<32 x i8> %a) {
53 ; CHECK-LABEL: deinterleave_shuffle_v32i8:
55 ; CHECK-NEXT: addp v0.16b, v0.16b, v1.16b
57 %r0 = shufflevector <32 x i8> %a, <32 x i8> poison, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 24, i32 26, i32 28, i32 30>
58 %r1 = shufflevector <32 x i8> %a, <32 x i8> poison, <16 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15, i32 17, i32 19, i32 21, i32 23, i32 25, i32 27, i32 29, i32 31>
59 %o = add <16 x i8> %r0, %r1
63 define <4 x i64> @deinterleave_shuffle_v8i64(<8 x i64> %a) {
64 ; CHECK-LABEL: deinterleave_shuffle_v8i64:
66 ; CHECK-NEXT: addp v2.2d, v2.2d, v3.2d
67 ; CHECK-NEXT: addp v0.2d, v0.2d, v1.2d
68 ; CHECK-NEXT: mov v1.16b, v2.16b
70 %r0 = shufflevector <8 x i64> %a, <8 x i64> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
71 %r1 = shufflevector <8 x i64> %a, <8 x i64> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
72 %o = add <4 x i64> %r0, %r1
76 define <4 x float> @deinterleave_shuffle_v8f32(<8 x float> %a) {
77 ; CHECK-LABEL: deinterleave_shuffle_v8f32:
79 ; CHECK-NEXT: faddp v0.4s, v0.4s, v1.4s
81 %r0 = shufflevector <8 x float> %a, <8 x float> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
82 %r1 = shufflevector <8 x float> %a, <8 x float> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
83 %o = fadd <4 x float> %r0, %r1
87 define <4 x float> @deinterleave_shuffle_v8f32_c(<8 x float> %a) {
88 ; CHECK-LABEL: deinterleave_shuffle_v8f32_c:
90 ; CHECK-NEXT: faddp v0.4s, v0.4s, v1.4s
92 %r0 = shufflevector <8 x float> %a, <8 x float> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
93 %r1 = shufflevector <8 x float> %a, <8 x float> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
94 %o = fadd <4 x float> %r1, %r0
98 define <8 x half> @deinterleave_shuffle_v16f16(<16 x half> %a) {
99 ; CHECK-NOFP16-LABEL: deinterleave_shuffle_v16f16:
100 ; CHECK-NOFP16: // %bb.0:
101 ; CHECK-NOFP16-NEXT: uzp1 v2.8h, v0.8h, v1.8h
102 ; CHECK-NOFP16-NEXT: uzp2 v0.8h, v0.8h, v1.8h
103 ; CHECK-NOFP16-NEXT: fcvtl v1.4s, v0.4h
104 ; CHECK-NOFP16-NEXT: fcvtl v3.4s, v2.4h
105 ; CHECK-NOFP16-NEXT: fcvtl2 v0.4s, v0.8h
106 ; CHECK-NOFP16-NEXT: fcvtl2 v2.4s, v2.8h
107 ; CHECK-NOFP16-NEXT: fadd v1.4s, v3.4s, v1.4s
108 ; CHECK-NOFP16-NEXT: fadd v2.4s, v2.4s, v0.4s
109 ; CHECK-NOFP16-NEXT: fcvtn v0.4h, v1.4s
110 ; CHECK-NOFP16-NEXT: fcvtn2 v0.8h, v2.4s
111 ; CHECK-NOFP16-NEXT: ret
113 ; CHECK-FP16-LABEL: deinterleave_shuffle_v16f16:
114 ; CHECK-FP16: // %bb.0:
115 ; CHECK-FP16-NEXT: faddp v0.8h, v0.8h, v1.8h
116 ; CHECK-FP16-NEXT: ret
117 %r0 = shufflevector <16 x half> %a, <16 x half> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
118 %r1 = shufflevector <16 x half> %a, <16 x half> poison, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
119 %o = fadd <8 x half> %r0, %r1
123 define <4 x double> @deinterleave_shuffle_v8f64(<8 x double> %a) {
124 ; CHECK-LABEL: deinterleave_shuffle_v8f64:
126 ; CHECK-NEXT: faddp v2.2d, v2.2d, v3.2d
127 ; CHECK-NEXT: faddp v0.2d, v0.2d, v1.2d
128 ; CHECK-NEXT: mov v1.16b, v2.16b
130 %r0 = shufflevector <8 x double> %a, <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
131 %r1 = shufflevector <8 x double> %a, <8 x double> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
132 %o = fadd <4 x double> %r0, %r1
136 define <4 x i32> @udot(<4 x i32> %z, <16 x i8> %a, <16 x i8> %b) {
139 ; CHECK-NEXT: umull v3.8h, v1.8b, v2.8b
140 ; CHECK-NEXT: umull2 v1.8h, v1.16b, v2.16b
141 ; CHECK-NEXT: ushll2 v2.4s, v3.8h, #0
142 ; CHECK-NEXT: ushll v3.4s, v3.4h, #0
143 ; CHECK-NEXT: ushll2 v4.4s, v1.8h, #0
144 ; CHECK-NEXT: ushll v1.4s, v1.4h, #0
145 ; CHECK-NEXT: addp v2.4s, v3.4s, v2.4s
146 ; CHECK-NEXT: addp v1.4s, v1.4s, v4.4s
147 ; CHECK-NEXT: addp v1.4s, v2.4s, v1.4s
148 ; CHECK-NEXT: add v0.4s, v0.4s, v1.4s
150 %za = zext <16 x i8> %a to <16 x i32>
151 %zb = zext <16 x i8> %b to <16 x i32>
152 %m = mul <16 x i32> %za, %zb
153 %r0 = shufflevector <16 x i32> %m, <16 x i32> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
154 %r1 = shufflevector <16 x i32> %m, <16 x i32> poison, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
155 %m2 = add <8 x i32> %r0, %r1
156 %s0 = shufflevector <8 x i32> %m2, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
157 %s1 = shufflevector <8 x i32> %m2, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
158 %o = add <4 x i32> %s0, %s1
159 %n = add <4 x i32> %z, %o
163 define <4 x i32> @sdot(<4 x i32> %z, <16 x i8> %a, <16 x i8> %b) {
166 ; CHECK-NEXT: smull v3.8h, v1.8b, v2.8b
167 ; CHECK-NEXT: smull2 v1.8h, v1.16b, v2.16b
168 ; CHECK-NEXT: sshll2 v2.4s, v3.8h, #0
169 ; CHECK-NEXT: sshll v3.4s, v3.4h, #0
170 ; CHECK-NEXT: sshll2 v4.4s, v1.8h, #0
171 ; CHECK-NEXT: sshll v1.4s, v1.4h, #0
172 ; CHECK-NEXT: addp v2.4s, v3.4s, v2.4s
173 ; CHECK-NEXT: addp v1.4s, v1.4s, v4.4s
174 ; CHECK-NEXT: addp v1.4s, v2.4s, v1.4s
175 ; CHECK-NEXT: add v0.4s, v0.4s, v1.4s
177 %za = sext <16 x i8> %a to <16 x i32>
178 %zb = sext <16 x i8> %b to <16 x i32>
179 %m = mul <16 x i32> %za, %zb
180 %r0 = shufflevector <16 x i32> %m, <16 x i32> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
181 %r1 = shufflevector <16 x i32> %m, <16 x i32> poison, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
182 %m2 = add <8 x i32> %r0, %r1
183 %s0 = shufflevector <8 x i32> %m2, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
184 %s1 = shufflevector <8 x i32> %m2, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
185 %o = add <4 x i32> %s0, %s1
186 %n = add <4 x i32> %z, %o