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