This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch AArch64 obvious] Fix expected string for fp16 extensions
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <nd at arm dot com>, <richard dot earnshaw at arm dot com>, <marcus dot shawcroft at arm dot com>
- Date: Tue, 20 Jun 2017 14:48:09 +0100
- Subject: [Patch AArch64 obvious] Fix expected string for fp16 extensions
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
As currently coded, the native detection of the fp16 architecture extension
from the ARMv8.2-A extensions looks for the string "fp16", but the kernel
exposes support of these features through two strings "fphp, for scalar
16-bit floating point support, and "asimdhp" for vector 16-bit floating-point
support [1].
This patch fixes the string we look for, looking for the pair of both
fphp and asimdhp.
I have no platform to test this on, so my testing is to show that it builds
and correctly enables the fp16 extension when given a faked up /proc/cpuinfo
I've committed this as obvious to trunk (as revision 249411) and gcc-7-branch
(as revision 249413).
Thanks,
James
[1] Patchwork arm64: Add support for Half precision floating point
https://patchwork.kernel.org/patch/8124451/
---
2017-06-20 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64-option-extensions.def (fp16): Fix expected
feature string.
diff --git a/gcc/config/aarch64/aarch64-option-extensions.def b/gcc/config/aarch64/aarch64-option-extensions.def
index 36766d9..b54de03 100644
--- a/gcc/config/aarch64/aarch64-option-extensions.def
+++ b/gcc/config/aarch64/aarch64-option-extensions.def
@@ -58,6 +58,6 @@ AARCH64_OPT_EXTENSION("lse", AARCH64_FL_LSE, 0, 0, "atomics")
/* Enabling "fp16" also enables "fp".
Disabling "fp16" just disables "fp16". */
-AARCH64_OPT_EXTENSION("fp16", AARCH64_FL_F16, AARCH64_FL_FP, 0, "fp16")
+AARCH64_OPT_EXTENSION("fp16", AARCH64_FL_F16, AARCH64_FL_FP, 0, "fphp asimdhp")
#undef AARCH64_OPT_EXTENSION