1 // REQUIRES: aarch64-registered-target
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -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 -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s
4 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -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 +sve -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s
6 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O1 -Werror -o - %s >/dev/null
7 #include <arm_sve.h>
8
9 #ifdef SVE_OVERLOADED_FORMS
10 // A simple used,unused... macro, long enough to represent any SVE builtin.
11 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
12 #else
13 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
14 #endif
15
test_svcmple_s8(svbool_t pg,svint8_t op1,svint8_t op2)16 svbool_t test_svcmple_s8(svbool_t pg, svint8_t op1, svint8_t op2)
17 {
18 // CHECK-LABEL: test_svcmple_s8
19 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpge.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op2, <vscale x 16 x i8> %op1)
20 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
21 return SVE_ACLE_FUNC(svcmple,_s8,,)(pg, op1, op2);
22 }
23
test_svcmple_s16(svbool_t pg,svint16_t op1,svint16_t op2)24 svbool_t test_svcmple_s16(svbool_t pg, svint16_t op1, svint16_t op2)
25 {
26 // CHECK-LABEL: test_svcmple_s16
27 // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
28 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmpge.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op1)
29 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
30 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
31 return SVE_ACLE_FUNC(svcmple,_s16,,)(pg, op1, op2);
32 }
33
test_svcmple_s32(svbool_t pg,svint32_t op1,svint32_t op2)34 svbool_t test_svcmple_s32(svbool_t pg, svint32_t op1, svint32_t op2)
35 {
36 // CHECK-LABEL: test_svcmple_s32
37 // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
38 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op1)
39 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
40 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
41 return SVE_ACLE_FUNC(svcmple,_s32,,)(pg, op1, op2);
42 }
43
test_svcmple_s64(svbool_t pg,svint64_t op1,svint64_t op2)44 svbool_t test_svcmple_s64(svbool_t pg, svint64_t op1, svint64_t op2)
45 {
46 // CHECK-LABEL: test_svcmple_s64
47 // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
48 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.cmpge.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op1)
49 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
50 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
51 return SVE_ACLE_FUNC(svcmple,_s64,,)(pg, op1, op2);
52 }
53
test_svcmple_u8(svbool_t pg,svuint8_t op1,svuint8_t op2)54 svbool_t test_svcmple_u8(svbool_t pg, svuint8_t op1, svuint8_t op2)
55 {
56 // CHECK-LABEL: test_svcmple_u8
57 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmphs.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op2, <vscale x 16 x i8> %op1)
58 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
59 return SVE_ACLE_FUNC(svcmple,_u8,,)(pg, op1, op2);
60 }
61
test_svcmple_u16(svbool_t pg,svuint16_t op1,svuint16_t op2)62 svbool_t test_svcmple_u16(svbool_t pg, svuint16_t op1, svuint16_t op2)
63 {
64 // CHECK-LABEL: test_svcmple_u16
65 // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
66 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmphs.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op1)
67 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
68 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
69 return SVE_ACLE_FUNC(svcmple,_u16,,)(pg, op1, op2);
70 }
71
test_svcmple_u32(svbool_t pg,svuint32_t op1,svuint32_t op2)72 svbool_t test_svcmple_u32(svbool_t pg, svuint32_t op1, svuint32_t op2)
73 {
74 // CHECK-LABEL: test_svcmple_u32
75 // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
76 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmphs.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op1)
77 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
78 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
79 return SVE_ACLE_FUNC(svcmple,_u32,,)(pg, op1, op2);
80 }
81
test_svcmple_u64(svbool_t pg,svuint64_t op1,svuint64_t op2)82 svbool_t test_svcmple_u64(svbool_t pg, svuint64_t op1, svuint64_t op2)
83 {
84 // CHECK-LABEL: test_svcmple_u64
85 // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
86 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.cmphs.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op1)
87 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
88 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
89 return SVE_ACLE_FUNC(svcmple,_u64,,)(pg, op1, op2);
90 }
91
test_svcmple_n_s64(svbool_t pg,svint64_t op1,int64_t op2)92 svbool_t test_svcmple_n_s64(svbool_t pg, svint64_t op1, int64_t op2)
93 {
94 // CHECK-LABEL: test_svcmple_n_s64
95 // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
96 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
97 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.cmpge.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[DUP]], <vscale x 2 x i64> %op1)
98 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
99 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
100 return SVE_ACLE_FUNC(svcmple,_n_s64,,)(pg, op1, op2);
101 }
102
test_svcmple_n_u64(svbool_t pg,svuint64_t op1,uint64_t op2)103 svbool_t test_svcmple_n_u64(svbool_t pg, svuint64_t op1, uint64_t op2)
104 {
105 // CHECK-LABEL: test_svcmple_n_u64
106 // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
107 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
108 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.cmphs.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %[[DUP]], <vscale x 2 x i64> %op1)
109 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
110 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
111 return SVE_ACLE_FUNC(svcmple,_n_u64,,)(pg, op1, op2);
112 }
113
test_svcmple_wide_s8(svbool_t pg,svint8_t op1,svint64_t op2)114 svbool_t test_svcmple_wide_s8(svbool_t pg, svint8_t op1, svint64_t op2)
115 {
116 // CHECK-LABEL: test_svcmple_wide_s8
117 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmple.wide.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 2 x i64> %op2)
118 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
119 return SVE_ACLE_FUNC(svcmple_wide,_s8,,)(pg, op1, op2);
120 }
121
test_svcmple_wide_s16(svbool_t pg,svint16_t op1,svint64_t op2)122 svbool_t test_svcmple_wide_s16(svbool_t pg, svint16_t op1, svint64_t op2)
123 {
124 // CHECK-LABEL: test_svcmple_wide_s16
125 // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
126 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmple.wide.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 2 x i64> %op2)
127 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
128 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
129 return SVE_ACLE_FUNC(svcmple_wide,_s16,,)(pg, op1, op2);
130 }
131
test_svcmple_wide_s32(svbool_t pg,svint32_t op1,svint64_t op2)132 svbool_t test_svcmple_wide_s32(svbool_t pg, svint32_t op1, svint64_t op2)
133 {
134 // CHECK-LABEL: test_svcmple_wide_s32
135 // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
136 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmple.wide.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2)
137 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
138 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
139 return SVE_ACLE_FUNC(svcmple_wide,_s32,,)(pg, op1, op2);
140 }
141
test_svcmple_wide_u8(svbool_t pg,svuint8_t op1,svuint64_t op2)142 svbool_t test_svcmple_wide_u8(svbool_t pg, svuint8_t op1, svuint64_t op2)
143 {
144 // CHECK-LABEL: test_svcmple_wide_u8
145 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpls.wide.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 2 x i64> %op2)
146 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
147 return SVE_ACLE_FUNC(svcmple_wide,_u8,,)(pg, op1, op2);
148 }
149
test_svcmple_wide_u16(svbool_t pg,svuint16_t op1,svuint64_t op2)150 svbool_t test_svcmple_wide_u16(svbool_t pg, svuint16_t op1, svuint64_t op2)
151 {
152 // CHECK-LABEL: test_svcmple_wide_u16
153 // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
154 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmpls.wide.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 2 x i64> %op2)
155 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
156 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
157 return SVE_ACLE_FUNC(svcmple_wide,_u16,,)(pg, op1, op2);
158 }
159
test_svcmple_wide_u32(svbool_t pg,svuint32_t op1,svuint64_t op2)160 svbool_t test_svcmple_wide_u32(svbool_t pg, svuint32_t op1, svuint64_t op2)
161 {
162 // CHECK-LABEL: test_svcmple_wide_u32
163 // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
164 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmpls.wide.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2)
165 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
166 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
167 return SVE_ACLE_FUNC(svcmple_wide,_u32,,)(pg, op1, op2);
168 }
169
test_svcmple_n_s8(svbool_t pg,svint8_t op1,int8_t op2)170 svbool_t test_svcmple_n_s8(svbool_t pg, svint8_t op1, int8_t op2)
171 {
172 // CHECK-LABEL: test_svcmple_n_s8
173 // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
174 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpge.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[DUP]], <vscale x 16 x i8> %op1)
175 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
176 return SVE_ACLE_FUNC(svcmple,_n_s8,,)(pg, op1, op2);
177 }
178
test_svcmple_n_s16(svbool_t pg,svint16_t op1,int16_t op2)179 svbool_t test_svcmple_n_s16(svbool_t pg, svint16_t op1, int16_t op2)
180 {
181 // CHECK-LABEL: test_svcmple_n_s16
182 // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
183 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
184 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmpge.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[DUP]], <vscale x 8 x i16> %op1)
185 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
186 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
187 return SVE_ACLE_FUNC(svcmple,_n_s16,,)(pg, op1, op2);
188 }
189
test_svcmple_n_s32(svbool_t pg,svint32_t op1,int32_t op2)190 svbool_t test_svcmple_n_s32(svbool_t pg, svint32_t op1, int32_t op2)
191 {
192 // CHECK-LABEL: test_svcmple_n_s32
193 // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
194 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
195 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[DUP]], <vscale x 4 x i32> %op1)
196 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
197 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
198 return SVE_ACLE_FUNC(svcmple,_n_s32,,)(pg, op1, op2);
199 }
200
test_svcmple_n_u8(svbool_t pg,svuint8_t op1,uint8_t op2)201 svbool_t test_svcmple_n_u8(svbool_t pg, svuint8_t op1, uint8_t op2)
202 {
203 // CHECK-LABEL: test_svcmple_n_u8
204 // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
205 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmphs.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %[[DUP]], <vscale x 16 x i8> %op1)
206 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
207 return SVE_ACLE_FUNC(svcmple,_n_u8,,)(pg, op1, op2);
208 }
209
test_svcmple_n_u16(svbool_t pg,svuint16_t op1,uint16_t op2)210 svbool_t test_svcmple_n_u16(svbool_t pg, svuint16_t op1, uint16_t op2)
211 {
212 // CHECK-LABEL: test_svcmple_n_u16
213 // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
214 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
215 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmphs.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %[[DUP]], <vscale x 8 x i16> %op1)
216 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
217 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
218 return SVE_ACLE_FUNC(svcmple,_n_u16,,)(pg, op1, op2);
219 }
220
test_svcmple_n_u32(svbool_t pg,svuint32_t op1,uint32_t op2)221 svbool_t test_svcmple_n_u32(svbool_t pg, svuint32_t op1, uint32_t op2)
222 {
223 // CHECK-LABEL: test_svcmple_n_u32
224 // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
225 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
226 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmphs.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %[[DUP]], <vscale x 4 x i32> %op1)
227 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
228 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
229 return SVE_ACLE_FUNC(svcmple,_n_u32,,)(pg, op1, op2);
230 }
231
test_svcmple_f16(svbool_t pg,svfloat16_t op1,svfloat16_t op2)232 svbool_t test_svcmple_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
233 {
234 // CHECK-LABEL: test_svcmple_f16
235 // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
236 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.fcmpge.nxv8f16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x half> %op2, <vscale x 8 x half> %op1)
237 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
238 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
239 return SVE_ACLE_FUNC(svcmple,_f16,,)(pg, op1, op2);
240 }
241
test_svcmple_f32(svbool_t pg,svfloat32_t op1,svfloat32_t op2)242 svbool_t test_svcmple_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
243 {
244 // CHECK-LABEL: test_svcmple_f32
245 // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
246 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpge.nxv4f32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x float> %op2, <vscale x 4 x float> %op1)
247 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
248 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
249 return SVE_ACLE_FUNC(svcmple,_f32,,)(pg, op1, op2);
250 }
251
test_svcmple_f64(svbool_t pg,svfloat64_t op1,svfloat64_t op2)252 svbool_t test_svcmple_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
253 {
254 // CHECK-LABEL: test_svcmple_f64
255 // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
256 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.fcmpge.nxv2f64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x double> %op2, <vscale x 2 x double> %op1)
257 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
258 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
259 return SVE_ACLE_FUNC(svcmple,_f64,,)(pg, op1, op2);
260 }
261
test_svcmple_n_f16(svbool_t pg,svfloat16_t op1,float16_t op2)262 svbool_t test_svcmple_n_f16(svbool_t pg, svfloat16_t op1, float16_t op2)
263 {
264 // CHECK-LABEL: test_svcmple_n_f16
265 // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
266 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.dup.x.nxv8f16(half %op2)
267 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.fcmpge.nxv8f16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x half> %[[DUP]], <vscale x 8 x half> %op1)
268 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
269 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
270 return SVE_ACLE_FUNC(svcmple,_n_f16,,)(pg, op1, op2);
271 }
272
test_svcmple_n_f32(svbool_t pg,svfloat32_t op1,float32_t op2)273 svbool_t test_svcmple_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2)
274 {
275 // CHECK-LABEL: test_svcmple_n_f32
276 // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
277 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.dup.x.nxv4f32(float %op2)
278 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpge.nxv4f32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x float> %[[DUP]], <vscale x 4 x float> %op1)
279 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
280 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
281 return SVE_ACLE_FUNC(svcmple,_n_f32,,)(pg, op1, op2);
282 }
283
test_svcmple_n_f64(svbool_t pg,svfloat64_t op1,float64_t op2)284 svbool_t test_svcmple_n_f64(svbool_t pg, svfloat64_t op1, float64_t op2)
285 {
286 // CHECK-LABEL: test_svcmple_n_f64
287 // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
288 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.dup.x.nxv2f64(double %op2)
289 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.fcmpge.nxv2f64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x double> %[[DUP]], <vscale x 2 x double> %op1)
290 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
291 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
292 return SVE_ACLE_FUNC(svcmple,_n_f64,,)(pg, op1, op2);
293 }
294
test_svcmple_wide_n_s8(svbool_t pg,svint8_t op1,int64_t op2)295 svbool_t test_svcmple_wide_n_s8(svbool_t pg, svint8_t op1, int64_t op2)
296 {
297 // CHECK-LABEL: test_svcmple_wide_n_s8
298 // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
299 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmple.wide.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 2 x i64> %[[DUP]])
300 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
301 return SVE_ACLE_FUNC(svcmple_wide,_n_s8,,)(pg, op1, op2);
302 }
303
test_svcmple_wide_n_s16(svbool_t pg,svint16_t op1,int64_t op2)304 svbool_t test_svcmple_wide_n_s16(svbool_t pg, svint16_t op1, int64_t op2)
305 {
306 // CHECK-LABEL: test_svcmple_wide_n_s16
307 // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
308 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
309 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmple.wide.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 2 x i64> %[[DUP]])
310 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
311 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
312 return SVE_ACLE_FUNC(svcmple_wide,_n_s16,,)(pg, op1, op2);
313 }
314
test_svcmple_wide_n_s32(svbool_t pg,svint32_t op1,int64_t op2)315 svbool_t test_svcmple_wide_n_s32(svbool_t pg, svint32_t op1, int64_t op2)
316 {
317 // CHECK-LABEL: test_svcmple_wide_n_s32
318 // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
319 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
320 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmple.wide.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 2 x i64> %[[DUP]])
321 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
322 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
323 return SVE_ACLE_FUNC(svcmple_wide,_n_s32,,)(pg, op1, op2);
324 }
325
test_svcmple_wide_n_u8(svbool_t pg,svuint8_t op1,uint64_t op2)326 svbool_t test_svcmple_wide_n_u8(svbool_t pg, svuint8_t op1, uint64_t op2)
327 {
328 // CHECK-LABEL: test_svcmple_wide_n_u8
329 // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
330 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpls.wide.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 2 x i64> %[[DUP]])
331 // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
332 return SVE_ACLE_FUNC(svcmple_wide,_n_u8,,)(pg, op1, op2);
333 }
334
test_svcmple_wide_n_u16(svbool_t pg,svuint16_t op1,uint64_t op2)335 svbool_t test_svcmple_wide_n_u16(svbool_t pg, svuint16_t op1, uint64_t op2)
336 {
337 // CHECK-LABEL: test_svcmple_wide_n_u16
338 // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
339 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
340 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmpls.wide.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 2 x i64> %[[DUP]])
341 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
342 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
343 return SVE_ACLE_FUNC(svcmple_wide,_n_u16,,)(pg, op1, op2);
344 }
345
test_svcmple_wide_n_u32(svbool_t pg,svuint32_t op1,uint64_t op2)346 svbool_t test_svcmple_wide_n_u32(svbool_t pg, svuint32_t op1, uint64_t op2)
347 {
348 // CHECK-LABEL: test_svcmple_wide_n_u32
349 // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
350 // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
351 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmpls.wide.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 2 x i64> %[[DUP]])
352 // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
353 // CHECK: ret <vscale x 16 x i1> %[[CAST]]
354 return SVE_ACLE_FUNC(svcmple_wide,_n_u32,,)(pg, op1, op2);
355 }
356