]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Add march flags for +fp8 arch extensions
authorClaudio Bantaloukas <claudio.bantaloukas@arm.com>
Wed, 31 Jul 2024 13:42:39 +0000 (14:42 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 31 Jul 2024 13:42:39 +0000 (14:42 +0100)
This introduces the relevant flags to enable access to the fpmr register and fp8 intrinsics, which will be added subsequently.

gcc/ChangeLog:

* config/aarch64/aarch64-option-extensions.def (fp8): New.
* config/aarch64/aarch64.h (TARGET_FP8): Likewise.
* doc/invoke.texi (AArch64 Options): Document new -march flags
and extensions.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/acle/fp8.c: New test.

gcc/config/aarch64/aarch64-option-extensions.def
gcc/config/aarch64/aarch64.h
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/aarch64/acle/fp8.c [new file with mode: 0644]

index 42ec0eec31e2ddb0cc6f83fdbaf0fd4eac5ca7f4..6998627f3774709f4fca27934d1cfb714cafe06a 100644 (file)
@@ -232,6 +232,8 @@ AARCH64_OPT_EXTENSION("the", THE, (), (), (), "the")
 
 AARCH64_OPT_EXTENSION("gcs", GCS, (), (), (), "gcs")
 
+AARCH64_OPT_EXTENSION("fp8", FP8, (SIMD), (), (), "fp8")
+
 #undef AARCH64_OPT_FMV_EXTENSION
 #undef AARCH64_OPT_EXTENSION
 #undef AARCH64_FMV_FEATURE
index b7e330438d9be52d9c79c12d1fb811d0b6e08688..2e75c6b81e207cc640b5d25e4150250f1a0599ea 100644 (file)
@@ -463,6 +463,9 @@ constexpr auto AARCH64_FL_DEFAULT_ISA_MODE ATTRIBUTE_UNUSED
                                 && (aarch64_tune_params.extra_tuning_flags \
                                     & AARCH64_EXTRA_TUNE_AVOID_PRED_RMW))
 
+/* fp8 instructions are enabled through +fp8.  */
+#define TARGET_FP8 AARCH64_HAVE_ISA (FP8)
+
 /* Standard register usage.  */
 
 /* 31 64-bit general purpose registers R0-R30:
index 86f9b5d1fe5eae2e9dc3ec8301c6f7b05d1947ca..ef2213b4e8419fb4fb8b9f868e2b51a5ef7526b5 100644 (file)
@@ -21849,6 +21849,8 @@ Enable support for Armv9.4-a Guarded Control Stack extension.
 Enable support for Armv8.9-a/9.4-a translation hardening extension.
 @item rcpc3
 Enable the RCpc3 (Release Consistency) extension.
+@item fp8
+Enable the fp8 (8-bit floating point) extension.
 
 @end table
 
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/fp8.c b/gcc/testsuite/gcc.target/aarch64/acle/fp8.c
new file mode 100644 (file)
index 0000000..459442b
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test the fp8 ACLE intrinsics family.  */
+/* { dg-do compile } */
+/* { dg-options "-O1 -march=armv8-a" } */
+
+#include <arm_acle.h>
+
+#ifdef __ARM_FEATURE_FP8
+#error "__ARM_FEATURE_FP8 feature macro defined."
+#endif
+
+#pragma GCC push_options
+#pragma GCC target("arch=armv9.4-a+fp8")
+
+/* We do not define __ARM_FEATURE_FP8 until all
+   relevant features have been added. */
+#ifdef __ARM_FEATURE_FP8
+#error "__ARM_FEATURE_FP8 feature macro defined."
+#endif
+
+#pragma GCC pop_options