1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2 < %s | FileCheck %s
8 define <vscale x 16 x i8> @tbl2_b(<vscale x 16 x i8> %a, <vscale x 16 x i8> %unused, <vscale x 16 x i8> %b, <vscale x 16 x i8> %c) {
11 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
12 ; CHECK-NEXT: mov z1.d, z0.d
13 ; CHECK-NEXT: tbl z0.b, { z1.b, z2.b }, z3.b
15 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.tbl2.nxv16i8(<vscale x 16 x i8> %a,
16 <vscale x 16 x i8> %b,
17 <vscale x 16 x i8> %c)
18 ret <vscale x 16 x i8> %out
21 define <vscale x 8 x i16> @tbl2_h(<vscale x 8 x i16> %a, <vscale x 16 x i8> %unused, <vscale x 8 x i16> %b, <vscale x 8 x i16> %c) {
22 ; CHECK-LABEL: tbl2_h:
24 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
25 ; CHECK-NEXT: mov z1.d, z0.d
26 ; CHECK-NEXT: tbl z0.h, { z1.h, z2.h }, z3.h
28 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.tbl2.nxv8i16(<vscale x 8 x i16> %a,
29 <vscale x 8 x i16> %b,
30 <vscale x 8 x i16> %c)
31 ret <vscale x 8 x i16> %out
34 define <vscale x 4 x i32> @tbl2_s(<vscale x 4 x i32> %a, <vscale x 4 x i32> %unused, <vscale x 4 x i32> %b, <vscale x 4 x i32> %c) {
35 ; CHECK-LABEL: tbl2_s:
37 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
38 ; CHECK-NEXT: mov z1.d, z0.d
39 ; CHECK-NEXT: tbl z0.s, { z1.s, z2.s }, z3.s
41 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.tbl2.nxv4i32(<vscale x 4 x i32> %a,
42 <vscale x 4 x i32> %b,
43 <vscale x 4 x i32> %c)
44 ret <vscale x 4 x i32> %out
47 define <vscale x 2 x i64> @tbl2_d(<vscale x 2 x i64> %a, <vscale x 2 x i64> %unused, <vscale x 2 x i64> %b, <vscale x 2 x i64> %c) {
48 ; CHECK-LABEL: tbl2_d:
50 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
51 ; CHECK-NEXT: mov z1.d, z0.d
52 ; CHECK-NEXT: tbl z0.d, { z1.d, z2.d }, z3.d
54 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.tbl2.nxv2i64(<vscale x 2 x i64> %a,
55 <vscale x 2 x i64> %b,
56 <vscale x 2 x i64> %c)
57 ret <vscale x 2 x i64> %out
60 define <vscale x 8 x half> @tbl2_fh(<vscale x 8 x half> %a, <vscale x 8 x half> %unused, <vscale x 8 x half> %b, <vscale x 8 x i16> %c) {
61 ; CHECK-LABEL: tbl2_fh:
63 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
64 ; CHECK-NEXT: mov z1.d, z0.d
65 ; CHECK-NEXT: tbl z0.h, { z1.h, z2.h }, z3.h
67 %out = call <vscale x 8 x half> @llvm.aarch64.sve.tbl2.nxv8f16(<vscale x 8 x half> %a,
68 <vscale x 8 x half> %b,
69 <vscale x 8 x i16> %c)
70 ret <vscale x 8 x half> %out
73 define <vscale x 8 x bfloat> @tbl2_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %unused, <vscale x 8 x bfloat> %b, <vscale x 8 x i16> %c) #0 {
74 ; CHECK-LABEL: tbl2_bf16:
76 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
77 ; CHECK-NEXT: mov z1.d, z0.d
78 ; CHECK-NEXT: tbl z0.h, { z1.h, z2.h }, z3.h
80 %out = call <vscale x 8 x bfloat> @llvm.aarch64.sve.tbl2.nxv8bf16(<vscale x 8 x bfloat> %a,
81 <vscale x 8 x bfloat> %b,
82 <vscale x 8 x i16> %c)
83 ret <vscale x 8 x bfloat> %out
86 define <vscale x 4 x float> @tbl2_fs(<vscale x 4 x float> %a, <vscale x 4 x float> %unused, <vscale x 4 x float> %b, <vscale x 4 x i32> %c) {
87 ; CHECK-LABEL: tbl2_fs:
89 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
90 ; CHECK-NEXT: mov z1.d, z0.d
91 ; CHECK-NEXT: tbl z0.s, { z1.s, z2.s }, z3.s
93 %out = call <vscale x 4 x float> @llvm.aarch64.sve.tbl2.nxv4f32(<vscale x 4 x float> %a,
94 <vscale x 4 x float> %b,
95 <vscale x 4 x i32> %c)
96 ret <vscale x 4 x float> %out
99 define <vscale x 2 x double> @tbl2_fd(<vscale x 2 x double> %a, <vscale x 2 x double> %unused, <vscale x 2 x double> %b, <vscale x 2 x i64> %c) {
100 ; CHECK-LABEL: tbl2_fd:
102 ; CHECK-NEXT: // kill: def $z2 killed $z2 def $z1_z2
103 ; CHECK-NEXT: mov z1.d, z0.d
104 ; CHECK-NEXT: tbl z0.d, { z1.d, z2.d }, z3.d
106 %out = call <vscale x 2 x double> @llvm.aarch64.sve.tbl2.nxv2f64(<vscale x 2 x double> %a,
107 <vscale x 2 x double> %b,
108 <vscale x 2 x i64> %c)
109 ret <vscale x 2 x double> %out
116 define <vscale x 16 x i8> @tbx_b(<vscale x 16 x i8> %a, <vscale x 16 x i8> %b, <vscale x 16 x i8> %c) {
117 ; CHECK-LABEL: tbx_b:
119 ; CHECK-NEXT: tbx z0.b, z1.b, z2.b
121 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.tbx.nxv16i8(<vscale x 16 x i8> %a,
122 <vscale x 16 x i8> %b,
123 <vscale x 16 x i8> %c)
124 ret <vscale x 16 x i8> %out
127 define <vscale x 8 x i16> @tbx_h(<vscale x 8 x i16> %a, <vscale x 8 x i16> %b, <vscale x 8 x i16> %c) {
128 ; CHECK-LABEL: tbx_h:
130 ; CHECK-NEXT: tbx z0.h, z1.h, z2.h
132 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.tbx.nxv8i16(<vscale x 8 x i16> %a,
133 <vscale x 8 x i16> %b,
134 <vscale x 8 x i16> %c)
135 ret <vscale x 8 x i16> %out
138 define <vscale x 8 x half> @ftbx_h(<vscale x 8 x half> %a, <vscale x 8 x half> %b, <vscale x 8 x i16> %c) {
139 ; CHECK-LABEL: ftbx_h:
141 ; CHECK-NEXT: tbx z0.h, z1.h, z2.h
143 %out = call <vscale x 8 x half> @llvm.aarch64.sve.tbx.nxv8f16(<vscale x 8 x half> %a,
144 <vscale x 8 x half> %b,
145 <vscale x 8 x i16> %c)
146 ret <vscale x 8 x half> %out
149 define <vscale x 8 x bfloat> @ftbx_h_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b, <vscale x 8 x i16> %c) #0 {
150 ; CHECK-LABEL: ftbx_h_bf16:
152 ; CHECK-NEXT: tbx z0.h, z1.h, z2.h
154 %out = call <vscale x 8 x bfloat> @llvm.aarch64.sve.tbx.nxv8bf16(<vscale x 8 x bfloat> %a,
155 <vscale x 8 x bfloat> %b,
156 <vscale x 8 x i16> %c)
157 ret <vscale x 8 x bfloat> %out
160 define <vscale x 4 x i32> @tbx_s(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b, <vscale x 4 x i32> %c) {
161 ; CHECK-LABEL: tbx_s:
163 ; CHECK-NEXT: tbx z0.s, z1.s, z2.s
165 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.tbx.nxv4i32(<vscale x 4 x i32> %a,
166 <vscale x 4 x i32> %b,
167 <vscale x 4 x i32> %c)
168 ret <vscale x 4 x i32> %out
171 define <vscale x 4 x float> @ftbx_s(<vscale x 4 x float> %a, <vscale x 4 x float> %b, <vscale x 4 x i32> %c) {
172 ; CHECK-LABEL: ftbx_s:
174 ; CHECK-NEXT: tbx z0.s, z1.s, z2.s
176 %out = call <vscale x 4 x float> @llvm.aarch64.sve.tbx.nxv4f32(<vscale x 4 x float> %a,
177 <vscale x 4 x float> %b,
178 <vscale x 4 x i32> %c)
179 ret <vscale x 4 x float> %out
182 define <vscale x 2 x i64> @tbx_d(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b, <vscale x 2 x i64> %c) {
183 ; CHECK-LABEL: tbx_d:
185 ; CHECK-NEXT: tbx z0.d, z1.d, z2.d
187 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.tbx.nxv2i64(<vscale x 2 x i64> %a,
188 <vscale x 2 x i64> %b,
189 <vscale x 2 x i64> %c)
190 ret <vscale x 2 x i64> %out
193 define <vscale x 2 x double> @ftbx_d(<vscale x 2 x double> %a, <vscale x 2 x double> %b, <vscale x 2 x i64> %c) {
194 ; CHECK-LABEL: ftbx_d:
196 ; CHECK-NEXT: tbx z0.d, z1.d, z2.d
198 %out = call <vscale x 2 x double> @llvm.aarch64.sve.tbx.nxv2f64(<vscale x 2 x double> %a,
199 <vscale x 2 x double> %b,
200 <vscale x 2 x i64> %c)
201 ret <vscale x 2 x double> %out
204 declare <vscale x 16 x i8> @llvm.aarch64.sve.tbl2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)
205 declare <vscale x 8 x i16> @llvm.aarch64.sve.tbl2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)
206 declare <vscale x 4 x i32> @llvm.aarch64.sve.tbl2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)
207 declare <vscale x 2 x i64> @llvm.aarch64.sve.tbl2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)
209 declare <vscale x 8 x half> @llvm.aarch64.sve.tbl2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x i16>)
210 declare <vscale x 4 x float> @llvm.aarch64.sve.tbl2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x i32>)
211 declare <vscale x 2 x double> @llvm.aarch64.sve.tbl2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x i64>)
213 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.tbl2.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x i16>)
215 declare <vscale x 16 x i8> @llvm.aarch64.sve.tbx.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)
216 declare <vscale x 8 x i16> @llvm.aarch64.sve.tbx.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)
217 declare <vscale x 4 x i32> @llvm.aarch64.sve.tbx.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)
218 declare <vscale x 2 x i64> @llvm.aarch64.sve.tbx.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)
220 declare <vscale x 8 x half> @llvm.aarch64.sve.tbx.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x i16>)
221 declare <vscale x 4 x float> @llvm.aarch64.sve.tbx.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x i32>)
222 declare <vscale x 2 x double> @llvm.aarch64.sve.tbx.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x i64>)
224 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.tbx.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x i16>)
226 ; +bf16 is required for the bfloat version.
227 attributes #0 = { "target-features"="+sve2,+bf16" }