| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -O0 -disable-O0-optnone -DPOLYMORPHIC -emit-llvm -o - %s | opt -S -passes='mem2reg,sroa,early-cse<>' | FileCheck %s |
| 4 |
|
| 5 |
// REQUIRES: aarch64-registered-target || arm-registered-target |
| 6 |
|
| 7 |
#include <arm_mve.h> |
| 8 |
|
| 9 |
// CHECK-LABEL: @test_vrndaq_f16( |
| 10 |
// CHECK-NEXT: entry: |
| 11 |
// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.round.v8f16(<8 x half> [[A:%.*]]) |
| 12 |
// CHECK-NEXT: ret <8 x half> [[TMP0]] |
| 13 |
// |
| 14 |
float16x8_t test_vrndaq_f16(float16x8_t a) |
| 15 |
{ |
| 16 |
#ifdef POLYMORPHIC |
| 17 |
return vrndaq(a); |
| 18 |
#else /* POLYMORPHIC */ |
| 19 |
return vrndaq_f16(a); |
| 20 |
#endif /* POLYMORPHIC */ |
| 21 |
} |
| 22 |
|
| 23 |
// CHECK-LABEL: @test_vrndaq_f32( |
| 24 |
// CHECK-NEXT: entry: |
| 25 |
// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.round.v4f32(<4 x float> [[A:%.*]]) |
| 26 |
// CHECK-NEXT: ret <4 x float> [[TMP0]] |
| 27 |
// |
| 28 |
float32x4_t test_vrndaq_f32(float32x4_t a) |
| 29 |
{ |
| 30 |
#ifdef POLYMORPHIC |
| 31 |
return vrndaq(a); |
| 32 |
#else /* POLYMORPHIC */ |
| 33 |
return vrndaq_f32(a); |
| 34 |
#endif /* POLYMORPHIC */ |
| 35 |
} |
| 36 |
|
| 37 |
// CHECK-LABEL: @test_vrndmq_f16( |
| 38 |
// CHECK-NEXT: entry: |
| 39 |
// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.floor.v8f16(<8 x half> [[A:%.*]]) |
| 40 |
// CHECK-NEXT: ret <8 x half> [[TMP0]] |
| 41 |
// |
| 42 |
float16x8_t test_vrndmq_f16(float16x8_t a) |
| 43 |
{ |
| 44 |
#ifdef POLYMORPHIC |
| 45 |
return vrndmq(a); |
| 46 |
#else /* POLYMORPHIC */ |
| 47 |
return vrndmq_f16(a); |
| 48 |
#endif /* POLYMORPHIC */ |
| 49 |
} |
| 50 |
|
| 51 |
// CHECK-LABEL: @test_vrndmq_f32( |
| 52 |
// CHECK-NEXT: entry: |
| 53 |
// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.floor.v4f32(<4 x float> [[A:%.*]]) |
| 54 |
// CHECK-NEXT: ret <4 x float> [[TMP0]] |
| 55 |
// |
| 56 |
float32x4_t test_vrndmq_f32(float32x4_t a) |
| 57 |
{ |
| 58 |
#ifdef POLYMORPHIC |
| 59 |
return vrndmq(a); |
| 60 |
#else /* POLYMORPHIC */ |
| 61 |
return vrndmq_f32(a); |
| 62 |
#endif /* POLYMORPHIC */ |
| 63 |
} |
| 64 |
|
| 65 |
// CHECK-LABEL: @test_vrndpq_f16( |
| 66 |
// CHECK-NEXT: entry: |
| 67 |
// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.ceil.v8f16(<8 x half> [[A:%.*]]) |
| 68 |
// CHECK-NEXT: ret <8 x half> [[TMP0]] |
| 69 |
// |
| 70 |
float16x8_t test_vrndpq_f16(float16x8_t a) |
| 71 |
{ |
| 72 |
#ifdef POLYMORPHIC |
| 73 |
return vrndpq(a); |
| 74 |
#else /* POLYMORPHIC */ |
| 75 |
return vrndpq_f16(a); |
| 76 |
#endif /* POLYMORPHIC */ |
| 77 |
} |
| 78 |
|
| 79 |
// CHECK-LABEL: @test_vrndpq_f32( |
| 80 |
// CHECK-NEXT: entry: |
| 81 |
// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.ceil.v4f32(<4 x float> [[A:%.*]]) |
| 82 |
// CHECK-NEXT: ret <4 x float> [[TMP0]] |
| 83 |
// |
| 84 |
float32x4_t test_vrndpq_f32(float32x4_t a) |
| 85 |
{ |
| 86 |
#ifdef POLYMORPHIC |
| 87 |
return vrndpq(a); |
| 88 |
#else /* POLYMORPHIC */ |
| 89 |
return vrndpq_f32(a); |
| 90 |
#endif /* POLYMORPHIC */ |
| 91 |
} |
| 92 |
|
| 93 |
// CHECK-LABEL: @test_vrndq_f16( |
| 94 |
// CHECK-NEXT: entry: |
| 95 |
// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.trunc.v8f16(<8 x half> [[A:%.*]]) |
| 96 |
// CHECK-NEXT: ret <8 x half> [[TMP0]] |
| 97 |
// |
| 98 |
float16x8_t test_vrndq_f16(float16x8_t a) |
| 99 |
{ |
| 100 |
#ifdef POLYMORPHIC |
| 101 |
return vrndq(a); |
| 102 |
#else /* POLYMORPHIC */ |
| 103 |
return vrndq_f16(a); |
| 104 |
#endif /* POLYMORPHIC */ |
| 105 |
} |
| 106 |
|
| 107 |
// CHECK-LABEL: @test_vrndq_f32( |
| 108 |
// CHECK-NEXT: entry: |
| 109 |
// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.trunc.v4f32(<4 x float> [[A:%.*]]) |
| 110 |
// CHECK-NEXT: ret <4 x float> [[TMP0]] |
| 111 |
// |
| 112 |
float32x4_t test_vrndq_f32(float32x4_t a) |
| 113 |
{ |
| 114 |
#ifdef POLYMORPHIC |
| 115 |
return vrndq(a); |
| 116 |
#else /* POLYMORPHIC */ |
| 117 |
return vrndq_f32(a); |
| 118 |
#endif /* POLYMORPHIC */ |
| 119 |
} |
| 120 |
|
| 121 |
// CHECK-LABEL: @test_vrndxq_f16( |
| 122 |
// CHECK-NEXT: entry: |
| 123 |
// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.rint.v8f16(<8 x half> [[A:%.*]]) |
| 124 |
// CHECK-NEXT: ret <8 x half> [[TMP0]] |
| 125 |
// |
| 126 |
float16x8_t test_vrndxq_f16(float16x8_t a) |
| 127 |
{ |
| 128 |
#ifdef POLYMORPHIC |
| 129 |
return vrndxq(a); |
| 130 |
#else /* POLYMORPHIC */ |
| 131 |
return vrndxq_f16(a); |
| 132 |
#endif /* POLYMORPHIC */ |
| 133 |
} |
| 134 |
|
| 135 |
// CHECK-LABEL: @test_vrndxq_f32( |
| 136 |
// CHECK-NEXT: entry: |
| 137 |
// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.rint.v4f32(<4 x float> [[A:%.*]]) |
| 138 |
// CHECK-NEXT: ret <4 x float> [[TMP0]] |
| 139 |
// |
| 140 |
float32x4_t test_vrndxq_f32(float32x4_t a) |
| 141 |
{ |
| 142 |
#ifdef POLYMORPHIC |
| 143 |
return vrndxq(a); |
| 144 |
#else /* POLYMORPHIC */ |
| 145 |
return vrndxq_f32(a); |
| 146 |
#endif /* POLYMORPHIC */ |
| 147 |
} |
| 148 |
|
| 149 |
// CHECK-LABEL: @test_vrndnq_f16( |
| 150 |
// CHECK-NEXT: entry: |
| 151 |
// CHECK-NEXT: [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vrintn.v8f16(<8 x half> [[A:%.*]]) |
| 152 |
// CHECK-NEXT: ret <8 x half> [[TMP0]] |
| 153 |
// |
| 154 |
float16x8_t test_vrndnq_f16(float16x8_t a) |
| 155 |
{ |
| 156 |
#ifdef POLYMORPHIC |
| 157 |
return vrndnq(a); |
| 158 |
#else /* POLYMORPHIC */ |
| 159 |
return vrndnq_f16(a); |
| 160 |
#endif /* POLYMORPHIC */ |
| 161 |
} |
| 162 |
|
| 163 |
// CHECK-LABEL: @test_vrndnq_f32( |
| 164 |
// CHECK-NEXT: entry: |
| 165 |
// CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vrintn.v4f32(<4 x float> [[A:%.*]]) |
| 166 |
// CHECK-NEXT: ret <4 x float> [[TMP0]] |
| 167 |
// |
| 168 |
float32x4_t test_vrndnq_f32(float32x4_t a) |
| 169 |
{ |
| 170 |
#ifdef POLYMORPHIC |
| 171 |
return vrndnq(a); |
| 172 |
#else /* POLYMORPHIC */ |
| 173 |
return vrndnq_f32(a); |
| 174 |
#endif /* POLYMORPHIC */ |
| 175 |
} |
| 176 |
|
| 177 |
// CHECK-LABEL: @test_vrndaq_m_f16( |
| 178 |
// CHECK-NEXT: entry: |
| 179 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 180 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 181 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrinta.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]]) |
| 182 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 183 |
// |
| 184 |
float16x8_t test_vrndaq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p) |
| 185 |
{ |
| 186 |
#ifdef POLYMORPHIC |
| 187 |
return vrndaq_m(inactive, a, p); |
| 188 |
#else /* POLYMORPHIC */ |
| 189 |
return vrndaq_m_f16(inactive, a, p); |
| 190 |
#endif /* POLYMORPHIC */ |
| 191 |
} |
| 192 |
|
| 193 |
// CHECK-LABEL: @test_vrndaq_m_f32( |
| 194 |
// CHECK-NEXT: entry: |
| 195 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 196 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 197 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrinta.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]]) |
| 198 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 199 |
// |
| 200 |
float32x4_t test_vrndaq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p) |
| 201 |
{ |
| 202 |
#ifdef POLYMORPHIC |
| 203 |
return vrndaq_m(inactive, a, p); |
| 204 |
#else /* POLYMORPHIC */ |
| 205 |
return vrndaq_m_f32(inactive, a, p); |
| 206 |
#endif /* POLYMORPHIC */ |
| 207 |
} |
| 208 |
|
| 209 |
// CHECK-LABEL: @test_vrndmq_m_f16( |
| 210 |
// CHECK-NEXT: entry: |
| 211 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 212 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 213 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintm.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]]) |
| 214 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 215 |
// |
| 216 |
float16x8_t test_vrndmq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p) |
| 217 |
{ |
| 218 |
#ifdef POLYMORPHIC |
| 219 |
return vrndmq_m(inactive, a, p); |
| 220 |
#else /* POLYMORPHIC */ |
| 221 |
return vrndmq_m_f16(inactive, a, p); |
| 222 |
#endif /* POLYMORPHIC */ |
| 223 |
} |
| 224 |
|
| 225 |
// CHECK-LABEL: @test_vrndmq_m_f32( |
| 226 |
// CHECK-NEXT: entry: |
| 227 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 228 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 229 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintm.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]]) |
| 230 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 231 |
// |
| 232 |
float32x4_t test_vrndmq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p) |
| 233 |
{ |
| 234 |
#ifdef POLYMORPHIC |
| 235 |
return vrndmq_m(inactive, a, p); |
| 236 |
#else /* POLYMORPHIC */ |
| 237 |
return vrndmq_m_f32(inactive, a, p); |
| 238 |
#endif /* POLYMORPHIC */ |
| 239 |
} |
| 240 |
|
| 241 |
// CHECK-LABEL: @test_vrndnq_m_f16( |
| 242 |
// CHECK-NEXT: entry: |
| 243 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 244 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 245 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintn.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]]) |
| 246 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 247 |
// |
| 248 |
float16x8_t test_vrndnq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p) |
| 249 |
{ |
| 250 |
#ifdef POLYMORPHIC |
| 251 |
return vrndnq_m(inactive, a, p); |
| 252 |
#else /* POLYMORPHIC */ |
| 253 |
return vrndnq_m_f16(inactive, a, p); |
| 254 |
#endif /* POLYMORPHIC */ |
| 255 |
} |
| 256 |
|
| 257 |
// CHECK-LABEL: @test_vrndnq_m_f32( |
| 258 |
// CHECK-NEXT: entry: |
| 259 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 260 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 261 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintn.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]]) |
| 262 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 263 |
// |
| 264 |
float32x4_t test_vrndnq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p) |
| 265 |
{ |
| 266 |
#ifdef POLYMORPHIC |
| 267 |
return vrndnq_m(inactive, a, p); |
| 268 |
#else /* POLYMORPHIC */ |
| 269 |
return vrndnq_m_f32(inactive, a, p); |
| 270 |
#endif /* POLYMORPHIC */ |
| 271 |
} |
| 272 |
|
| 273 |
// CHECK-LABEL: @test_vrndpq_m_f16( |
| 274 |
// CHECK-NEXT: entry: |
| 275 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 276 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 277 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintp.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]]) |
| 278 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 279 |
// |
| 280 |
float16x8_t test_vrndpq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p) |
| 281 |
{ |
| 282 |
#ifdef POLYMORPHIC |
| 283 |
return vrndpq_m(inactive, a, p); |
| 284 |
#else /* POLYMORPHIC */ |
| 285 |
return vrndpq_m_f16(inactive, a, p); |
| 286 |
#endif /* POLYMORPHIC */ |
| 287 |
} |
| 288 |
|
| 289 |
// CHECK-LABEL: @test_vrndpq_m_f32( |
| 290 |
// CHECK-NEXT: entry: |
| 291 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 292 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 293 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintp.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]]) |
| 294 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 295 |
// |
| 296 |
float32x4_t test_vrndpq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p) |
| 297 |
{ |
| 298 |
#ifdef POLYMORPHIC |
| 299 |
return vrndpq_m(inactive, a, p); |
| 300 |
#else /* POLYMORPHIC */ |
| 301 |
return vrndpq_m_f32(inactive, a, p); |
| 302 |
#endif /* POLYMORPHIC */ |
| 303 |
} |
| 304 |
|
| 305 |
// CHECK-LABEL: @test_vrndq_m_f16( |
| 306 |
// CHECK-NEXT: entry: |
| 307 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 308 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 309 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintz.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]]) |
| 310 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 311 |
// |
| 312 |
float16x8_t test_vrndq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p) |
| 313 |
{ |
| 314 |
#ifdef POLYMORPHIC |
| 315 |
return vrndq_m(inactive, a, p); |
| 316 |
#else /* POLYMORPHIC */ |
| 317 |
return vrndq_m_f16(inactive, a, p); |
| 318 |
#endif /* POLYMORPHIC */ |
| 319 |
} |
| 320 |
|
| 321 |
// CHECK-LABEL: @test_vrndq_m_f32( |
| 322 |
// CHECK-NEXT: entry: |
| 323 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 324 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 325 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintz.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]]) |
| 326 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 327 |
// |
| 328 |
float32x4_t test_vrndq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p) |
| 329 |
{ |
| 330 |
#ifdef POLYMORPHIC |
| 331 |
return vrndq_m(inactive, a, p); |
| 332 |
#else /* POLYMORPHIC */ |
| 333 |
return vrndq_m_f32(inactive, a, p); |
| 334 |
#endif /* POLYMORPHIC */ |
| 335 |
} |
| 336 |
|
| 337 |
// CHECK-LABEL: @test_vrndxq_m_f16( |
| 338 |
// CHECK-NEXT: entry: |
| 339 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 340 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 341 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintx.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]]) |
| 342 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 343 |
// |
| 344 |
float16x8_t test_vrndxq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p) |
| 345 |
{ |
| 346 |
#ifdef POLYMORPHIC |
| 347 |
return vrndxq_m(inactive, a, p); |
| 348 |
#else /* POLYMORPHIC */ |
| 349 |
return vrndxq_m_f16(inactive, a, p); |
| 350 |
#endif /* POLYMORPHIC */ |
| 351 |
} |
| 352 |
|
| 353 |
// CHECK-LABEL: @test_vrndxq_m_f32( |
| 354 |
// CHECK-NEXT: entry: |
| 355 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 356 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 357 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintx.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]]) |
| 358 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 359 |
// |
| 360 |
float32x4_t test_vrndxq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p) |
| 361 |
{ |
| 362 |
#ifdef POLYMORPHIC |
| 363 |
return vrndxq_m(inactive, a, p); |
| 364 |
#else /* POLYMORPHIC */ |
| 365 |
return vrndxq_m_f32(inactive, a, p); |
| 366 |
#endif /* POLYMORPHIC */ |
| 367 |
} |
| 368 |
|
| 369 |
// CHECK-LABEL: @test_vrndaq_x_f16( |
| 370 |
// CHECK-NEXT: entry: |
| 371 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 372 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 373 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrinta.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef) |
| 374 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 375 |
// |
| 376 |
float16x8_t test_vrndaq_x_f16(float16x8_t a, mve_pred16_t p) |
| 377 |
{ |
| 378 |
#ifdef POLYMORPHIC |
| 379 |
return vrndaq_x(a, p); |
| 380 |
#else /* POLYMORPHIC */ |
| 381 |
return vrndaq_x_f16(a, p); |
| 382 |
#endif /* POLYMORPHIC */ |
| 383 |
} |
| 384 |
|
| 385 |
// CHECK-LABEL: @test_vrndaq_x_f32( |
| 386 |
// CHECK-NEXT: entry: |
| 387 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 388 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 389 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrinta.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef) |
| 390 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 391 |
// |
| 392 |
float32x4_t test_vrndaq_x_f32(float32x4_t a, mve_pred16_t p) |
| 393 |
{ |
| 394 |
#ifdef POLYMORPHIC |
| 395 |
return vrndaq_x(a, p); |
| 396 |
#else /* POLYMORPHIC */ |
| 397 |
return vrndaq_x_f32(a, p); |
| 398 |
#endif /* POLYMORPHIC */ |
| 399 |
} |
| 400 |
|
| 401 |
// CHECK-LABEL: @test_vrndmq_x_f16( |
| 402 |
// CHECK-NEXT: entry: |
| 403 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 404 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 405 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintm.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef) |
| 406 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 407 |
// |
| 408 |
float16x8_t test_vrndmq_x_f16(float16x8_t a, mve_pred16_t p) |
| 409 |
{ |
| 410 |
#ifdef POLYMORPHIC |
| 411 |
return vrndmq_x(a, p); |
| 412 |
#else /* POLYMORPHIC */ |
| 413 |
return vrndmq_x_f16(a, p); |
| 414 |
#endif /* POLYMORPHIC */ |
| 415 |
} |
| 416 |
|
| 417 |
// CHECK-LABEL: @test_vrndmq_x_f32( |
| 418 |
// CHECK-NEXT: entry: |
| 419 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 420 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 421 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintm.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef) |
| 422 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 423 |
// |
| 424 |
float32x4_t test_vrndmq_x_f32(float32x4_t a, mve_pred16_t p) |
| 425 |
{ |
| 426 |
#ifdef POLYMORPHIC |
| 427 |
return vrndmq_x(a, p); |
| 428 |
#else /* POLYMORPHIC */ |
| 429 |
return vrndmq_x_f32(a, p); |
| 430 |
#endif /* POLYMORPHIC */ |
| 431 |
} |
| 432 |
|
| 433 |
// CHECK-LABEL: @test_vrndnq_x_f16( |
| 434 |
// CHECK-NEXT: entry: |
| 435 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 436 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 437 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintn.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef) |
| 438 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 439 |
// |
| 440 |
float16x8_t test_vrndnq_x_f16(float16x8_t a, mve_pred16_t p) |
| 441 |
{ |
| 442 |
#ifdef POLYMORPHIC |
| 443 |
return vrndnq_x(a, p); |
| 444 |
#else /* POLYMORPHIC */ |
| 445 |
return vrndnq_x_f16(a, p); |
| 446 |
#endif /* POLYMORPHIC */ |
| 447 |
} |
| 448 |
|
| 449 |
// CHECK-LABEL: @test_vrndnq_x_f32( |
| 450 |
// CHECK-NEXT: entry: |
| 451 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 452 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 453 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintn.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef) |
| 454 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 455 |
// |
| 456 |
float32x4_t test_vrndnq_x_f32(float32x4_t a, mve_pred16_t p) |
| 457 |
{ |
| 458 |
#ifdef POLYMORPHIC |
| 459 |
return vrndnq_x(a, p); |
| 460 |
#else /* POLYMORPHIC */ |
| 461 |
return vrndnq_x_f32(a, p); |
| 462 |
#endif /* POLYMORPHIC */ |
| 463 |
} |
| 464 |
|
| 465 |
// CHECK-LABEL: @test_vrndpq_x_f16( |
| 466 |
// CHECK-NEXT: entry: |
| 467 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 468 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 469 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintp.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef) |
| 470 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 471 |
// |
| 472 |
float16x8_t test_vrndpq_x_f16(float16x8_t a, mve_pred16_t p) |
| 473 |
{ |
| 474 |
#ifdef POLYMORPHIC |
| 475 |
return vrndpq_x(a, p); |
| 476 |
#else /* POLYMORPHIC */ |
| 477 |
return vrndpq_x_f16(a, p); |
| 478 |
#endif /* POLYMORPHIC */ |
| 479 |
} |
| 480 |
|
| 481 |
// CHECK-LABEL: @test_vrndpq_x_f32( |
| 482 |
// CHECK-NEXT: entry: |
| 483 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 484 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 485 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintp.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef) |
| 486 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 487 |
// |
| 488 |
float32x4_t test_vrndpq_x_f32(float32x4_t a, mve_pred16_t p) |
| 489 |
{ |
| 490 |
#ifdef POLYMORPHIC |
| 491 |
return vrndpq_x(a, p); |
| 492 |
#else /* POLYMORPHIC */ |
| 493 |
return vrndpq_x_f32(a, p); |
| 494 |
#endif /* POLYMORPHIC */ |
| 495 |
} |
| 496 |
|
| 497 |
// CHECK-LABEL: @test_vrndq_x_f16( |
| 498 |
// CHECK-NEXT: entry: |
| 499 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 500 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 501 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintz.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef) |
| 502 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 503 |
// |
| 504 |
float16x8_t test_vrndq_x_f16(float16x8_t a, mve_pred16_t p) |
| 505 |
{ |
| 506 |
#ifdef POLYMORPHIC |
| 507 |
return vrndq_x(a, p); |
| 508 |
#else /* POLYMORPHIC */ |
| 509 |
return vrndq_x_f16(a, p); |
| 510 |
#endif /* POLYMORPHIC */ |
| 511 |
} |
| 512 |
|
| 513 |
// CHECK-LABEL: @test_vrndq_x_f32( |
| 514 |
// CHECK-NEXT: entry: |
| 515 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 516 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 517 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintz.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef) |
| 518 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 519 |
// |
| 520 |
float32x4_t test_vrndq_x_f32(float32x4_t a, mve_pred16_t p) |
| 521 |
{ |
| 522 |
#ifdef POLYMORPHIC |
| 523 |
return vrndq_x(a, p); |
| 524 |
#else /* POLYMORPHIC */ |
| 525 |
return vrndq_x_f32(a, p); |
| 526 |
#endif /* POLYMORPHIC */ |
| 527 |
} |
| 528 |
|
| 529 |
// CHECK-LABEL: @test_vrndxq_x_f16( |
| 530 |
// CHECK-NEXT: entry: |
| 531 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 532 |
// CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]]) |
| 533 |
// CHECK-NEXT: [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintx.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef) |
| 534 |
// CHECK-NEXT: ret <8 x half> [[TMP2]] |
| 535 |
// |
| 536 |
float16x8_t test_vrndxq_x_f16(float16x8_t a, mve_pred16_t p) |
| 537 |
{ |
| 538 |
#ifdef POLYMORPHIC |
| 539 |
return vrndxq_x(a, p); |
| 540 |
#else /* POLYMORPHIC */ |
| 541 |
return vrndxq_x_f16(a, p); |
| 542 |
#endif /* POLYMORPHIC */ |
| 543 |
} |
| 544 |
|
| 545 |
// CHECK-LABEL: @test_vrndxq_x_f32( |
| 546 |
// CHECK-NEXT: entry: |
| 547 |
// CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32 |
| 548 |
// CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]]) |
| 549 |
// CHECK-NEXT: [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintx.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef) |
| 550 |
// CHECK-NEXT: ret <4 x float> [[TMP2]] |
| 551 |
// |
| 552 |
float32x4_t test_vrndxq_x_f32(float32x4_t a, mve_pred16_t p) |
| 553 |
{ |
| 554 |
#ifdef POLYMORPHIC |
| 555 |
return vrndxq_x(a, p); |
| 556 |
#else /* POLYMORPHIC */ |
| 557 |
return vrndxq_x_f32(a, p); |
| 558 |
#endif /* POLYMORPHIC */ |
| 559 |
} |
| 560 |
|