public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: <binutils@sourceware.org>
Cc: <nickc@redhat.com>, Richard Earnshaw <rearnsha@arm.com>
Subject: [PATCH 03/11] arm: default to softvfp on armv6 or later cores
Date: Mon, 3 Jun 2024 12:49:04 +0100	[thread overview]
Message-ID: <20240603114912.4065598-4-rearnsha@arm.com> (raw)
In-Reply-To: <20240603114912.4065598-1-rearnsha@arm.com>

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]


From armv6 onwards a lot of cores started to come with a physical VFP
implementation; but many still did not and in some cases there are
both variants.  For the cores that lacked a physical VFP we would fall
back to FPU_NONE if the platform/ABI did not mandate something else.
To make matters worse, FPU_NONE is internal state used to imply
soft-fpa (ie a mixed-endian double format), so any use of .double in
hand-written assembly is almost certainly generating incorrect output.

That's undesirable, all these cores should really default to a softvfp
model.
---
 gas/config/tc-arm.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-arm-default-to-softvfp-on-armv6-or-later-cores.patch --]
[-- Type: text/x-patch; name="0003-arm-default-to-softvfp-on-armv6-or-later-cores.patch", Size: 3993 bytes --]

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 12e8f7cfc84..8452ea17a02 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -31458,10 +31458,10 @@ static const struct arm_cpu_option_table arm_cpus[] =
 	       FPU_ARCH_VFP_V2),
   ARM_CPU_OPT ("arm1136js",	  "ARM1136J-S",	       ARM_ARCH_V6,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("arm1136j-s",	  NULL,		       ARM_ARCH_V6,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("arm1136jfs",	  "ARM1136JF-S",       ARM_ARCH_V6,
 	       ARM_ARCH_NONE,
 	       FPU_ARCH_VFP_V2),
@@ -31473,22 +31473,22 @@ static const struct arm_cpu_option_table arm_cpus[] =
 	       FPU_ARCH_VFP_V2),
   ARM_CPU_OPT ("mpcorenovfp",	  "MPCore",	       ARM_ARCH_V6K,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("arm1156t2-s",	  NULL,		       ARM_ARCH_V6T2,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("arm1156t2f-s",	  NULL,		       ARM_ARCH_V6T2,
 	       ARM_ARCH_NONE,
 	       FPU_ARCH_VFP_V2),
   ARM_CPU_OPT ("arm1176jz-s",	  NULL,		       ARM_ARCH_V6KZ,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("arm1176jzf-s",	  NULL,		       ARM_ARCH_V6KZ,
 	       ARM_ARCH_NONE,
 	       FPU_ARCH_VFP_V2),
   ARM_CPU_OPT ("cortex-a5",	  "Cortex-A5",	       ARM_ARCH_V7A,
 	       ARM_FEATURE_CORE_LOW (ARM_EXT_MP | ARM_EXT_SEC),
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-a7",	  "Cortex-A7",	       ARM_ARCH_V7VE,
 	       ARM_ARCH_NONE,
 	       FPU_ARCH_NEON_VFP_V4),
@@ -31559,13 +31559,13 @@ static const struct arm_cpu_option_table arm_cpus[] =
 	       FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_DOTPROD),
   ARM_CPU_OPT ("cortex-r4",	  "Cortex-R4",	       ARM_ARCH_V7R,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-r4f",	  "Cortex-R4F",	       ARM_ARCH_V7R,
 	       ARM_ARCH_NONE,
 	       FPU_ARCH_VFP_V3D16),
   ARM_CPU_OPT ("cortex-r5",	  "Cortex-R5",	       ARM_ARCH_V7R,
 	       ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV),
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-r7",	  "Cortex-R7",	       ARM_ARCH_V7R,
 	       ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV),
 	       FPU_ARCH_VFP_V3D16),
@@ -31580,31 +31580,31 @@ static const struct arm_cpu_option_table arm_cpus[] =
 	      FPU_ARCH_NEON_VFP_ARMV8),
   ARM_CPU_OPT ("cortex-m35p",	  "Cortex-M35P",       ARM_ARCH_V8M_MAIN,
 	       ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP | ARM_EXT_V6_DSP),
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m33",	  "Cortex-M33",	       ARM_ARCH_V8M_MAIN,
 	       ARM_FEATURE_CORE_LOW (ARM_EXT_V5ExP | ARM_EXT_V6_DSP),
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m23",	  "Cortex-M23",	       ARM_ARCH_V8M_BASE,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m7",	  "Cortex-M7",	       ARM_ARCH_V7EM,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m4",	  "Cortex-M4",	       ARM_ARCH_V7EM,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m3",	  "Cortex-M3",	       ARM_ARCH_V7M,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m1",	  "Cortex-M1",	       ARM_ARCH_V6SM,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m0",	  "Cortex-M0",	       ARM_ARCH_V6SM,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-m0plus",	  "Cortex-M0+",	       ARM_ARCH_V6SM,
 	       ARM_ARCH_NONE,
-	       FPU_NONE),
+	       FPU_ARCH_SOFTVFP),
   ARM_CPU_OPT ("cortex-x1",   "Cortex-X1",	       ARM_ARCH_V8_2A,
 	       ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST | ARM_EXT2_SB),
 	       FPU_ARCH_DOTPROD_NEON_VFP_ARMV8),

  parent reply	other threads:[~2024-06-03 11:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 11:49 [PATCH 00/11] arm: Remove FPA support from gas/binutils Richard Earnshaw
2024-06-03 11:49 ` [PATCH 01/11] arm: remove FPA related tests Richard Earnshaw
2024-06-03 11:49 ` [PATCH 02/11] arm: rename FPU_ARCH_VFP to FPU_ARCH_SOFTVFP Richard Earnshaw
2024-06-03 11:49 ` Richard Earnshaw [this message]
2024-06-03 11:49 ` [PATCH 04/11] arm: adjust FPU selection logic Richard Earnshaw
2024-06-03 11:49 ` [PATCH 05/11] arm: redirect fp constant data directives through a wrapper Richard Earnshaw
2024-06-03 11:49 ` [PATCH 06/11] arm: change default FPUs from FPA to none Richard Earnshaw
2024-06-03 11:49 ` [PATCH 07/11] arm: remove options to select the FPA Richard Earnshaw
2024-06-03 11:49 ` [PATCH 08/11] arm: remove FPA instructions from assembler Richard Earnshaw
2024-06-03 11:49 ` [PATCH 09/11] arm: remove disassembly support for the FPA co-processor Richard Earnshaw
2024-06-03 11:49 ` [PATCH 10/11] arm: minor documentation cleanup given removal of FPA Richard Earnshaw
2024-06-03 11:49 ` [PATCH 11/11] NEWS: arm: note that FPA support has been removed Richard Earnshaw
2024-06-03 15:14 [PATCH 00/11] [resend] arm: Remove FPA support from gas/binutils Richard Earnshaw
2024-06-03 15:14 ` [PATCH 03/11] arm: default to softvfp on armv6 or later cores Richard Earnshaw
2024-06-04 11:56 [PATCH 00/11] [2nd resend] arm: Remove FPA support from gas/binutils Richard Earnshaw
2024-06-04 11:56 ` [PATCH 03/11] arm: default to softvfp on armv6 or later cores Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240603114912.4065598-4-rearnsha@arm.com \
    --to=rearnsha@arm.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).