Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / AArch64 / sve-intrinsics / acle_sve_qinch.c
blob05471619ad7e6981c097a366efdeb155298cfd64
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -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 -target-feature +sve -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 -target-feature +sve -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 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8 // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
10 #include <arm_sve.h>
12 #if defined __ARM_FEATURE_SME
13 #define MODE_ATTR __arm_streaming
14 #else
15 #define MODE_ATTR
16 #endif
18 #ifdef SVE_OVERLOADED_FORMS
19 // A simple used,unused... macro, long enough to represent any SVE builtin.
20 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
21 #else
22 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
23 #endif
25 // CHECK-LABEL: @test_svqinch_n_s32(
26 // CHECK-NEXT: entry:
27 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqinch.n32(i32 [[OP:%.*]], i32 31, i32 1)
28 // CHECK-NEXT: ret i32 [[TMP0]]
30 // CPP-CHECK-LABEL: @_Z18test_svqinch_n_s32i(
31 // CPP-CHECK-NEXT: entry:
32 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqinch.n32(i32 [[OP:%.*]], i32 31, i32 1)
33 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
35 int32_t test_svqinch_n_s32(int32_t op) MODE_ATTR
37 return SVE_ACLE_FUNC(svqinch,_n_s32,,)(op, 1);
40 // CHECK-LABEL: @test_svqinch_n_s32_1(
41 // CHECK-NEXT: entry:
42 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqinch.n32(i32 [[OP:%.*]], i32 31, i32 16)
43 // CHECK-NEXT: ret i32 [[TMP0]]
45 // CPP-CHECK-LABEL: @_Z20test_svqinch_n_s32_1i(
46 // CPP-CHECK-NEXT: entry:
47 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqinch.n32(i32 [[OP:%.*]], i32 31, i32 16)
48 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
50 int32_t test_svqinch_n_s32_1(int32_t op) MODE_ATTR
52 return SVE_ACLE_FUNC(svqinch,_n_s32,,)(op, 16);
55 // CHECK-LABEL: @test_svqinch_n_s64(
56 // CHECK-NEXT: entry:
57 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqinch.n64(i64 [[OP:%.*]], i32 31, i32 1)
58 // CHECK-NEXT: ret i64 [[TMP0]]
60 // CPP-CHECK-LABEL: @_Z18test_svqinch_n_s64l(
61 // CPP-CHECK-NEXT: entry:
62 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqinch.n64(i64 [[OP:%.*]], i32 31, i32 1)
63 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
65 int64_t test_svqinch_n_s64(int64_t op) MODE_ATTR
67 return SVE_ACLE_FUNC(svqinch,_n_s64,,)(op, 1);
70 // CHECK-LABEL: @test_svqinch_n_u32(
71 // CHECK-NEXT: entry:
72 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqinch.n32(i32 [[OP:%.*]], i32 31, i32 16)
73 // CHECK-NEXT: ret i32 [[TMP0]]
75 // CPP-CHECK-LABEL: @_Z18test_svqinch_n_u32j(
76 // CPP-CHECK-NEXT: entry:
77 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqinch.n32(i32 [[OP:%.*]], i32 31, i32 16)
78 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
80 uint32_t test_svqinch_n_u32(uint32_t op) MODE_ATTR
82 return SVE_ACLE_FUNC(svqinch,_n_u32,,)(op, 16);
85 // CHECK-LABEL: @test_svqinch_n_u64(
86 // CHECK-NEXT: entry:
87 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqinch.n64(i64 [[OP:%.*]], i32 31, i32 1)
88 // CHECK-NEXT: ret i64 [[TMP0]]
90 // CPP-CHECK-LABEL: @_Z18test_svqinch_n_u64m(
91 // CPP-CHECK-NEXT: entry:
92 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqinch.n64(i64 [[OP:%.*]], i32 31, i32 1)
93 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
95 uint64_t test_svqinch_n_u64(uint64_t op) MODE_ATTR
97 return SVE_ACLE_FUNC(svqinch,_n_u64,,)(op, 1);
100 // CHECK-LABEL: @test_svqinch_pat_n_s32(
101 // CHECK-NEXT: entry:
102 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqinch.n32(i32 [[OP:%.*]], i32 30, i32 16)
103 // CHECK-NEXT: ret i32 [[TMP0]]
105 // CPP-CHECK-LABEL: @_Z22test_svqinch_pat_n_s32i(
106 // CPP-CHECK-NEXT: entry:
107 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqinch.n32(i32 [[OP:%.*]], i32 30, i32 16)
108 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
110 int32_t test_svqinch_pat_n_s32(int32_t op) MODE_ATTR
112 return SVE_ACLE_FUNC(svqinch_pat,_n_s32,,)(op, SV_MUL3, 16);
115 // CHECK-LABEL: @test_svqinch_pat_n_s64(
116 // CHECK-NEXT: entry:
117 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqinch.n64(i64 [[OP:%.*]], i32 31, i32 1)
118 // CHECK-NEXT: ret i64 [[TMP0]]
120 // CPP-CHECK-LABEL: @_Z22test_svqinch_pat_n_s64l(
121 // CPP-CHECK-NEXT: entry:
122 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqinch.n64(i64 [[OP:%.*]], i32 31, i32 1)
123 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
125 int64_t test_svqinch_pat_n_s64(int64_t op) MODE_ATTR
127 return SVE_ACLE_FUNC(svqinch_pat,_n_s64,,)(op, SV_ALL, 1);
130 // CHECK-LABEL: @test_svqinch_pat_n_u32(
131 // CHECK-NEXT: entry:
132 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqinch.n32(i32 [[OP:%.*]], i32 0, i32 16)
133 // CHECK-NEXT: ret i32 [[TMP0]]
135 // CPP-CHECK-LABEL: @_Z22test_svqinch_pat_n_u32j(
136 // CPP-CHECK-NEXT: entry:
137 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqinch.n32(i32 [[OP:%.*]], i32 0, i32 16)
138 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
140 uint32_t test_svqinch_pat_n_u32(uint32_t op) MODE_ATTR
142 return SVE_ACLE_FUNC(svqinch_pat,_n_u32,,)(op, SV_POW2, 16);
145 // CHECK-LABEL: @test_svqinch_pat_n_u64(
146 // CHECK-NEXT: entry:
147 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqinch.n64(i64 [[OP:%.*]], i32 1, i32 1)
148 // CHECK-NEXT: ret i64 [[TMP0]]
150 // CPP-CHECK-LABEL: @_Z22test_svqinch_pat_n_u64m(
151 // CPP-CHECK-NEXT: entry:
152 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqinch.n64(i64 [[OP:%.*]], i32 1, i32 1)
153 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
155 uint64_t test_svqinch_pat_n_u64(uint64_t op) MODE_ATTR
157 return SVE_ACLE_FUNC(svqinch_pat,_n_u64,,)(op, SV_VL1, 1);
160 // CHECK-LABEL: @test_svqinch_s16(
161 // CHECK-NEXT: entry:
162 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 16)
163 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
165 // CPP-CHECK-LABEL: @_Z16test_svqinch_s16u11__SVInt16_t(
166 // CPP-CHECK-NEXT: entry:
167 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 16)
168 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
170 svint16_t test_svqinch_s16(svint16_t op) MODE_ATTR
172 return SVE_ACLE_FUNC(svqinch,_s16,,)(op, 16);
175 // CHECK-LABEL: @test_svqinch_u16(
176 // CHECK-NEXT: entry:
177 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 1)
178 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
180 // CPP-CHECK-LABEL: @_Z16test_svqinch_u16u12__SVUint16_t(
181 // CPP-CHECK-NEXT: entry:
182 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 1)
183 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
185 svuint16_t test_svqinch_u16(svuint16_t op) MODE_ATTR
187 return SVE_ACLE_FUNC(svqinch,_u16,,)(op, 1);
190 // CHECK-LABEL: @test_svqinch_pat_s16(
191 // CHECK-NEXT: entry:
192 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 2, i32 16)
193 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
195 // CPP-CHECK-LABEL: @_Z20test_svqinch_pat_s16u11__SVInt16_t(
196 // CPP-CHECK-NEXT: entry:
197 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 2, i32 16)
198 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
200 svint16_t test_svqinch_pat_s16(svint16_t op) MODE_ATTR
202 return SVE_ACLE_FUNC(svqinch_pat,_s16,,)(op, SV_VL2, 16);
205 // CHECK-LABEL: @test_svqinch_pat_u16(
206 // CHECK-NEXT: entry:
207 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 3, i32 1)
208 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
210 // CPP-CHECK-LABEL: @_Z20test_svqinch_pat_u16u12__SVUint16_t(
211 // CPP-CHECK-NEXT: entry:
212 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqinch.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 3, i32 1)
213 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
215 svuint16_t test_svqinch_pat_u16(svuint16_t op) MODE_ATTR
217 return SVE_ACLE_FUNC(svqinch_pat,_u16,,)(op, SV_VL3, 1);