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 11:55:04 +0200	[thread overview]
Message-ID: <0c7d04f6-06fe-3f8e-93ea-f33418213be4@suse.com> (raw)
In-Reply-To: <7fc3846e-6498-ee3b-efce-a28efe9ce519@palves.net>

On 06.05.2022 11:00, Pedro Alves wrote:
> Looking at the "Numbers" chapter in the manual:
> 
>  https://sourceware.org/binutils/docs/as/Numbers.html
> 
> we have:
> 
>  "Integers are numbers that would fit into an int in the C language. Bignums are integers, but they are stored in more than 32 bits."
> 
> I note it says "more than 32 bits", not "32 bits or more".
> 
> By my reading of the "Integers" and "Bignums" subsections, these integers are always signed.  Maybe
> that should be explicitly said in the manual, instead of introducing signed vs unsigned numbers?
> 
> And then, couldn't we make gas use int32_t for integers, and int64_t for Bignums (and clarify in the manual
> that "more than 32 bits" is exactly "64 bits"?  IOW, use int64_t instead of bfd_vma in the
> expression evaluation stuff.  

Bignums are quite a bit wider than 64 bits, and on 64-bit architectures
using just int32_t for integers is definitely insufficient (there are
pretty limited operations one can do on bignums). I'm afraid the doc is
simply outdated in talking about "int in C language"; it's more like
"long", and even then only in Unix-like environments, so it would likely
be even better to talk about {,u}intptr_t.

Jan

> That way, gas would be following what it documents, and 32-bit or 64-bit bfd would make no difference,
> and we'd get rid of a subtle host / --enable-64-bit-bfd -dependent behavior change for 32-bit ports.
> 
> Pedro Alves
> 


  reply	other threads:[~2022-05-06  9:55 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                 ` Jan Beulich [this message]
2022-05-06 10:01                   ` 32-bit archs, want64=true, and gas integers Pedro Alves
2022-05-06 10:17                     ` Jan Beulich
2022-05-06 10:43                       ` Pedro Alves
2022-05-06 11:55                         ` Jan Beulich
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=0c7d04f6-06fe-3f8e-93ea-f33418213be4@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).