public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Pedro Alves <pedro@palves.net>
Cc: Hans-Peter Nilsson <hp@axis.com>,
	binutils@sourceware.org, Alan Modra <amodra@gmail.com>
Subject: Re: 32-bit archs, want64=true, and gas integers
Date: Fri, 6 May 2022 13:55:55 +0200	[thread overview]
Message-ID: <df9f9f0a-9588-3a31-1a06-ab4e29c6d7f1@suse.com> (raw)
In-Reply-To: <8d88e540-d3b2-8a4c-05b0-a4020bb57816@palves.net>

On 06.05.2022 12:43, Pedro Alves wrote:
> I've never looked at gas code before, but I found the the code that parses integers,
> and it seems to automatically handle integers larger than 64-bit, by promoting to bignum.
> Maybe the ideal or the original intent was for integers to behave as as they had unlimited
> precision,

Well, not unlimited, but far higher.

> with non-bignum integers being an optimization?  And then make sure that all
> operations, including division would handle bignums too?

Don't know. To me the limitations of bignum don't look as if that might
have been the plan.

> Anyhow, here's a tentative patch of what I was imagining.  I'm not set up for testing
> this properly.  I was hoping one of you guys would like the idea so much that
> you'd run with it.  :-)

It look plausible at the first glance, but ...

> If something like this went in, then I assume that cris could go back to not setting
> want64=yes.
> 
> From 7fbbecc9eacd7e5dac076bfc25b099b9ff0ca1ac Mon Sep 17 00:00:00 2001
> From: Pedro Alves <pedro@palves.net>
> Date: Fri, 6 May 2022 11:15:11 +0100
> Subject: [PATCH] gas: make non-bignum integers be always 64-bit
> 
> Currently, on 32-bit hosts, gas integers are either 32-bit or 64-bit,
> depending on --enable-64-bit-bfd.  Make valueT be always uint64_t to
> make gas behave the same on all hosts.
> 
> Change-Id: I6258dfcd975ea9abb9cc4eb1d4e604a077df3033
> ---
>  gas/as.h   |  2 +-
>  gas/expr.c | 65 ++++++++++++++----------------------------------------
>  gas/expr.h |  1 -
>  3 files changed, 18 insertions(+), 50 deletions(-)
> 
> diff --git a/gas/as.h b/gas/as.h
> index 135abc8f23d..5b636cfd59a 100644
> --- a/gas/as.h
> +++ b/gas/as.h
> @@ -139,7 +139,7 @@ typedef bfd_vma addressT;
>  typedef bfd_signed_vma offsetT;
>  
>  /* Type of symbol value, etc.  For use in prototypes.  */
> -typedef addressT valueT;
> +typedef uint64_t valueT;

... I'd be afraid this might alter behavior for purely 32-bit targets.
Whether such a behavioral change would be deemed okay I'm not sure.

Jan


  reply	other threads:[~2022-05-06 11:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  7:56 [PATCH] Don't define ARCH_cris for BFD64 Luis Machado
2022-05-04  8:08 ` Alan Modra
2022-05-04  8:15   ` Luis Machado
2022-05-04  8:39     ` Alan Modra
2022-05-04 14:37       ` Hans-Peter Nilsson
2022-05-04 22:37         ` Alan Modra
2022-05-05  9:01           ` Luis Machado
2022-05-05 11:11           ` Pedro Alves
2022-05-05 12:56             ` Hans-Peter Nilsson
2022-05-06  0:56             ` Alan Modra
2022-05-06  2:35               ` Hans-Peter Nilsson
2022-05-06  9:09                 ` Luis Machado
2022-05-06  9:00               ` 32-bit archs, want64=true, and gas integers (Re: [PATCH] Don't define ARCH_cris for BFD64) Pedro Alves
2022-05-06  9:55                 ` 32-bit archs, want64=true, and gas integers Jan Beulich
2022-05-06 10:01                   ` Pedro Alves
2022-05-06 10:17                     ` Jan Beulich
2022-05-06 10:43                       ` Pedro Alves
2022-05-06 11:55                         ` Jan Beulich [this message]
2022-05-06 12:04                           ` Pedro Alves
2022-05-06 14:32                         ` Hans-Peter Nilsson
2022-05-06 14:44                           ` Pedro Alves
2022-05-07 20:19                             ` Hans-Peter Nilsson

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=df9f9f0a-9588-3a31-1a06-ab4e29c6d7f1@suse.com \
    --to=jbeulich@suse.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=hp@axis.com \
    --cc=pedro@palves.net \
    /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).