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