forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLANG]Add Neon vectors for mfloat8_t
This patch adds these new vector sizes for neon: mfloat8x16_t and mfloat8x8_t According to the ARM ACLE PR#323[1]. [1] ARM-software/acle#323
- Loading branch information
1 parent
de397fb
commit bfd90a7
Showing
15 changed files
with
240 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//===--- arm_mfp8.td - ARM MFP8 compiler interface ------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file defines the TableGen definitions from which the ARM MFP8 header | ||
// file will be generated. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
include "arm_neon_incl.td" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify=scalar,neon -triple aarch64-arm-none-eabi \ | ||
// RUN: -target-feature -fp8 -target-feature +neon %s | ||
|
||
// REQUIRES: aarch64-registered-target | ||
__fpm8 test_static_cast_from_char(char in) { | ||
return static_cast<__fpm8>(in); // scalar-error {{static_cast from 'char' to '__fpm8' is not allowed}} | ||
} | ||
|
||
char test_static_cast_to_char(__fpm8 in) { | ||
return static_cast<char>(in); // scalar-error {{static_cast from '__fpm8' to 'char' is not allowed}} | ||
} | ||
void test(bool b) { | ||
__fpm8 fpm8; | ||
|
||
fpm8 + fpm8; // scalar-error {{invalid operands to binary expression ('__fpm8' and '__fpm8')}} | ||
fpm8 - fpm8; // scalar-error {{invalid operands to binary expression ('__fpm8' and '__fpm8')}} | ||
fpm8 * fpm8; // scalar-error {{invalid operands to binary expression ('__fpm8' and '__fpm8')}} | ||
fpm8 / fpm8; // scalar-error {{invalid operands to binary expression ('__fpm8' and '__fpm8')}} | ||
++fpm8; // scalar-error {{cannot increment value of type '__fpm8'}} | ||
--fpm8; // scalar-error {{cannot decrement value of type '__fpm8'}} | ||
|
||
char u8; | ||
|
||
fpm8 + u8; // scalar-error {{invalid operands to binary expression ('__fpm8' and 'char')}} | ||
u8 + fpm8; // scalar-error {{invalid operands to binary expression ('char' and '__fpm8')}} | ||
fpm8 - u8; // scalar-error {{invalid operands to binary expression ('__fpm8' and 'char')}} | ||
u8 - fpm8; // scalar-error {{invalid operands to binary expression ('char' and '__fpm8')}} | ||
fpm8 * u8; // scalar-error {{invalid operands to binary expression ('__fpm8' and 'char')}} | ||
u8 * fpm8; // scalar-error {{invalid operands to binary expression ('char' and '__fpm8')}} | ||
fpm8 / u8; // scalar-error {{invalid operands to binary expression ('__fpm8' and 'char')}} | ||
u8 / fpm8; // scalar-error {{invalid operands to binary expression ('char' and '__fpm8')}} | ||
fpm8 = u8; // scalar-error {{assigning to '__fpm8' from incompatible type 'char'}} | ||
u8 = fpm8; // scalar-error {{assigning to 'char' from incompatible type '__fpm8'}} | ||
fpm8 + (b ? u8 : fpm8); // scalar-error {{incompatible operand types ('char' and '__fpm8')}} | ||
} | ||
|
||
#include <arm_neon.h> | ||
|
||
void test_vector(fpm8x8_t a, fpm8x8_t b, uint8x8_t c) { | ||
a + b; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'fpm8x8_t')}} | ||
a - b; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'fpm8x8_t')}} | ||
a * b; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'fpm8x8_t')}} | ||
a / b; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'fpm8x8_t')}} | ||
|
||
a + c; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'uint8x8_t' (vector of 8 'uint8_t' values))}} | ||
a - c; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'uint8x8_t' (vector of 8 'uint8_t' values))}} | ||
a * c; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'uint8x8_t' (vector of 8 'uint8_t' values))}} | ||
a / c; // neon-error {{invalid operands to binary expression ('fpm8x8_t' (vector of 8 'fpm8_t' values) and 'uint8x8_t' (vector of 8 'uint8_t' values))}} | ||
c + b; // neon-error {{invalid operands to binary expression ('uint8x8_t' (vector of 8 'uint8_t' values) and 'fpm8x8_t' (vector of 8 'fpm8_t' values))}} | ||
c - b; // neon-error {{invalid operands to binary expression ('uint8x8_t' (vector of 8 'uint8_t' values) and 'fpm8x8_t' (vector of 8 'fpm8_t' values))}} | ||
c * b; // neon-error {{invalid operands to binary expression ('uint8x8_t' (vector of 8 'uint8_t' values) and 'fpm8x8_t' (vector of 8 'fpm8_t' values))}} | ||
c / b; // neon-error {{invalid operands to binary expression ('uint8x8_t' (vector of 8 'uint8_t' values) and 'fpm8x8_t' (vector of 8 'fpm8_t' values))}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.