1 // 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
2 // 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
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error -verify-ignore-unexpected=note %s
4
5 #include <arm_sve.h>
6
7 #ifdef SVE_OVERLOADED_FORMS
8 // A simple used,unused... macro, long enough to represent any SVE builtin.
9 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
10 #else
11 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
12 #endif
13
test_svmls_lane_s16(svint16_t op1,svint16_t op2,svint16_t op3)14 svint16_t test_svmls_lane_s16(svint16_t op1, svint16_t op2, svint16_t op3)
15 {
16 // CHECK-LABEL: test_svmls_lane_s16
17 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.mls.lane.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3, i32 0)
18 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
19 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_s16'}}
20 return SVE_ACLE_FUNC(svmls_lane,_s16,,)(op1, op2, op3, 0);
21 }
22
test_svmls_lane_s16_1(svint16_t op1,svint16_t op2,svint16_t op3)23 svint16_t test_svmls_lane_s16_1(svint16_t op1, svint16_t op2, svint16_t op3)
24 {
25 // CHECK-LABEL: test_svmls_lane_s16_1
26 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.mls.lane.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3, i32 7)
27 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
28 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_s16'}}
29 return SVE_ACLE_FUNC(svmls_lane,_s16,,)(op1, op2, op3, 7);
30 }
31
test_svmls_lane_s32(svint32_t op1,svint32_t op2,svint32_t op3)32 svint32_t test_svmls_lane_s32(svint32_t op1, svint32_t op2, svint32_t op3)
33 {
34 // CHECK-LABEL: test_svmls_lane_s32
35 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.mls.lane.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3, i32 0)
36 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
37 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_s32'}}
38 return SVE_ACLE_FUNC(svmls_lane,_s32,,)(op1, op2, op3, 0);
39 }
40
test_svmls_lane_s32_1(svint32_t op1,svint32_t op2,svint32_t op3)41 svint32_t test_svmls_lane_s32_1(svint32_t op1, svint32_t op2, svint32_t op3)
42 {
43 // CHECK-LABEL: test_svmls_lane_s32_1
44 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.mls.lane.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3, i32 3)
45 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
46 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_s32'}}
47 return SVE_ACLE_FUNC(svmls_lane,_s32,,)(op1, op2, op3, 3);
48 }
49
test_svmls_lane_s64(svint64_t op1,svint64_t op2,svint64_t op3)50 svint64_t test_svmls_lane_s64(svint64_t op1, svint64_t op2, svint64_t op3)
51 {
52 // CHECK-LABEL: test_svmls_lane_s64
53 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.mls.lane.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3, i32 0)
54 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
55 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_s64'}}
56 return SVE_ACLE_FUNC(svmls_lane,_s64,,)(op1, op2, op3, 0);
57 }
58
test_svmls_lane_s64_1(svint64_t op1,svint64_t op2,svint64_t op3)59 svint64_t test_svmls_lane_s64_1(svint64_t op1, svint64_t op2, svint64_t op3)
60 {
61 // CHECK-LABEL: test_svmls_lane_s64_1
62 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.mls.lane.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3, i32 1)
63 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
64 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_s64'}}
65 return SVE_ACLE_FUNC(svmls_lane,_s64,,)(op1, op2, op3, 1);
66 }
67
test_svmls_lane_u16(svuint16_t op1,svuint16_t op2,svuint16_t op3)68 svuint16_t test_svmls_lane_u16(svuint16_t op1, svuint16_t op2, svuint16_t op3)
69 {
70 // CHECK-LABEL: test_svmls_lane_u16
71 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.mls.lane.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3, i32 0)
72 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
73 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_u16'}}
74 return SVE_ACLE_FUNC(svmls_lane,_u16,,)(op1, op2, op3, 0);
75 }
76
test_svmls_lane_u16_1(svuint16_t op1,svuint16_t op2,svuint16_t op3)77 svuint16_t test_svmls_lane_u16_1(svuint16_t op1, svuint16_t op2, svuint16_t op3)
78 {
79 // CHECK-LABEL: test_svmls_lane_u16_1
80 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.mls.lane.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3, i32 7)
81 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
82 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_u16'}}
83 return SVE_ACLE_FUNC(svmls_lane,_u16,,)(op1, op2, op3, 7);
84 }
85
test_svmls_lane_u32(svuint32_t op1,svuint32_t op2,svuint32_t op3)86 svuint32_t test_svmls_lane_u32(svuint32_t op1, svuint32_t op2, svuint32_t op3)
87 {
88 // CHECK-LABEL: test_svmls_lane_u32
89 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.mls.lane.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3, i32 0)
90 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
91 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_u32'}}
92 return SVE_ACLE_FUNC(svmls_lane,_u32,,)(op1, op2, op3, 0);
93 }
94
test_svmls_lane_u32_1(svuint32_t op1,svuint32_t op2,svuint32_t op3)95 svuint32_t test_svmls_lane_u32_1(svuint32_t op1, svuint32_t op2, svuint32_t op3)
96 {
97 // CHECK-LABEL: test_svmls_lane_u32_1
98 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.mls.lane.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3, i32 3)
99 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
100 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_u32'}}
101 return SVE_ACLE_FUNC(svmls_lane,_u32,,)(op1, op2, op3, 3);
102 }
103
test_svmls_lane_u64(svuint64_t op1,svuint64_t op2,svuint64_t op3)104 svuint64_t test_svmls_lane_u64(svuint64_t op1, svuint64_t op2, svuint64_t op3)
105 {
106 // CHECK-LABEL: test_svmls_lane_u64
107 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.mls.lane.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3, i32 0)
108 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
109 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_u64'}}
110 return SVE_ACLE_FUNC(svmls_lane,_u64,,)(op1, op2, op3, 0);
111 }
112
test_svmls_lane_u64_1(svuint64_t op1,svuint64_t op2,svuint64_t op3)113 svuint64_t test_svmls_lane_u64_1(svuint64_t op1, svuint64_t op2, svuint64_t op3)
114 {
115 // CHECK-LABEL: test_svmls_lane_u64_1
116 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.mls.lane.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3, i32 1)
117 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
118 // expected-warning@+1 {{implicit declaration of function 'svmls_lane_u64'}}
119 return SVE_ACLE_FUNC(svmls_lane,_u64,,)(op1, op2, op3, 1);
120 }
121