1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
7 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -o /dev/null %s
10 #ifdef SVE_OVERLOADED_FORMS
11 // A simple used,unused... macro, long enough to represent any SVE builtin.
12 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
14 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
17 // CHECK-LABEL: @test_svunpklo_s16(
19 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sunpklo.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
20 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
22 // CPP-CHECK-LABEL: @_Z17test_svunpklo_s16u10__SVInt8_t(
23 // CPP-CHECK-NEXT: entry:
24 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sunpklo.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
25 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
27 svint16_t
test_svunpklo_s16(svint8_t op
)
29 return SVE_ACLE_FUNC(svunpklo
,_s16
,,)(op
);
32 // CHECK-LABEL: @test_svunpklo_s32(
34 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sunpklo.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
35 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
37 // CPP-CHECK-LABEL: @_Z17test_svunpklo_s32u11__SVInt16_t(
38 // CPP-CHECK-NEXT: entry:
39 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sunpklo.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
40 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
42 svint32_t
test_svunpklo_s32(svint16_t op
)
44 return SVE_ACLE_FUNC(svunpklo
,_s32
,,)(op
);
47 // CHECK-LABEL: @test_svunpklo_s64(
49 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.sunpklo.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
50 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
52 // CPP-CHECK-LABEL: @_Z17test_svunpklo_s64u11__SVInt32_t(
53 // CPP-CHECK-NEXT: entry:
54 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.sunpklo.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
55 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
57 svint64_t
test_svunpklo_s64(svint32_t op
)
59 return SVE_ACLE_FUNC(svunpklo
,_s64
,,)(op
);
62 // CHECK-LABEL: @test_svunpklo_u16(
64 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uunpklo.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
65 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
67 // CPP-CHECK-LABEL: @_Z17test_svunpklo_u16u11__SVUint8_t(
68 // CPP-CHECK-NEXT: entry:
69 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uunpklo.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
70 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
72 svuint16_t
test_svunpklo_u16(svuint8_t op
)
74 return SVE_ACLE_FUNC(svunpklo
,_u16
,,)(op
);
77 // CHECK-LABEL: @test_svunpklo_u32(
79 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uunpklo.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
80 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
82 // CPP-CHECK-LABEL: @_Z17test_svunpklo_u32u12__SVUint16_t(
83 // CPP-CHECK-NEXT: entry:
84 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uunpklo.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
85 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
87 svuint32_t
test_svunpklo_u32(svuint16_t op
)
89 return SVE_ACLE_FUNC(svunpklo
,_u32
,,)(op
);
92 // CHECK-LABEL: @test_svunpklo_u64(
94 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uunpklo.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
95 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
97 // CPP-CHECK-LABEL: @_Z17test_svunpklo_u64u12__SVUint32_t(
98 // CPP-CHECK-NEXT: entry:
99 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uunpklo.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
100 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
102 svuint64_t
test_svunpklo_u64(svuint32_t op
)
104 return SVE_ACLE_FUNC(svunpklo
,_u64
,,)(op
);
107 // CHECK-LABEL: @test_svunpklo_b(
108 // CHECK-NEXT: entry:
109 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.punpklo.nxv16i1(<vscale x 16 x i1> [[OP:%.*]])
110 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
111 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
113 // CPP-CHECK-LABEL: @_Z15test_svunpklo_bu10__SVBool_t(
114 // CPP-CHECK-NEXT: entry:
115 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.punpklo.nxv16i1(<vscale x 16 x i1> [[OP:%.*]])
116 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
117 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
119 svbool_t
test_svunpklo_b(svbool_t op
)
121 return SVE_ACLE_FUNC(svunpklo
,_b
,,)(op
);