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 04/11] arm: adjust FPU selection logic
Date: Mon, 3 Jun 2024 16:14:59 +0100	[thread overview]
Message-ID: <20240603151506.27126-5-rearnsha@arm.com> (raw)
In-Reply-To: <20240603151506.27126-1-rearnsha@arm.com>

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


The logic here seems to be overly complex, so simplify it a bit.  One
particular problem was that using the legacy -mno-fpu option was not
working properly, as this has all the feature bits set to zero causing
the code to then pick a different FPU as the default.  Fix this by
only selecting an FPU as a fallback if the code has not otherwise
selected one: there was only one route by which this could happen.

This patch is really a pre-cursor to the following one where we want
to make no-fpu internally a fall-back position for some legacy
processors where previously we would have dropped back to the FPA.
---
 gas/config/tc-arm.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-arm-adjust-FPU-selection-logic.patch --]
[-- Type: text/x-patch; name="0004-arm-adjust-FPU-selection-logic.patch", Size: 1135 bytes --]

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 8452ea17a02..9294619e1a4 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -187,7 +187,6 @@ static const arm_feature_set fpu_arch_vfp_v1 ATTRIBUTE_UNUSED = FPU_ARCH_VFP_V1;
 static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2;
 static const arm_feature_set fpu_arch_vfp_v3 ATTRIBUTE_UNUSED = FPU_ARCH_VFP_V3;
 static const arm_feature_set fpu_arch_neon_v1 ATTRIBUTE_UNUSED = FPU_ARCH_NEON_V1;
-static const arm_feature_set fpu_arch_fpa = FPU_ARCH_FPA;
 static const arm_feature_set fpu_any_hard = FPU_ANY_HARD;
 static const arm_feature_set fpu_endian_pure = FPU_ARCH_ENDIAN_PURE;
 
@@ -30817,19 +30816,13 @@ md_begin (void)
 	selected_fpu = *mcpu_fpu_opt;
       else if (march_fpu_opt)
 	selected_fpu = *march_fpu_opt;
+      else
+	selected_fpu = fpu_default;
 #else
       selected_fpu = fpu_default;
 #endif
     }
 
-  if (ARM_FEATURE_ZERO (selected_fpu))
-    {
-      if (!no_cpu_selected ())
-	selected_fpu = fpu_default;
-      else
-	selected_fpu = fpu_arch_fpa;
-    }
-
 #ifdef CPU_DEFAULT
   if (ARM_FEATURE_ZERO (selected_arch))
     {

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

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