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_svcmpne_s8(svbool_t pg,svint8_t op1,svint8_t op2)16 svbool_t test_svcmpne_s8(svbool_t pg, svint8_t op1, svint8_t op2)
17 {
18   // CHECK-LABEL: test_svcmpne_s8
19   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
20   // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
21   return SVE_ACLE_FUNC(svcmpne,_s8,,)(pg, op1, op2);
22 }
23 
test_svcmpne_s16(svbool_t pg,svint16_t op1,svint16_t op2)24 svbool_t test_svcmpne_s16(svbool_t pg, svint16_t op1, svint16_t op2)
25 {
26   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
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(svcmpne,_s16,,)(pg, op1, op2);
32 }
33 
test_svcmpne_s32(svbool_t pg,svint32_t op1,svint32_t op2)34 svbool_t test_svcmpne_s32(svbool_t pg, svint32_t op1, svint32_t op2)
35 {
36   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
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(svcmpne,_s32,,)(pg, op1, op2);
42 }
43 
test_svcmpne_s64(svbool_t pg,svint64_t op1,svint64_t op2)44 svbool_t test_svcmpne_s64(svbool_t pg, svint64_t op1, svint64_t op2)
45 {
46   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
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(svcmpne,_s64,,)(pg, op1, op2);
52 }
53 
test_svcmpne_u8(svbool_t pg,svuint8_t op1,svuint8_t op2)54 svbool_t test_svcmpne_u8(svbool_t pg, svuint8_t op1, svuint8_t op2)
55 {
56   // CHECK-LABEL: test_svcmpne_u8
57   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2)
58   // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
59   return SVE_ACLE_FUNC(svcmpne,_u8,,)(pg, op1, op2);
60 }
61 
test_svcmpne_u16(svbool_t pg,svuint16_t op1,svuint16_t op2)62 svbool_t test_svcmpne_u16(svbool_t pg, svuint16_t op1, svuint16_t op2)
63 {
64   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
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(svcmpne,_u16,,)(pg, op1, op2);
70 }
71 
test_svcmpne_u32(svbool_t pg,svuint32_t op1,svuint32_t op2)72 svbool_t test_svcmpne_u32(svbool_t pg, svuint32_t op1, svuint32_t op2)
73 {
74   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
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(svcmpne,_u32,,)(pg, op1, op2);
80 }
81 
test_svcmpne_u64(svbool_t pg,svuint64_t op1,svuint64_t op2)82 svbool_t test_svcmpne_u64(svbool_t pg, svuint64_t op1, svuint64_t op2)
83 {
84   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
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(svcmpne,_u64,,)(pg, op1, op2);
90 }
91 
test_svcmpne_n_s64(svbool_t pg,svint64_t op1,int64_t op2)92 svbool_t test_svcmpne_n_s64(svbool_t pg, svint64_t op1, int64_t op2)
93 {
94   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
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(svcmpne,_n_s64,,)(pg, op1, op2);
101 }
102 
test_svcmpne_n_u64(svbool_t pg,svuint64_t op1,uint64_t op2)103 svbool_t test_svcmpne_n_u64(svbool_t pg, svuint64_t op1, uint64_t op2)
104 {
105   // CHECK-LABEL: test_svcmpne_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.cmpne.nxv2i64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
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(svcmpne,_n_u64,,)(pg, op1, op2);
112 }
113 
test_svcmpne_wide_s8(svbool_t pg,svint8_t op1,svint64_t op2)114 svbool_t test_svcmpne_wide_s8(svbool_t pg, svint8_t op1, svint64_t op2)
115 {
116   // CHECK-LABEL: test_svcmpne_wide_s8
117   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.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(svcmpne_wide,_s8,,)(pg, op1, op2);
120 }
121 
test_svcmpne_wide_s16(svbool_t pg,svint16_t op1,svint64_t op2)122 svbool_t test_svcmpne_wide_s16(svbool_t pg, svint16_t op1, svint64_t op2)
123 {
124   // CHECK-LABEL: test_svcmpne_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.cmpne.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(svcmpne_wide,_s16,,)(pg, op1, op2);
130 }
131 
test_svcmpne_wide_s32(svbool_t pg,svint32_t op1,svint64_t op2)132 svbool_t test_svcmpne_wide_s32(svbool_t pg, svint32_t op1, svint64_t op2)
133 {
134   // CHECK-LABEL: test_svcmpne_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.cmpne.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(svcmpne_wide,_s32,,)(pg, op1, op2);
140 }
141 
test_svcmpne_n_s8(svbool_t pg,svint8_t op1,int8_t op2)142 svbool_t test_svcmpne_n_s8(svbool_t pg, svint8_t op1, int8_t op2)
143 {
144   // CHECK-LABEL: test_svcmpne_n_s8
145   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
146   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
147   // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
148   return SVE_ACLE_FUNC(svcmpne,_n_s8,,)(pg, op1, op2);
149 }
150 
test_svcmpne_n_s16(svbool_t pg,svint16_t op1,int16_t op2)151 svbool_t test_svcmpne_n_s16(svbool_t pg, svint16_t op1, int16_t op2)
152 {
153   // CHECK-LABEL: test_svcmpne_n_s16
154   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
155   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
156   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmpne.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
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(svcmpne,_n_s16,,)(pg, op1, op2);
160 }
161 
test_svcmpne_n_s32(svbool_t pg,svint32_t op1,int32_t op2)162 svbool_t test_svcmpne_n_s32(svbool_t pg, svint32_t op1, int32_t op2)
163 {
164   // CHECK-LABEL: test_svcmpne_n_s32
165   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
166   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
167   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmpne.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
168   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
169   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
170   return SVE_ACLE_FUNC(svcmpne,_n_s32,,)(pg, op1, op2);
171 }
172 
test_svcmpne_n_u8(svbool_t pg,svuint8_t op1,uint8_t op2)173 svbool_t test_svcmpne_n_u8(svbool_t pg, svuint8_t op1, uint8_t op2)
174 {
175   // CHECK-LABEL: test_svcmpne_n_u8
176   // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op2)
177   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 16 x i8> %[[DUP]])
178   // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
179   return SVE_ACLE_FUNC(svcmpne,_n_u8,,)(pg, op1, op2);
180 }
181 
test_svcmpne_n_u16(svbool_t pg,svuint16_t op1,uint16_t op2)182 svbool_t test_svcmpne_n_u16(svbool_t pg, svuint16_t op1, uint16_t op2)
183 {
184   // CHECK-LABEL: test_svcmpne_n_u16
185   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
186   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
187   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmpne.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
188   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
189   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
190   return SVE_ACLE_FUNC(svcmpne,_n_u16,,)(pg, op1, op2);
191 }
192 
test_svcmpne_n_u32(svbool_t pg,svuint32_t op1,uint32_t op2)193 svbool_t test_svcmpne_n_u32(svbool_t pg, svuint32_t op1, uint32_t op2)
194 {
195   // CHECK-LABEL: test_svcmpne_n_u32
196   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
197   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
198   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmpne.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
199   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
200   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
201   return SVE_ACLE_FUNC(svcmpne,_n_u32,,)(pg, op1, op2);
202 }
203 
test_svcmpne_f16(svbool_t pg,svfloat16_t op1,svfloat16_t op2)204 svbool_t test_svcmpne_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
205 {
206   // CHECK-LABEL: test_svcmpne_f16
207   // CHECK: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
208   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.fcmpne.nxv8f16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x half> %op1, <vscale x 8 x half> %op2)
209   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
210   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
211   return SVE_ACLE_FUNC(svcmpne,_f16,,)(pg, op1, op2);
212 }
213 
test_svcmpne_f32(svbool_t pg,svfloat32_t op1,svfloat32_t op2)214 svbool_t test_svcmpne_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
215 {
216   // CHECK-LABEL: test_svcmpne_f32
217   // CHECK: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
218   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpne.nxv4f32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x float> %op1, <vscale x 4 x float> %op2)
219   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
220   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
221   return SVE_ACLE_FUNC(svcmpne,_f32,,)(pg, op1, op2);
222 }
223 
test_svcmpne_f64(svbool_t pg,svfloat64_t op1,svfloat64_t op2)224 svbool_t test_svcmpne_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
225 {
226   // CHECK-LABEL: test_svcmpne_f64
227   // CHECK: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
228   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.fcmpne.nxv2f64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x double> %op1, <vscale x 2 x double> %op2)
229   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
230   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
231   return SVE_ACLE_FUNC(svcmpne,_f64,,)(pg, op1, op2);
232 }
233 
test_svcmpne_n_f16(svbool_t pg,svfloat16_t op1,float16_t op2)234 svbool_t test_svcmpne_n_f16(svbool_t pg, svfloat16_t op1, float16_t op2)
235 {
236   // CHECK-LABEL: test_svcmpne_n_f16
237   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
238   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 8 x half> @llvm.aarch64.sve.dup.x.nxv8f16(half %op2)
239   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.fcmpne.nxv8f16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x half> %op1, <vscale x 8 x half> %[[DUP]])
240   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
241   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
242   return SVE_ACLE_FUNC(svcmpne,_n_f16,,)(pg, op1, op2);
243 }
244 
test_svcmpne_n_f32(svbool_t pg,svfloat32_t op1,float32_t op2)245 svbool_t test_svcmpne_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2)
246 {
247   // CHECK-LABEL: test_svcmpne_n_f32
248   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
249   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 4 x float> @llvm.aarch64.sve.dup.x.nxv4f32(float %op2)
250   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpne.nxv4f32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x float> %op1, <vscale x 4 x float> %[[DUP]])
251   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
252   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
253   return SVE_ACLE_FUNC(svcmpne,_n_f32,,)(pg, op1, op2);
254 }
255 
test_svcmpne_n_f64(svbool_t pg,svfloat64_t op1,float64_t op2)256 svbool_t test_svcmpne_n_f64(svbool_t pg, svfloat64_t op1, float64_t op2)
257 {
258   // CHECK-LABEL: test_svcmpne_n_f64
259   // CHECK-DAG: %[[PG:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> %pg)
260   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x double> @llvm.aarch64.sve.dup.x.nxv2f64(double %op2)
261   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i1> @llvm.aarch64.sve.fcmpne.nxv2f64(<vscale x 2 x i1> %[[PG]], <vscale x 2 x double> %op1, <vscale x 2 x double> %[[DUP]])
262   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> %[[INTRINSIC]])
263   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
264   return SVE_ACLE_FUNC(svcmpne,_n_f64,,)(pg, op1, op2);
265 }
266 
test_svcmpne_wide_n_s8(svbool_t pg,svint8_t op1,int64_t op2)267 svbool_t test_svcmpne_wide_n_s8(svbool_t pg, svint8_t op1, int64_t op2)
268 {
269   // CHECK-LABEL: test_svcmpne_wide_n_s8
270   // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
271   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.wide.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %op1, <vscale x 2 x i64> %[[DUP]])
272   // CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
273   return SVE_ACLE_FUNC(svcmpne_wide,_n_s8,,)(pg, op1, op2);
274 }
275 
test_svcmpne_wide_n_s16(svbool_t pg,svint16_t op1,int64_t op2)276 svbool_t test_svcmpne_wide_n_s16(svbool_t pg, svint16_t op1, int64_t op2)
277 {
278   // CHECK-LABEL: test_svcmpne_wide_n_s16
279   // CHECK-DAG: %[[PG:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> %pg)
280   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
281   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i1> @llvm.aarch64.sve.cmpne.wide.nxv8i16(<vscale x 8 x i1> %[[PG]], <vscale x 8 x i16> %op1, <vscale x 2 x i64> %[[DUP]])
282   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %[[INTRINSIC]])
283   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
284   return SVE_ACLE_FUNC(svcmpne_wide,_n_s16,,)(pg, op1, op2);
285 }
286 
test_svcmpne_wide_n_s32(svbool_t pg,svint32_t op1,int64_t op2)287 svbool_t test_svcmpne_wide_n_s32(svbool_t pg, svint32_t op1, int64_t op2)
288 {
289   // CHECK-LABEL: test_svcmpne_wide_n_s32
290   // CHECK-DAG: %[[PG:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
291   // CHECK-DAG: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
292   // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i1> @llvm.aarch64.sve.cmpne.wide.nxv4i32(<vscale x 4 x i1> %[[PG]], <vscale x 4 x i32> %op1, <vscale x 2 x i64> %[[DUP]])
293   // CHECK: %[[CAST:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %[[INTRINSIC]])
294   // CHECK: ret <vscale x 16 x i1> %[[CAST]]
295   return SVE_ACLE_FUNC(svcmpne_wide,_n_s32,,)(pg, op1, op2);
296 }
297