Skip to content
Snippets Groups Projects
Commit 35dd5cfb authored by Claudio Bantaloukas's avatar Claudio Bantaloukas Committed by Saurabh Jha
Browse files

aarch64: Add fp8 scalar types

The ACLE defines a new scalar type, __mfp8. This is an opaque 8bit types that
can only be used by fp8 intrinsics. Additionally, the mfloat8_t type is made
available in arm_neon.h and arm_sve.h as an alias of the same.

This implementation uses an unsigned INTEGER_TYPE, with precision 8 to
represent __mfp8. Conversions to int and other types are disabled via the
TARGET_INVALID_CONVERSION hook.
Additionally, operations that are typically available to integer types are
disabled via TARGET_INVALID_UNARY_OP and TARGET_INVALID_BINARY_OP hooks.

gcc/ChangeLog:

	* config/aarch64/aarch64-builtins.cc (aarch64_mfp8_type_node): Add node
	for __mfp8 type.
	(aarch64_mfp8_ptr_type_node): Add node for __mfp8 pointer type.
	(aarch64_init_fp8_types): New function to initialise fp8 types and
	register with language backends.
	* config/aarch64/aarch64.cc (aarch64_mangle_type): Add ABI mangling for
	new type.
	(aarch64_invalid_conversion): Add function implementing
	TARGET_INVALID_CONVERSION hook that blocks conversion to and from the
	__mfp8 type.
	(aarch64_invalid_unary_op): Add function implementing TARGET_UNARY_OP
	hook that blocks operations on __mfp8 other than &.
	(aarch64_invalid_binary_op): Extend TARGET_BINARY_OP hook to disallow
	operations on __mfp8 type.
	(TARGET_INVALID_CONVERSION): Add define.
	(TARGET_INVALID_UNARY_OP): Likewise.
	* config/aarch64/aarch64.h (aarch64_mfp8_type_node): Add node for __mfp8
	type.
	(aarch64_mfp8_ptr_type_node): Add node for __mfp8 pointer type.
	* config/aarch64/arm_private_fp8.h (mfloat8_t): Add typedef.

gcc/testsuite/ChangeLog:

	* g++.target/aarch64/fp8_mangling.C: New tests exercising mangling.
	* g++.target/aarch64/fp8_scalar_typecheck_2.C: New tests in C++.
	* gcc.target/aarch64/fp8_scalar_1.c: New tests in C.
	* gcc.target/aarch64/fp8_scalar_typecheck_1.c: Likewise.
parent 27ddda8b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment