1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple aarch64-unknown-linux-gnu | FileCheck %s
4 ; Tests for wider-than-legal extensions into mul/mla.
6 define <16 x i16> @mul_i16(<16 x i8> %a, <16 x i8> %b) {
7 ; CHECK-LABEL: mul_i16:
8 ; CHECK: // %bb.0: // %entry
9 ; CHECK-NEXT: umull2 v2.8h, v0.16b, v1.16b
10 ; CHECK-NEXT: umull v0.8h, v0.8b, v1.8b
11 ; CHECK-NEXT: mov v1.16b, v2.16b
14 %ea = zext <16 x i8> %a to <16 x i16>
15 %eb = zext <16 x i8> %b to <16 x i16>
16 %m = mul <16 x i16> %ea, %eb
20 define <16 x i32> @mul_i32(<16 x i8> %a, <16 x i8> %b) {
21 ; CHECK-LABEL: mul_i32:
22 ; CHECK: // %bb.0: // %entry
23 ; CHECK-NEXT: ushll v2.8h, v0.8b, #0
24 ; CHECK-NEXT: ushll v4.8h, v1.8b, #0
25 ; CHECK-NEXT: ushll2 v5.8h, v0.16b, #0
26 ; CHECK-NEXT: ushll2 v6.8h, v1.16b, #0
27 ; CHECK-NEXT: umull v0.4s, v2.4h, v4.4h
28 ; CHECK-NEXT: umull2 v1.4s, v2.8h, v4.8h
29 ; CHECK-NEXT: umull2 v3.4s, v5.8h, v6.8h
30 ; CHECK-NEXT: umull v2.4s, v5.4h, v6.4h
33 %ea = zext <16 x i8> %a to <16 x i32>
34 %eb = zext <16 x i8> %b to <16 x i32>
35 %m = mul <16 x i32> %ea, %eb
39 define <16 x i64> @mul_i64(<16 x i8> %a, <16 x i8> %b) {
40 ; CHECK-LABEL: mul_i64:
41 ; CHECK: // %bb.0: // %entry
42 ; CHECK-NEXT: ushll v2.8h, v0.8b, #0
43 ; CHECK-NEXT: ushll2 v0.8h, v0.16b, #0
44 ; CHECK-NEXT: ushll v3.8h, v1.8b, #0
45 ; CHECK-NEXT: ushll2 v1.8h, v1.16b, #0
46 ; CHECK-NEXT: ushll v4.4s, v2.4h, #0
47 ; CHECK-NEXT: ushll v5.4s, v0.4h, #0
48 ; CHECK-NEXT: ushll v6.4s, v3.4h, #0
49 ; CHECK-NEXT: ushll2 v2.4s, v2.8h, #0
50 ; CHECK-NEXT: ushll v16.4s, v1.4h, #0
51 ; CHECK-NEXT: ushll2 v7.4s, v3.8h, #0
52 ; CHECK-NEXT: ushll2 v17.4s, v0.8h, #0
53 ; CHECK-NEXT: ushll2 v18.4s, v1.8h, #0
54 ; CHECK-NEXT: umull2 v1.2d, v4.4s, v6.4s
55 ; CHECK-NEXT: umull v0.2d, v4.2s, v6.2s
56 ; CHECK-NEXT: umull2 v3.2d, v2.4s, v7.4s
57 ; CHECK-NEXT: umull v2.2d, v2.2s, v7.2s
58 ; CHECK-NEXT: umull v4.2d, v5.2s, v16.2s
59 ; CHECK-NEXT: umull2 v7.2d, v17.4s, v18.4s
60 ; CHECK-NEXT: umull2 v5.2d, v5.4s, v16.4s
61 ; CHECK-NEXT: umull v6.2d, v17.2s, v18.2s
64 %ea = zext <16 x i8> %a to <16 x i64>
65 %eb = zext <16 x i8> %b to <16 x i64>
66 %m = mul <16 x i64> %ea, %eb
71 define <16 x i16> @mla_i16(<16 x i8> %a, <16 x i8> %b, <16 x i16> %c) {
72 ; CHECK-LABEL: mla_i16:
73 ; CHECK: // %bb.0: // %entry
74 ; CHECK-NEXT: umlal2 v3.8h, v0.16b, v1.16b
75 ; CHECK-NEXT: umlal v2.8h, v0.8b, v1.8b
76 ; CHECK-NEXT: mov v0.16b, v2.16b
77 ; CHECK-NEXT: mov v1.16b, v3.16b
80 %ea = zext <16 x i8> %a to <16 x i16>
81 %eb = zext <16 x i8> %b to <16 x i16>
82 %m = mul <16 x i16> %ea, %eb
83 %d = add <16 x i16> %m, %c
87 define <16 x i32> @mla_i32(<16 x i8> %a, <16 x i8> %b, <16 x i32> %c) {
88 ; CHECK-LABEL: mla_i32:
89 ; CHECK: // %bb.0: // %entry
90 ; CHECK-NEXT: ushll v6.8h, v0.8b, #0
91 ; CHECK-NEXT: ushll v7.8h, v1.8b, #0
92 ; CHECK-NEXT: ushll2 v0.8h, v0.16b, #0
93 ; CHECK-NEXT: ushll2 v1.8h, v1.16b, #0
94 ; CHECK-NEXT: umlal v2.4s, v6.4h, v7.4h
95 ; CHECK-NEXT: umlal2 v3.4s, v6.8h, v7.8h
96 ; CHECK-NEXT: umlal2 v5.4s, v0.8h, v1.8h
97 ; CHECK-NEXT: umlal v4.4s, v0.4h, v1.4h
98 ; CHECK-NEXT: mov v0.16b, v2.16b
99 ; CHECK-NEXT: mov v1.16b, v3.16b
100 ; CHECK-NEXT: mov v2.16b, v4.16b
101 ; CHECK-NEXT: mov v3.16b, v5.16b
104 %ea = zext <16 x i8> %a to <16 x i32>
105 %eb = zext <16 x i8> %b to <16 x i32>
106 %m = mul <16 x i32> %ea, %eb
107 %d = add <16 x i32> %m, %c
111 define <16 x i64> @mla_i64(<16 x i8> %a, <16 x i8> %b, <16 x i64> %c) {
112 ; CHECK-LABEL: mla_i64:
113 ; CHECK: // %bb.0: // %entry
114 ; CHECK-NEXT: mov v17.16b, v7.16b
115 ; CHECK-NEXT: mov v16.16b, v6.16b
116 ; CHECK-NEXT: ushll v6.8h, v0.8b, #0
117 ; CHECK-NEXT: ushll2 v0.8h, v0.16b, #0
118 ; CHECK-NEXT: ushll v7.8h, v1.8b, #0
119 ; CHECK-NEXT: ushll2 v1.8h, v1.16b, #0
120 ; CHECK-NEXT: ushll v18.4s, v6.4h, #0
121 ; CHECK-NEXT: ushll2 v21.4s, v6.8h, #0
122 ; CHECK-NEXT: ushll v19.4s, v0.4h, #0
123 ; CHECK-NEXT: ushll v20.4s, v7.4h, #0
124 ; CHECK-NEXT: ushll v22.4s, v1.4h, #0
125 ; CHECK-NEXT: ushll2 v23.4s, v7.8h, #0
126 ; CHECK-NEXT: ldp q6, q7, [sp]
127 ; CHECK-NEXT: ushll2 v0.4s, v0.8h, #0
128 ; CHECK-NEXT: ushll2 v1.4s, v1.8h, #0
129 ; CHECK-NEXT: umlal2 v3.2d, v18.4s, v20.4s
130 ; CHECK-NEXT: umlal v2.2d, v18.2s, v20.2s
131 ; CHECK-NEXT: umlal v16.2d, v19.2s, v22.2s
132 ; CHECK-NEXT: umlal2 v5.2d, v21.4s, v23.4s
133 ; CHECK-NEXT: umlal v4.2d, v21.2s, v23.2s
134 ; CHECK-NEXT: umlal2 v17.2d, v19.4s, v22.4s
135 ; CHECK-NEXT: umlal2 v7.2d, v0.4s, v1.4s
136 ; CHECK-NEXT: umlal v6.2d, v0.2s, v1.2s
137 ; CHECK-NEXT: mov v0.16b, v2.16b
138 ; CHECK-NEXT: mov v1.16b, v3.16b
139 ; CHECK-NEXT: mov v2.16b, v4.16b
140 ; CHECK-NEXT: mov v3.16b, v5.16b
141 ; CHECK-NEXT: mov v4.16b, v16.16b
142 ; CHECK-NEXT: mov v5.16b, v17.16b
145 %ea = zext <16 x i8> %a to <16 x i64>
146 %eb = zext <16 x i8> %b to <16 x i64>
147 %m = mul <16 x i64> %ea, %eb
148 %d = add <16 x i64> %m, %c