| 1 |
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -verify -emit-llvm -o - -ferror-limit 100 %s |
| 2 |
// REQUIRES: aarch64-registered-target |
| 3 |
|
| 4 |
// Test that functions with the correct target attributes can use the correct SVE intrinsics. |
| 5 |
// expected-no-diagnostics |
| 6 |
|
| 7 |
#include <arm_sve.h> |
| 8 |
|
| 9 |
void __attribute__((target("sve"))) test_sve(svint64_t x, svint64_t y) |
| 10 |
{ |
| 11 |
svzip2(x, y); |
| 12 |
} |
| 13 |
|
| 14 |
void __attribute__((target("sve,bf16"))) test_bfloat(svfloat32_t x, svbfloat16_t y, bfloat16_t z) |
| 15 |
{ |
| 16 |
svbfdot_n_f32(x, y, z); |
| 17 |
} |
| 18 |
|
| 19 |
void __attribute__((target("sve2"))) test_sve2(svbool_t pg) |
| 20 |
{ |
| 21 |
svlogb_f16_z(pg, svundef_f16()); |
| 22 |
} |
| 23 |
|
| 24 |
void __attribute__((target("sve2-sha3"))) test_sve2_sha3() |
| 25 |
{ |
| 26 |
svrax1_s64(svundef_s64(), svundef_s64()); |
| 27 |
} |
| 28 |
|
| 29 |
void __attribute__((target("sve2"))) test_f16(svbool_t pg) |
| 30 |
{ |
| 31 |
svlogb_f16_z(pg, svundef_f16()); |
| 32 |
} |
| 33 |
|