1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
4 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
6 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
7 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
8 
9 #include <arm_sve.h>
10 
11 #ifdef SVE_OVERLOADED_FORMS
12 // A simple used,unused... macro, long enough to represent any SVE builtin.
13 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
14 #else
15 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
16 #endif
17 
18 // CHECK-LABEL: @test_svtbl2_s8(
19 // CHECK-NEXT:  entry:
20 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA:%.*]], i32 0)
21 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA]], i32 1)
22 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tbl2.nxv16i8(<vscale x 16 x i8> [[TMP0]], <vscale x 16 x i8> [[TMP1]], <vscale x 16 x i8> [[INDICES:%.*]])
23 // CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP2]]
24 //
25 // CPP-CHECK-LABEL: @_Z14test_svtbl2_s810svint8x2_tu11__SVUint8_t(
26 // CPP-CHECK-NEXT:  entry:
27 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA:%.*]], i32 0)
28 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA]], i32 1)
29 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tbl2.nxv16i8(<vscale x 16 x i8> [[TMP0]], <vscale x 16 x i8> [[TMP1]], <vscale x 16 x i8> [[INDICES:%.*]])
30 // CPP-CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP2]]
31 //
test_svtbl2_s8(svint8x2_t data,svuint8_t indices)32 svint8_t test_svtbl2_s8(svint8x2_t data, svuint8_t indices)
33 {
34   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
35   // expected-warning@+1 {{implicit declaration of function 'svtbl2_s8'}}
36   return SVE_ACLE_FUNC(svtbl2,_s8,,)(data, indices);
37 }
38 
39 // CHECK-LABEL: @test_svtbl2_s16(
40 // CHECK-NEXT:  entry:
41 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA:%.*]], i32 0)
42 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA]], i32 1)
43 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tbl2.nxv8i16(<vscale x 8 x i16> [[TMP0]], <vscale x 8 x i16> [[TMP1]], <vscale x 8 x i16> [[INDICES:%.*]])
44 // CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP2]]
45 //
46 // CPP-CHECK-LABEL: @_Z15test_svtbl2_s1611svint16x2_tu12__SVUint16_t(
47 // CPP-CHECK-NEXT:  entry:
48 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA:%.*]], i32 0)
49 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA]], i32 1)
50 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tbl2.nxv8i16(<vscale x 8 x i16> [[TMP0]], <vscale x 8 x i16> [[TMP1]], <vscale x 8 x i16> [[INDICES:%.*]])
51 // CPP-CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP2]]
52 //
test_svtbl2_s16(svint16x2_t data,svuint16_t indices)53 svint16_t test_svtbl2_s16(svint16x2_t data, svuint16_t indices)
54 {
55   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
56   // expected-warning@+1 {{implicit declaration of function 'svtbl2_s16'}}
57   return SVE_ACLE_FUNC(svtbl2,_s16,,)(data, indices);
58 }
59 
60 // CHECK-LABEL: @test_svtbl2_s32(
61 // CHECK-NEXT:  entry:
62 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA:%.*]], i32 0)
63 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA]], i32 1)
64 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tbl2.nxv4i32(<vscale x 4 x i32> [[TMP0]], <vscale x 4 x i32> [[TMP1]], <vscale x 4 x i32> [[INDICES:%.*]])
65 // CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP2]]
66 //
67 // CPP-CHECK-LABEL: @_Z15test_svtbl2_s3211svint32x2_tu12__SVUint32_t(
68 // CPP-CHECK-NEXT:  entry:
69 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA:%.*]], i32 0)
70 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA]], i32 1)
71 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tbl2.nxv4i32(<vscale x 4 x i32> [[TMP0]], <vscale x 4 x i32> [[TMP1]], <vscale x 4 x i32> [[INDICES:%.*]])
72 // CPP-CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP2]]
73 //
test_svtbl2_s32(svint32x2_t data,svuint32_t indices)74 svint32_t test_svtbl2_s32(svint32x2_t data, svuint32_t indices)
75 {
76   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
77   // expected-warning@+1 {{implicit declaration of function 'svtbl2_s32'}}
78   return SVE_ACLE_FUNC(svtbl2,_s32,,)(data, indices);
79 }
80 
81 // CHECK-LABEL: @test_svtbl2_s64(
82 // CHECK-NEXT:  entry:
83 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA:%.*]], i32 0)
84 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA]], i32 1)
85 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tbl2.nxv2i64(<vscale x 2 x i64> [[TMP0]], <vscale x 2 x i64> [[TMP1]], <vscale x 2 x i64> [[INDICES:%.*]])
86 // CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP2]]
87 //
88 // CPP-CHECK-LABEL: @_Z15test_svtbl2_s6411svint64x2_tu12__SVUint64_t(
89 // CPP-CHECK-NEXT:  entry:
90 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA:%.*]], i32 0)
91 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA]], i32 1)
92 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tbl2.nxv2i64(<vscale x 2 x i64> [[TMP0]], <vscale x 2 x i64> [[TMP1]], <vscale x 2 x i64> [[INDICES:%.*]])
93 // CPP-CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP2]]
94 //
test_svtbl2_s64(svint64x2_t data,svuint64_t indices)95 svint64_t test_svtbl2_s64(svint64x2_t data, svuint64_t indices)
96 {
97   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
98   // expected-warning@+1 {{implicit declaration of function 'svtbl2_s64'}}
99   return SVE_ACLE_FUNC(svtbl2,_s64,,)(data, indices);
100 }
101 
102 // CHECK-LABEL: @test_svtbl2_u8(
103 // CHECK-NEXT:  entry:
104 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA:%.*]], i32 0)
105 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA]], i32 1)
106 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tbl2.nxv16i8(<vscale x 16 x i8> [[TMP0]], <vscale x 16 x i8> [[TMP1]], <vscale x 16 x i8> [[INDICES:%.*]])
107 // CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP2]]
108 //
109 // CPP-CHECK-LABEL: @_Z14test_svtbl2_u811svuint8x2_tu11__SVUint8_t(
110 // CPP-CHECK-NEXT:  entry:
111 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA:%.*]], i32 0)
112 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tuple.get.nxv16i8.nxv32i8(<vscale x 32 x i8> [[DATA]], i32 1)
113 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.tbl2.nxv16i8(<vscale x 16 x i8> [[TMP0]], <vscale x 16 x i8> [[TMP1]], <vscale x 16 x i8> [[INDICES:%.*]])
114 // CPP-CHECK-NEXT:    ret <vscale x 16 x i8> [[TMP2]]
115 //
test_svtbl2_u8(svuint8x2_t data,svuint8_t indices)116 svuint8_t test_svtbl2_u8(svuint8x2_t data, svuint8_t indices)
117 {
118   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
119   // expected-warning@+1 {{implicit declaration of function 'svtbl2_u8'}}
120   return SVE_ACLE_FUNC(svtbl2,_u8,,)(data, indices);
121 }
122 
123 // CHECK-LABEL: @test_svtbl2_u16(
124 // CHECK-NEXT:  entry:
125 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA:%.*]], i32 0)
126 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA]], i32 1)
127 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tbl2.nxv8i16(<vscale x 8 x i16> [[TMP0]], <vscale x 8 x i16> [[TMP1]], <vscale x 8 x i16> [[INDICES:%.*]])
128 // CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP2]]
129 //
130 // CPP-CHECK-LABEL: @_Z15test_svtbl2_u1612svuint16x2_tu12__SVUint16_t(
131 // CPP-CHECK-NEXT:  entry:
132 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA:%.*]], i32 0)
133 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tuple.get.nxv8i16.nxv16i16(<vscale x 16 x i16> [[DATA]], i32 1)
134 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.tbl2.nxv8i16(<vscale x 8 x i16> [[TMP0]], <vscale x 8 x i16> [[TMP1]], <vscale x 8 x i16> [[INDICES:%.*]])
135 // CPP-CHECK-NEXT:    ret <vscale x 8 x i16> [[TMP2]]
136 //
test_svtbl2_u16(svuint16x2_t data,svuint16_t indices)137 svuint16_t test_svtbl2_u16(svuint16x2_t data, svuint16_t indices)
138 {
139   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
140   // expected-warning@+1 {{implicit declaration of function 'svtbl2_u16'}}
141   return SVE_ACLE_FUNC(svtbl2,_u16,,)(data, indices);
142 }
143 
144 // CHECK-LABEL: @test_svtbl2_u32(
145 // CHECK-NEXT:  entry:
146 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA:%.*]], i32 0)
147 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA]], i32 1)
148 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tbl2.nxv4i32(<vscale x 4 x i32> [[TMP0]], <vscale x 4 x i32> [[TMP1]], <vscale x 4 x i32> [[INDICES:%.*]])
149 // CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP2]]
150 //
151 // CPP-CHECK-LABEL: @_Z15test_svtbl2_u3212svuint32x2_tu12__SVUint32_t(
152 // CPP-CHECK-NEXT:  entry:
153 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA:%.*]], i32 0)
154 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tuple.get.nxv4i32.nxv8i32(<vscale x 8 x i32> [[DATA]], i32 1)
155 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.tbl2.nxv4i32(<vscale x 4 x i32> [[TMP0]], <vscale x 4 x i32> [[TMP1]], <vscale x 4 x i32> [[INDICES:%.*]])
156 // CPP-CHECK-NEXT:    ret <vscale x 4 x i32> [[TMP2]]
157 //
test_svtbl2_u32(svuint32x2_t data,svuint32_t indices)158 svuint32_t test_svtbl2_u32(svuint32x2_t data, svuint32_t indices)
159 {
160   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
161   // expected-warning@+1 {{implicit declaration of function 'svtbl2_u32'}}
162   return SVE_ACLE_FUNC(svtbl2,_u32,,)(data, indices);
163 }
164 
165 // CHECK-LABEL: @test_svtbl2_u64(
166 // CHECK-NEXT:  entry:
167 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA:%.*]], i32 0)
168 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA]], i32 1)
169 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tbl2.nxv2i64(<vscale x 2 x i64> [[TMP0]], <vscale x 2 x i64> [[TMP1]], <vscale x 2 x i64> [[INDICES:%.*]])
170 // CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP2]]
171 //
172 // CPP-CHECK-LABEL: @_Z15test_svtbl2_u6412svuint64x2_tu12__SVUint64_t(
173 // CPP-CHECK-NEXT:  entry:
174 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA:%.*]], i32 0)
175 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tuple.get.nxv2i64.nxv4i64(<vscale x 4 x i64> [[DATA]], i32 1)
176 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.tbl2.nxv2i64(<vscale x 2 x i64> [[TMP0]], <vscale x 2 x i64> [[TMP1]], <vscale x 2 x i64> [[INDICES:%.*]])
177 // CPP-CHECK-NEXT:    ret <vscale x 2 x i64> [[TMP2]]
178 //
test_svtbl2_u64(svuint64x2_t data,svuint64_t indices)179 svuint64_t test_svtbl2_u64(svuint64x2_t data, svuint64_t indices)
180 {
181   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
182   // expected-warning@+1 {{implicit declaration of function 'svtbl2_u64'}}
183   return SVE_ACLE_FUNC(svtbl2,_u64,,)(data, indices);
184 }
185 
186 // CHECK-LABEL: @test_svtbl2_f16(
187 // CHECK-NEXT:  entry:
188 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.tuple.get.nxv8f16.nxv16f16(<vscale x 16 x half> [[DATA:%.*]], i32 0)
189 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.tuple.get.nxv8f16.nxv16f16(<vscale x 16 x half> [[DATA]], i32 1)
190 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.tbl2.nxv8f16(<vscale x 8 x half> [[TMP0]], <vscale x 8 x half> [[TMP1]], <vscale x 8 x i16> [[INDICES:%.*]])
191 // CHECK-NEXT:    ret <vscale x 8 x half> [[TMP2]]
192 //
193 // CPP-CHECK-LABEL: @_Z15test_svtbl2_f1613svfloat16x2_tu12__SVUint16_t(
194 // CPP-CHECK-NEXT:  entry:
195 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.tuple.get.nxv8f16.nxv16f16(<vscale x 16 x half> [[DATA:%.*]], i32 0)
196 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.tuple.get.nxv8f16.nxv16f16(<vscale x 16 x half> [[DATA]], i32 1)
197 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.tbl2.nxv8f16(<vscale x 8 x half> [[TMP0]], <vscale x 8 x half> [[TMP1]], <vscale x 8 x i16> [[INDICES:%.*]])
198 // CPP-CHECK-NEXT:    ret <vscale x 8 x half> [[TMP2]]
199 //
test_svtbl2_f16(svfloat16x2_t data,svuint16_t indices)200 svfloat16_t test_svtbl2_f16(svfloat16x2_t data, svuint16_t indices)
201 {
202   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
203   // expected-warning@+1 {{implicit declaration of function 'svtbl2_f16'}}
204   return SVE_ACLE_FUNC(svtbl2,_f16,,)(data, indices);
205 }
206 
207 // CHECK-LABEL: @test_svtbl2_f32(
208 // CHECK-NEXT:  entry:
209 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.tuple.get.nxv4f32.nxv8f32(<vscale x 8 x float> [[DATA:%.*]], i32 0)
210 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.tuple.get.nxv4f32.nxv8f32(<vscale x 8 x float> [[DATA]], i32 1)
211 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.tbl2.nxv4f32(<vscale x 4 x float> [[TMP0]], <vscale x 4 x float> [[TMP1]], <vscale x 4 x i32> [[INDICES:%.*]])
212 // CHECK-NEXT:    ret <vscale x 4 x float> [[TMP2]]
213 //
214 // CPP-CHECK-LABEL: @_Z15test_svtbl2_f3213svfloat32x2_tu12__SVUint32_t(
215 // CPP-CHECK-NEXT:  entry:
216 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.tuple.get.nxv4f32.nxv8f32(<vscale x 8 x float> [[DATA:%.*]], i32 0)
217 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.tuple.get.nxv4f32.nxv8f32(<vscale x 8 x float> [[DATA]], i32 1)
218 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.tbl2.nxv4f32(<vscale x 4 x float> [[TMP0]], <vscale x 4 x float> [[TMP1]], <vscale x 4 x i32> [[INDICES:%.*]])
219 // CPP-CHECK-NEXT:    ret <vscale x 4 x float> [[TMP2]]
220 //
test_svtbl2_f32(svfloat32x2_t data,svuint32_t indices)221 svfloat32_t test_svtbl2_f32(svfloat32x2_t data, svuint32_t indices)
222 {
223   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
224   // expected-warning@+1 {{implicit declaration of function 'svtbl2_f32'}}
225   return SVE_ACLE_FUNC(svtbl2,_f32,,)(data, indices);
226 }
227 
228 // CHECK-LABEL: @test_svtbl2_f64(
229 // CHECK-NEXT:  entry:
230 // CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.tuple.get.nxv2f64.nxv4f64(<vscale x 4 x double> [[DATA:%.*]], i32 0)
231 // CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.tuple.get.nxv2f64.nxv4f64(<vscale x 4 x double> [[DATA]], i32 1)
232 // CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.tbl2.nxv2f64(<vscale x 2 x double> [[TMP0]], <vscale x 2 x double> [[TMP1]], <vscale x 2 x i64> [[INDICES:%.*]])
233 // CHECK-NEXT:    ret <vscale x 2 x double> [[TMP2]]
234 //
235 // CPP-CHECK-LABEL: @_Z15test_svtbl2_f6413svfloat64x2_tu12__SVUint64_t(
236 // CPP-CHECK-NEXT:  entry:
237 // CPP-CHECK-NEXT:    [[TMP0:%.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.tuple.get.nxv2f64.nxv4f64(<vscale x 4 x double> [[DATA:%.*]], i32 0)
238 // CPP-CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.tuple.get.nxv2f64.nxv4f64(<vscale x 4 x double> [[DATA]], i32 1)
239 // CPP-CHECK-NEXT:    [[TMP2:%.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.tbl2.nxv2f64(<vscale x 2 x double> [[TMP0]], <vscale x 2 x double> [[TMP1]], <vscale x 2 x i64> [[INDICES:%.*]])
240 // CPP-CHECK-NEXT:    ret <vscale x 2 x double> [[TMP2]]
241 //
test_svtbl2_f64(svfloat64x2_t data,svuint64_t indices)242 svfloat64_t test_svtbl2_f64(svfloat64x2_t data, svuint64_t indices)
243 {
244   // overload-warning@+2 {{implicit declaration of function 'svtbl2'}}
245   // expected-warning@+1 {{implicit declaration of function 'svtbl2_f64'}}
246   return SVE_ACLE_FUNC(svtbl2,_f64,,)(data, indices);
247 }
248