Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"When the going gets tough, the tough get empirical." -- Jon Carroll


devel / comp.arch / Re: double REX -- purpose of extra W bit?

SubjectAuthor
* double REX -- purpose of extra W bit?Peter Lund
`* Re: double REX -- purpose of extra W bit?MitchAlsup
 `* Re: double REX -- purpose of extra W bit?Peter Lund
  `* Re: double REX -- purpose of extra W bit?Timothy McCaffrey
   +- Re: double REX -- purpose of extra W bit?BGB
   `- Re: double REX -- purpose of extra W bit?Peter Lund

1
double REX -- purpose of extra W bit?

<f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33618&group=comp.arch#33618

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:bdc7:0:b0:76c:43b5:3563 with SMTP id n190-20020a37bdc7000000b0076c43b53563mr68265qkf.0.1691870140822;
Sat, 12 Aug 2023 12:55:40 -0700 (PDT)
X-Received: by 2002:a17:902:dace:b0:1bc:6a89:86bd with SMTP id
q14-20020a170902dace00b001bc6a8986bdmr2060869plx.10.1691870140545; Sat, 12
Aug 2023 12:55:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 12 Aug 2023 12:55:40 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=80.62.116.239; posting-account=iwcJjQoAAAAIecwT8pOXxaSOyiUTZMJr
NNTP-Posting-Host: 80.62.116.239
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com>
Subject: double REX -- purpose of extra W bit?
From: peterfirefly@gmail.com (Peter Lund)
Injection-Date: Sat, 12 Aug 2023 19:55:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1088
 by: Peter Lund - Sat, 12 Aug 2023 19:55 UTC

Mitch, can you reveal what you were going to use the second W bit for in the double REX proposal?

-Peter

Re: double REX -- purpose of extra W bit?

<c3381964-ee10-4d20-8d27-897af3447539n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33619&group=comp.arch#33619

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:5591:0:b0:63d:38fe:1657 with SMTP id f17-20020ad45591000000b0063d38fe1657mr63760qvx.7.1691872909883;
Sat, 12 Aug 2023 13:41:49 -0700 (PDT)
X-Received: by 2002:a17:902:e88a:b0:1b1:e9c0:4625 with SMTP id
w10-20020a170902e88a00b001b1e9c04625mr2246182plg.10.1691872909337; Sat, 12
Aug 2023 13:41:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sat, 12 Aug 2023 13:41:48 -0700 (PDT)
In-Reply-To: <f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:f13f:c8fd:311b:b1a;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:f13f:c8fd:311b:b1a
References: <f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c3381964-ee10-4d20-8d27-897af3447539n@googlegroups.com>
Subject: Re: double REX -- purpose of extra W bit?
From: MitchAlsup@aol.com (MitchAlsup)
Injection-Date: Sat, 12 Aug 2023 20:41:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1604
 by: MitchAlsup - Sat, 12 Aug 2023 20:41 UTC

On Saturday, August 12, 2023 at 2:55:42 PM UTC-5, Peter Lund wrote:
> Mitch, can you reveal what you were going to use the second W bit for in the double REX proposal?
>
> -Peter
<
If I had any insight I would be happy to divulge.
However, I do not.
<
{Enter pure speculation mode without any actual data}
<
W stands for "width"
<
{Exit pure speculation mode}

Re: double REX -- purpose of extra W bit?

<8417e000-efbe-4147-8780-541c00bb6fc8n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33622&group=comp.arch#33622

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ad4:55d4:0:b0:63d:3055:4815 with SMTP id bt20-20020ad455d4000000b0063d30554815mr83356qvb.7.1691913156422;
Sun, 13 Aug 2023 00:52:36 -0700 (PDT)
X-Received: by 2002:a17:903:22c3:b0:1bd:da96:dc74 with SMTP id
y3-20020a17090322c300b001bdda96dc74mr401352plg.6.1691913155894; Sun, 13 Aug
2023 00:52:35 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Sun, 13 Aug 2023 00:52:35 -0700 (PDT)
In-Reply-To: <c3381964-ee10-4d20-8d27-897af3447539n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.62.116.239; posting-account=iwcJjQoAAAAIecwT8pOXxaSOyiUTZMJr
NNTP-Posting-Host: 80.62.116.239
References: <f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com> <c3381964-ee10-4d20-8d27-897af3447539n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8417e000-efbe-4147-8780-541c00bb6fc8n@googlegroups.com>
Subject: Re: double REX -- purpose of extra W bit?
From: peterfirefly@gmail.com (Peter Lund)
Injection-Date: Sun, 13 Aug 2023 07:52:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2172
 by: Peter Lund - Sun, 13 Aug 2023 07:52 UTC

On Saturday, August 12, 2023 at 10:41:51 PM UTC+2, MitchAlsup wrote:
> On Saturday, August 12, 2023 at 2:55:42 PM UTC-5, Peter Lund wrote:
> > Mitch, can you reveal what you were going to use the second W bit for in the double REX proposal?
> >
> > -Peter
> <
> If I had any insight I would be happy to divulge.
> However, I do not.
> <
> {Enter pure speculation mode without any actual data}
> <
> W stands for "width"
> <
> {Exit pure speculation mode}

Each REX prefix has a 4-bit payload. There is an extra bit for the reg/index/base register specifiers + a bit to select 64-bit operands.

You mentioned that some people inside AMD toyed with allowing two REX prefixes per instruction. That would naturally allow for 32 registers instead of 16, but it would also give us two W bits. I am wondering what the second one would have been used for.

-Peter

Re: double REX -- purpose of extra W bit?

<f17aae84-638e-40df-8fa5-181ce8f0f1b2n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33637&group=comp.arch#33637

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5996:0:b0:40f:f509:3a75 with SMTP id e22-20020ac85996000000b0040ff5093a75mr148687qte.7.1692110812384;
Tue, 15 Aug 2023 07:46:52 -0700 (PDT)
X-Received: by 2002:a63:b745:0:b0:542:904c:41ed with SMTP id
w5-20020a63b745000000b00542904c41edmr2244809pgt.10.1692110812081; Tue, 15 Aug
2023 07:46:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Tue, 15 Aug 2023 07:46:51 -0700 (PDT)
In-Reply-To: <8417e000-efbe-4147-8780-541c00bb6fc8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=71.230.96.169; posting-account=ujX_IwoAAACu0_cef9hMHeR8g0ZYDNHh
NNTP-Posting-Host: 71.230.96.169
References: <f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com>
<c3381964-ee10-4d20-8d27-897af3447539n@googlegroups.com> <8417e000-efbe-4147-8780-541c00bb6fc8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f17aae84-638e-40df-8fa5-181ce8f0f1b2n@googlegroups.com>
Subject: Re: double REX -- purpose of extra W bit?
From: timcaffrey@aol.com (Timothy McCaffrey)
Injection-Date: Tue, 15 Aug 2023 14:46:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2490
 by: Timothy McCaffrey - Tue, 15 Aug 2023 14:46 UTC

On Sunday, August 13, 2023 at 3:52:38 AM UTC-4, Peter Lund wrote:
> On Saturday, August 12, 2023 at 10:41:51 PM UTC+2, MitchAlsup wrote:
> > On Saturday, August 12, 2023 at 2:55:42 PM UTC-5, Peter Lund wrote:
> > > Mitch, can you reveal what you were going to use the second W bit for in the double REX proposal?
> > >
> > > -Peter
> > <
> > If I had any insight I would be happy to divulge.
> > However, I do not.
> > <
> > {Enter pure speculation mode without any actual data}
> > <
> > W stands for "width"
> > <
> > {Exit pure speculation mode}
> Each REX prefix has a 4-bit payload. There is an extra bit for the reg/index/base register specifiers + a bit to select 64-bit operands.
>
> You mentioned that some people inside AMD toyed with allowing two REX prefixes per instruction. That would naturally allow for 32 registers instead of 16, but it would also give us two W bits. I am wondering what the second one would have been used for.
>
> -Peter

With 2 W bits they could be used to specify 8, 16, 32 or 64 bit operands. That might have been helpful.

- Tim

Re: double REX -- purpose of extra W bit?

<ubg8cr$2t2bc$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33638&group=comp.arch#33638

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: double REX -- purpose of extra W bit?
Date: Tue, 15 Aug 2023 11:16:25 -0500
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <ubg8cr$2t2bc$1@dont-email.me>
References: <f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com>
<c3381964-ee10-4d20-8d27-897af3447539n@googlegroups.com>
<8417e000-efbe-4147-8780-541c00bb6fc8n@googlegroups.com>
<f17aae84-638e-40df-8fa5-181ce8f0f1b2n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 15 Aug 2023 16:16:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="18762e91debc4614b4ae0126c707a3d8";
logging-data="3049836"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9SK+Hz6iPTC9QoxJ6cSrL"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:VKyBKsy6wl9UV+Lv3HM6PQNFqjo=
In-Reply-To: <f17aae84-638e-40df-8fa5-181ce8f0f1b2n@googlegroups.com>
Content-Language: en-US
 by: BGB - Tue, 15 Aug 2023 16:16 UTC

On 8/15/2023 9:46 AM, Timothy McCaffrey wrote:
> On Sunday, August 13, 2023 at 3:52:38 AM UTC-4, Peter Lund wrote:
>> On Saturday, August 12, 2023 at 10:41:51 PM UTC+2, MitchAlsup wrote:
>>> On Saturday, August 12, 2023 at 2:55:42 PM UTC-5, Peter Lund wrote:
>>>> Mitch, can you reveal what you were going to use the second W bit for in the double REX proposal?
>>>>
>>>> -Peter
>>> <
>>> If I had any insight I would be happy to divulge.
>>> However, I do not.
>>> <
>>> {Enter pure speculation mode without any actual data}
>>> <
>>> W stands for "width"
>>> <
>>> {Exit pure speculation mode}
>> Each REX prefix has a 4-bit payload. There is an extra bit for the reg/index/base register specifiers + a bit to select 64-bit operands.
>>
>> You mentioned that some people inside AMD toyed with allowing two REX prefixes per instruction. That would naturally allow for 32 registers instead of 16, but it would also give us two W bits. I am wondering what the second one would have been used for.
>>
>> -Peter
>
> With 2 W bits they could be used to specify 8, 16, 32 or 64 bit operands. That might have been helpful.
>

16-bit ops are unlikely to be all that useful, except for memory ops.

One other possibility could be interpreting it as "do this same
operation, but on an XMM register", say:
00: 32-bit GPR
01: 64-bit GPR
10: 64-bit XMM
11: 128-bit XMM

And/or, maybe a sub-mode which, rather than interpreting the extra bits
as more GPRs, instead bridges the GPR and XMM space:
0..15: R0..R15
16..31: XMM0..XMM15

So:
10: 64-bit XMM (Combined XMM+GPR)
11: 64-bit XMM (XMM Only)

So, one could be like, say:
ADD R8Q, XMM5
Or similar...

And thus reducing the number of MOVQ instructions or similar needed for
some types of tasks.

> - Tim

Re: double REX -- purpose of extra W bit?

<652048a3-db32-490d-b3f3-6f0a6fc2b4ban@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=33650&group=comp.arch#33650

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:908:b0:63f:c154:b92f with SMTP id dj8-20020a056214090800b0063fc154b92fmr33129qvb.9.1692213655503; Wed, 16 Aug 2023 12:20:55 -0700 (PDT)
X-Received: by 2002:a63:ee4b:0:b0:565:ed29:8244 with SMTP id n11-20020a63ee4b000000b00565ed298244mr145683pgk.3.1692213655205; Wed, 16 Aug 2023 12:20:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!69.80.99.18.MISMATCH!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Wed, 16 Aug 2023 12:20:54 -0700 (PDT)
In-Reply-To: <f17aae84-638e-40df-8fa5-181ce8f0f1b2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.62.116.239; posting-account=iwcJjQoAAAAIecwT8pOXxaSOyiUTZMJr
NNTP-Posting-Host: 80.62.116.239
References: <f4c87e70-6e24-4a08-afef-d0015f7f18f7n@googlegroups.com> <c3381964-ee10-4d20-8d27-897af3447539n@googlegroups.com> <8417e000-efbe-4147-8780-541c00bb6fc8n@googlegroups.com> <f17aae84-638e-40df-8fa5-181ce8f0f1b2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <652048a3-db32-490d-b3f3-6f0a6fc2b4ban@googlegroups.com>
Subject: Re: double REX -- purpose of extra W bit?
From: peterfirefly@gmail.com (Peter Lund)
Injection-Date: Wed, 16 Aug 2023 19:20:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 24
 by: Peter Lund - Wed, 16 Aug 2023 19:20 UTC

On Tuesday, August 15, 2023 at 4:46:54 PM UTC+2, Timothy McCaffrey wrote:
> With 2 W bits they could be used to specify 8, 16, 32 or 64 bit operands. That might have been helpful.

I doubt it. We can do 8/32 with the first 16 GPRs without extra prefixes (only a single REX prefix) and 8/32 with all 32 GPRs with two REX prefixes. We can do 16 with the first 16 GPRs with a size prefix + a REX prefix. Only in the case of 16-bits with all 32 GPRs would it require three prefix bytes (size prefix + 2 REX prefixes). Would it be worth it to use the second W bit to save one byte in extremely rare cases that any sane compiler will be able to avoid with the right register allocation?

I doubt it.

It could be used for something else that would only require a minor change to the encoding scheme (like the F0 map or maybe BGB's suggestion about XMM registers) and actually give a small benefit or it could be used for something more radical that entails a bigger change of the encoding scheme (so it had better be worth it) and maybe give a larger benefit.

Encoding 4 operand sizes in the two W bits really doesn't seem to be worth it.

-Peter

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor