File: acle_sve2_bfloat.cpp

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (29 lines) | stat: -rw-r--r-- 1,554 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// REQUIRES: aarch64-registered-target

// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -fsyntax-only -verify -verify-ignore-unexpected=error,note -emit-llvm -o - %s
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -fsyntax-only -verify=overload -verify-ignore-unexpected=error,note -emit-llvm -o - %s

#ifdef SVE_OVERLOADED_FORMS
// A simple used,unused... macro, long enough to represent any SVE builtin.
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
#else
#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
#endif

#include <arm_sve.h>

void test_bfloat(const bfloat16_t *const_bf16_ptr, svbfloat16_t bf16, svbfloat16x2_t bf16x2)
{
  // expected-error@+2 {{'svwhilerw_bf16' needs target feature sve2,bf16}}
  // overload-error@+1 {{'svwhilerw' needs target feature sve2,bf16}}
  SVE_ACLE_FUNC(svwhilerw,_bf16,,)(const_bf16_ptr, const_bf16_ptr);
  // expected-error@+2 {{'svtbx_bf16' needs target feature sve2,bf16}}
  // overload-error@+1 {{'svtbx' needs target feature sve2,bf16}}
  SVE_ACLE_FUNC(svtbx,_bf16,,)(bf16, bf16, svundef_u16());
  // expected-error@+2 {{'svtbl2_bf16' needs target feature sve2,bf16}}
  // overload-error@+1 {{'svtbl2' needs target feature sve2,bf16}}
  SVE_ACLE_FUNC(svtbl2,_bf16,,)(bf16x2, svundef_u16());
  // expected-error@+2 {{'svwhilewr_bf16' needs target feature sve2,bf16}}
  // overload-error@+1 {{'svwhilewr' needs target feature sve2,bf16}}
  SVE_ACLE_FUNC(svwhilewr,_bf16,,)(const_bf16_ptr, const_bf16_ptr);
}