public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Paul Edwards" <mutazilah@gmail.com>
To: <gcc@gcc.gnu.org>
Subject: S390 should change the meaning of -m31
Date: Fri, 1 Oct 2021 08:01:22 +1000	[thread overview]
Message-ID: <565ECF9FBB50455BB3143CB350DEF7DE@DESKTOP0OKG1VA> (raw)

Hi Michael.

Thanks for picking up this issue. I have been working
with Jesus on this.

>> m31 is semantically the same as the m32 option.
>>
>>
>> The m31 option allows for 32 bit addressing and that is confusing since 
>> the m31 option in S390 would mean 2 GiB space addressing

> Indeed that's exactly what it means, and what it's supposed to mean.  On 
> s390, in AMODE(31) the toplevel bit of an (32bit) address is either 
> ignored or an indicator to switch back to 24bit addresses from the s360 
> times.  Either way that leaves 31 bits to generate the virtual address. 
> On s390 you indeed have a 2GB address space, not more.

He is using z/Arch and AM64.

But building with -m31.

>> Code used:
>>
>>     volatile uint64_t *gib_test = (volatile uint64_t *)0x7FFFFFFF;
>>     memset(gib_test, 1, 4096);
>>
>>
>> Hercules dump:
>>
>> r 0x7FFFFFFF-0x800001FF
>> R:000000007FFFFFFF:K:06=01 .

> I'm not sure what you believe to have demonstrated here.  The (virtual or 
> physical) address 0x7FFFFFFF is either (in AMODE(24)) equivalent to 
> 0x00ffffff or to 0xffffffff (in AMODE(31)), either way, the top byte of 
> the addressable range ...

I don't think that's what Hercules does for a real
memory display - it will instead say out of range.
But it doesn't matter, because we're using
64-bit Hercules with 4 GiB of memory and it doesn't
matter what the AMODE happens to be at any moment
in time, what is important is what is in that 4 GiB of
memory.

> The -mXX options are supposed to reflect the address space's size, not the 
> size of the general purpose registers.  An option that reflect AMODE(24) 
> would also be called -m24, despite the registers still being 32bit in 
> size.

The code generated by -m24 would be identical to
code generated by -m31 which would be identical to
code generated by -m32.

Why can't we just have a normal -m32 and accept -m31
and maybe -m24 too, and flag them as "obsolete"?

Thanks. Paul.


             reply	other threads:[~2021-09-30 22:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 22:01 Paul Edwards [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-08  8:02 Paul Edwards
2021-09-29 23:41 Jesus Antonio
2021-09-30 16:05 ` Michael Matz

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=565ECF9FBB50455BB3143CB350DEF7DE@DESKTOP0OKG1VA \
    --to=mutazilah@gmail.com \
    --cc=gcc@gcc.gnu.org \
    /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).