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 %s
4 // 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
5
6 #include <arm_sve.h>
7
8 #ifdef SVE_OVERLOADED_FORMS
9 // A simple used,unused... macro, long enough to represent any SVE builtin.
10 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
11 #else
12 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
13 #endif
14
test_svpmullb_pair_u8(svuint8_t op1,svuint8_t op2)15 svuint8_t test_svpmullb_pair_u8(svuint8_t op1, svuint8_t op2)
16 {
17 // CHECK-LABEL: test_svpmullb_pair_u8
18 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.pmullb.pair.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
19 // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
20 // overload-warning@+2 {{implicit declaration of function 'svpmullb_pair'}}
21 // expected-warning@+1 {{implicit declaration of function 'svpmullb_pair_u8'}}
22 return SVE_ACLE_FUNC(svpmullb_pair,_u8,,)(op1, op2);
23 }
24
test_svpmullb_pair_u32(svuint32_t op1,svuint32_t op2)25 svuint32_t test_svpmullb_pair_u32(svuint32_t op1, svuint32_t op2)
26 {
27 // CHECK-LABEL: test_svpmullb_pair_u32
28 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.pmullb.pair.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
29 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
30 // overload-warning@+2 {{implicit declaration of function 'svpmullb_pair'}}
31 // expected-warning@+1 {{implicit declaration of function 'svpmullb_pair_u32'}}
32 return SVE_ACLE_FUNC(svpmullb_pair,_u32,,)(op1, op2);
33 }
34
test_svpmullb_pair_n_u8(svuint8_t op1,uint8_t op2)35 svuint8_t test_svpmullb_pair_n_u8(svuint8_t op1, uint8_t op2)
36 {
37 // CHECK-LABEL: test_svpmullb_pair_n_u8
38 // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
39 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.pmullb.pair.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
40 // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
41 // overload-warning@+2 {{implicit declaration of function 'svpmullb_pair'}}
42 // expected-warning@+1 {{implicit declaration of function 'svpmullb_pair_n_u8'}}
43 return SVE_ACLE_FUNC(svpmullb_pair,_n_u8,,)(op1, op2);
44 }
45
test_svpmullb_pair_n_u32(svuint32_t op1,uint32_t op2)46 svuint32_t test_svpmullb_pair_n_u32(svuint32_t op1, uint32_t op2)
47 {
48 // CHECK-LABEL: test_svpmullb_pair_n_u32
49 // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
50 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.pmullb.pair.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
51 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
52 // overload-warning@+2 {{implicit declaration of function 'svpmullb_pair'}}
53 // expected-warning@+1 {{implicit declaration of function 'svpmullb_pair_n_u32'}}
54 return SVE_ACLE_FUNC(svpmullb_pair,_n_u32,,)(op1, op2);
55 }
56
test_svpmullb_u16(svuint8_t op1,svuint8_t op2)57 svuint16_t test_svpmullb_u16(svuint8_t op1, svuint8_t op2)
58 {
59 // CHECK-LABEL: test_svpmullb_u16
60 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.pmullb.pair.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
61 // CHECK: %[[BITCAST:.*]] = bitcast <vscale x 16 x i8> %[[INTRINSIC]] to <vscale x 8 x i16>
62 // CHECK: ret <vscale x 8 x i16> %[[BITCAST]]
63 // overload-warning@+2 {{implicit declaration of function 'svpmullb'}}
64 // expected-warning@+1 {{implicit declaration of function 'svpmullb_u16'}}
65 return SVE_ACLE_FUNC(svpmullb,_u16,,)(op1, op2);
66 }
67
test_svpmullb_u64(svuint32_t op1,svuint32_t op2)68 svuint64_t test_svpmullb_u64(svuint32_t op1, svuint32_t op2)
69 {
70 // CHECK-LABEL: test_svpmullb_u64
71 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.pmullb.pair.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
72 // CHECK: %[[BITCAST:.*]] = bitcast <vscale x 4 x i32> %[[INTRINSIC]] to <vscale x 2 x i64>
73 // CHECK: ret <vscale x 2 x i64> %[[BITCAST]]
74 // overload-warning@+2 {{implicit declaration of function 'svpmullb'}}
75 // expected-warning@+1 {{implicit declaration of function 'svpmullb_u64'}}
76 return SVE_ACLE_FUNC(svpmullb,_u64,,)(op1, op2);
77 }
78
test_svpmullb_n_u16(svuint8_t op1,uint8_t op2)79 svuint16_t test_svpmullb_n_u16(svuint8_t op1, uint8_t op2)
80 {
81 // CHECK-LABEL: test_svpmullb_n_u16
82 // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
83 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.pmullb.pair.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
84 // CHECK: %[[BITCAST:.*]] = bitcast <vscale x 16 x i8> %[[INTRINSIC]] to <vscale x 8 x i16>
85 // CHECK: ret <vscale x 8 x i16> %[[BITCAST]]
86 // overload-warning@+2 {{implicit declaration of function 'svpmullb'}}
87 // expected-warning@+1 {{implicit declaration of function 'svpmullb_n_u16'}}
88 return SVE_ACLE_FUNC(svpmullb,_n_u16,,)(op1, op2);
89 }
90
test_svpmullb_n_u64(svuint32_t op1,uint32_t op2)91 svuint64_t test_svpmullb_n_u64(svuint32_t op1, uint32_t op2)
92 {
93 // CHECK-LABEL: test_svpmullb_n_u64
94 // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
95 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.pmullb.pair.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
96 // CHECK: %[[BITCAST:.*]] = bitcast <vscale x 4 x i32> %[[INTRINSIC]] to <vscale x 2 x i64>
97 // CHECK: ret <vscale x 2 x i64> %[[BITCAST]]
98 // overload-warning@+2 {{implicit declaration of function 'svpmullb'}}
99 // expected-warning@+1 {{implicit declaration of function 'svpmullb_n_u64'}}
100 return SVE_ACLE_FUNC(svpmullb,_n_u64,,)(op1, op2);
101 }
102