72 lines · cpp
1// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -verify -verify-ignore-unexpected=error,note -emit-llvm -o - %s2// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -verify -verify-ignore-unexpected=error,note -emit-llvm -o - %s3// REQUIRES: aarch64-registered-target4 5#include <arm_sve.h>6 7#if defined __ARM_FEATURE_SME8#define MODE_ATTR __arm_streaming9#else10#define MODE_ATTR11#endif12 13__attribute__((target("bf16")))14void test_bf16(svbool_t pg, svfloat32_t svf32, svbfloat16_t svbf16, bfloat16_t bf16) MODE_ATTR15{16 svbfdot_f32(svf32, svbf16, svbf16);17 svbfdot_n_f32(svf32, svbf16, bf16);18 svbfdot_lane_f32(svf32, svbf16, svbf16, 0);19 20 svbfmlalb_f32(svf32, svbf16, svbf16);21 svbfmlalb_n_f32(svf32, svbf16, bf16);22 svbfmlalb_lane_f32(svf32, svbf16, svbf16, 0);23 24 svbfmlalt_f32(svf32, svbf16, svbf16);25 svbfmlalt_n_f32(svf32, svbf16, bf16);26 svbfmlalt_lane_f32(svf32, svbf16, svbf16, 0);27 28 svcvt_bf16_f32_m(svbf16, pg, svf32);29 svcvt_bf16_f32_x(pg, svf32);30 svcvt_bf16_f32_z(pg, svf32);31 32 svcvtnt_bf16_f32_m(svbf16, pg, svf32);33 svcvtnt_bf16_f32_x(svbf16, pg, svf32);34}35 36void test_no_bf16(svbool_t pg, svfloat32_t svf32, svbfloat16_t svbf16, bfloat16_t bf16) MODE_ATTR37{38 // expected-error@+1 {{'svbfdot_f32' needs target feature (sve,bf16)|(sme,bf16)}}39 svbfdot_f32(svf32, svbf16, svbf16);40 // expected-error@+1 {{'svbfdot_n_f32' needs target feature (sve,bf16)|(sme,bf16)}}41 svbfdot_n_f32(svf32, svbf16, bf16);42 // expected-error@+1 {{'svbfdot_lane_f32' needs target feature (sve,bf16)|(sme,bf16)}}43 svbfdot_lane_f32(svf32, svbf16, svbf16, 0);44 45 // expected-error@+1 {{'svbfmlalb_f32' needs target feature (sve,bf16)|(sme,bf16)}}46 svbfmlalb_f32(svf32, svbf16, svbf16);47 // expected-error@+1 {{'svbfmlalb_n_f32' needs target feature (sve,bf16)|(sme,bf16)}}48 svbfmlalb_n_f32(svf32, svbf16, bf16);49 // expected-error@+1 {{'svbfmlalb_lane_f32' needs target feature (sve,bf16)|(sme,bf16)}}50 svbfmlalb_lane_f32(svf32, svbf16, svbf16, 0);51 52 // expected-error@+1 {{'svbfmlalt_f32' needs target feature (sve,bf16)|(sme,bf16)}}53 svbfmlalt_f32(svf32, svbf16, svbf16);54 // expected-error@+1 {{'svbfmlalt_n_f32' needs target feature (sve,bf16)|(sme,bf16)}}55 svbfmlalt_n_f32(svf32, svbf16, bf16);56 // expected-error@+1 {{'svbfmlalt_lane_f32' needs target feature (sve,bf16)|(sme,bf16)}}57 svbfmlalt_lane_f32(svf32, svbf16, svbf16, 0);58 59 // expected-error@+1 {{'svcvt_bf16_f32_m' needs target feature (sve,bf16)|(sme,bf16)}}60 svcvt_bf16_f32_m(svbf16, pg, svf32);61 // expected-error@+1 {{'svcvt_bf16_f32_x' needs target feature (sve,bf16)|(sme,bf16)}}62 svcvt_bf16_f32_x(pg, svf32);63 // expected-error@+1 {{'svcvt_bf16_f32_z' needs target feature (sve,bf16)|(sme,bf16)}}64 svcvt_bf16_f32_z(pg, svf32);65 66 // expected-error@+1 {{'svcvtnt_bf16_f32_m' needs target feature (sve,bf16)|(sme,bf16)}}67 svcvtnt_bf16_f32_m(svbf16, pg, svf32);68 // NOTE: svcvtnt_bf16_f32_x is a macro that expands to svcvtnt_bf16_f32_m.69 // expected-error@+1 {{'svcvtnt_bf16_f32_m' needs target feature (sve,bf16)|(sme,bf16)}}70 svcvtnt_bf16_f32_x(svbf16, pg, svf32);71}72