diff options
author | Saurabh Jha <saurabh.jha@arm.com> | 2024-11-13 19:48:26 +0000 |
---|---|---|
committer | Saurabh Jha <saurabh.jha@arm.com> | 2024-11-14 09:59:41 +0000 |
commit | ee10846d0216e4dae4e99b20054595e668575c47 (patch) | |
tree | 8e2450a6b5fa55bba42be4d5b27014a7dab0a33c /gcc/ctfout.cc | |
parent | 3103441079fa30dc9f75a75bda38c39f1ffd708e (diff) | |
download | gcc-ee10846d0216e4dae4e99b20054595e668575c47.zip gcc-ee10846d0216e4dae4e99b20054595e668575c47.tar.gz gcc-ee10846d0216e4dae4e99b20054595e668575c47.tar.bz2 |
aarch64: Add support for fp8dot2 and fp8dot4
The AArch64 FEAT_FP8DOT2 and FEAT_FP8DOT4 extension introduces
instructions for dot product of vectors.
This patch introduces the following intrinsics:
1. vdot{q}_{fp16|fp32}_mf8_fpm.
2. vdot{q}_lane{q}_{fp16|fp32}_mf8_fpm.
It introduces two flags: fp8dot2 and fp8dot4.
We had to add space for another type in aarch64_pragma_builtins_data
struct. The macros were updated to reflect that.
We added a new aarch64_builtin_signature variant, quaternary, and added
support for it in the functions aarch64_fntype and
aarch64_expand_pragma_builtin.
We added a new namespace, function_checker, to implement range checks
for functions defined using the new pragma approach. The old intrinsic
range checks will continue to work. All the new AdvSIMD intrinsics we
define that need lane checks should be using the function in this
namespace to implement the checks.
gcc/ChangeLog:
* config/aarch64/aarch64-builtins.cc
(ENTRY): Change to handle extra type.
(enum class): Added new variant.
(struct aarch64_pragma_builtins_data): Add support for another
type.
(aarch64_get_number_of_args): Handle new signature.
(require_integer_constant): New function to check whether the
operand is an integer constant.
(require_immediate_range): New function to validate index
ranges.
(check_simd_lane_bounds): New function to validate index
operands.
(aarch64_general_check_builtin_call): Call
function_checker::check-simd_lane_bounds.
(aarch64_expand_pragma_builtin): Handle new signature.
* config/aarch64/aarch64-c.cc
(aarch64_update_cpp_builtins): New flags.
* config/aarch64/aarch64-option-extensions.def
(AARCH64_OPT_EXTENSION): New flags.
* config/aarch64/aarch64-simd-pragma-builtins.def
(ENTRY_BINARY): Change to handle extra type.
(ENTRY_BINARY_FPM): Change to handle extra type.
(ENTRY_UNARY_FPM): Change to handle extra type.
(ENTRY_TERNARY_FPM_LANE): Macro to declare fpm ternary with
lane intrinsics.
(ENTRY_VDOT_FPM): Macro to declare vdot intrinsics.
(REQUIRED_EXTENSIONS): Define to declare functions behind
command line flags.
* config/aarch64/aarch64-simd.md:
(@aarch64_<fpm_uns_op><VHF:mode><VHF:mode><VB:mode><VB:mode>):
Instruction pattern for vdot2 intrinsics.
(@aarch64_<fpm_uns_op><VHF:mode><VHF:mode><VB:mode><VB2:mode><SI_ONLY:mode>):
Instruction pattern for vdot2 intrinsics with lane.
(@aarch64_<fpm_uns_op><VDQSF:mode><VDQSF:mode><VB:mode><VB:mode>):
Instruction pattern for vdot4 intrinsics.
(@aarch64_<fpm_uns_op><VDQSF:mode><VDQSF:mode><VB:mode><VB2:mode><SI_ONLY:mode>):
Instruction pattern for vdo4 intrinsics with lane.
* config/aarch64/aarch64.h
(TARGET_FP8DOT2): New flag for fp8dot2 instructions.
(TARGET_FP8DOT4): New flag for fp8dot4 instructions.
* config/aarch64/iterators.md: New attributes and iterators.
* doc/invoke.texi: New flag for fp8dot2 and fp8dot4
instructions.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/simd/vdot2_fpmdot.c: New test.
* gcc.target/aarch64/simd/vdot4_fpmdot.c: New test.
Diffstat (limited to 'gcc/ctfout.cc')
0 files changed, 0 insertions, 0 deletions