xref: /llvm-project/clang/test/Sema/aarch64-sve-intrinsics/acle_sve_target.cpp (revision 7c1d9b15eee3a34678addab2bab66f3020ac0753)
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 
test_sve(svint64_t x,svint64_t y)9 void __attribute__((target("sve"))) test_sve(svint64_t x, svint64_t y)
10 {
11   svzip2(x, y);
12 }
13 
test_bfloat(svfloat32_t x,svbfloat16_t y,bfloat16_t z)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 
test_sve2(svbool_t pg)19 void __attribute__((target("sve2"))) test_sve2(svbool_t pg)
20 {
21   svlogb_f16_z(pg, svundef_f16());
22 }
23 
test_sve2_sha3()24 void __attribute__((target("sve2-sha3"))) test_sve2_sha3()
25 {
26   svrax1_s64(svundef_s64(), svundef_s64());
27 }
28 
test_f16(svbool_t pg)29 void __attribute__((target("sve2"))) test_f16(svbool_t pg)
30 {
31   svlogb_f16_z(pg, svundef_f16());
32 }
33 
34