Skip to content

Commit d94760f

Browse files
[fixup] Add target features test, remove redundant bf16 guard
1 parent 56be43a commit d94760f

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

clang/include/clang/Basic/arm_neon.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ let ArchGuard = "defined(__aarch64__)", TargetGuard = "lut" in {
21252125
}
21262126
}
21272127

2128-
let ArchGuard = "defined(__aarch64__)", TargetGuard = "fp8,bf16,neon" in {
2128+
let ArchGuard = "defined(__aarch64__)", TargetGuard = "fp8,neon" in {
21292129
def VBF1CVT_BF16_MF8 : VInst<"vcvt1_bf16_mf8_fpm", "(QB).V", "m">;
21302130
def VBF1CVT_LOW_BF16_MF8 : VInst<"vcvt1_low_bf16_mf8_fpm", "B.V", "Qm">;
21312131
def VBF2CVTL_BF16_MF8 : VInst<"vcvt2_bf16_mf8_fpm", "(QB).V", "m">;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +bf16 -target-feature +faminmax -emit-llvm -verify %s -o /dev/null
2+
3+
// REQUIRES: aarch64-registered-target
4+
5+
#include <arm_neon.h>
6+
7+
void test_features(float16x4_t vd4, float16x8_t vd8, float32x4_t va4,
8+
mfloat8x8_t v8, mfloat8x16_t v16, fpm_t fpm) {
9+
(void) vcvt1_bf16_mf8_fpm(v8, fpm);
10+
// expected-error@-1 {{'vcvt1_bf16_mf8_fpm' requires target feature 'fp8'}}
11+
(void) vcvt1_low_bf16_mf8_fpm(v16, fpm);
12+
// expected-error@-1 {{'vcvt1_low_bf16_mf8_fpm' requires target feature 'fp8'}}
13+
(void) vcvt2_bf16_mf8_fpm(v8, fpm);
14+
// expected-error@-1 {{'vcvt2_bf16_mf8_fpm' requires target feature 'fp8'}}
15+
(void) vcvt2_low_bf16_mf8_fpm(v16, fpm);
16+
// expected-error@-1 {{'vcvt2_low_bf16_mf8_fpm' requires target feature 'fp8'}}
17+
18+
(void) vcvt1_high_bf16_mf8_fpm(v16, fpm);
19+
// expected-error@-1 {{'vcvt1_high_bf16_mf8_fpm' requires target feature 'fp8'}}
20+
(void) vcvt2_high_bf16_mf8_fpm(v16, fpm);
21+
// expected-error@-1 {{'vcvt2_high_bf16_mf8_fpm' requires target feature 'fp8'}}
22+
23+
(void) vcvt1_f16_mf8_fpm(v8, fpm);
24+
// expected-error@-1 {{'vcvt1_f16_mf8_fpm' requires target feature 'fp8'}}
25+
(void) vcvt1_low_f16_mf8_fpm(v16, fpm);
26+
// expected-error@-1 {{'vcvt1_low_f16_mf8_fpm' requires target feature 'fp8'}}
27+
(void) vcvt2_f16_mf8_fpm(v8, fpm);
28+
// expected-error@-1 {{'vcvt2_f16_mf8_fpm' requires target feature 'fp8'}}
29+
(void) vcvt2_low_f16_mf8_fpm(v16, fpm);
30+
// expected-error@-1 {{'vcvt2_low_f16_mf8_fpm' requires target feature 'fp8'}}
31+
(void) vcvt1_high_f16_mf8_fpm(v16, fpm);
32+
// expected-error@-1 {{'vcvt1_high_f16_mf8_fpm' requires target feature 'fp8'}}
33+
(void) vcvt2_high_f16_mf8_fpm(v16, fpm);
34+
// expected-error@-1 {{'vcvt2_high_f16_mf8_fpm' requires target feature 'fp8'}}
35+
(void) vcvt_mf8_f32_fpm(va4, va4, fpm);
36+
// expected-error@-1 {{'vcvt_mf8_f32_fpm' requires target feature 'fp8'}}
37+
(void) vcvt_high_mf8_f32_fpm(v8, va4, va4, fpm);
38+
// expected-error@-1 {{'vcvt_high_mf8_f32_fpm' requires target feature 'fp8'}}
39+
(void) vcvt_mf8_f16_fpm(vd4, vd4, fpm);
40+
// expected-error@-1 {{'vcvt_mf8_f16_fpm' requires target feature 'fp8'}}
41+
(void) vcvtq_mf8_f16_fpm(vd8, vd8, fpm);
42+
// expected-error@-1 {{'vcvtq_mf8_f16_fpm' requires target feature 'fp8'}}
43+
}

0 commit comments

Comments
 (0)