opcodes: i386: fix dw2_regnum data type in reg_entry

Message ID 20240109011229.4191052-1-indu.bhagat@oracle.com
State Accepted
Headers
Series opcodes: i386: fix dw2_regnum data type in reg_entry |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Indu Bhagat Jan. 9, 2024, 1:12 a.m. UTC
  The DWARF register numbers for the APX EGRPs start with 130.  The data
type holding the same currently is signed char.

ChangeLog:
	* opcodes/i386-opc.h (reg_entry): Bump to signed short.
---
 opcodes/i386-opc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jan Beulich Jan. 9, 2024, 8:24 a.m. UTC | #1
On 09.01.2024 02:12, Indu Bhagat wrote:
> The DWARF register numbers for the APX EGRPs start with 130.  The data
> type holding the same currently is signed char.
> 
> ChangeLog:
> 	* opcodes/i386-opc.h (reg_entry): Bump to signed short.

So yes, something needs doing. But there are further questions to be
raised to the original authors: Was the code tested at all in this
regard? Why do numbers start at 130, when according to i386-reg.tbl
128 and 129 are unused (and would hence be more natural to [also]
use)?

> --- a/opcodes/i386-opc.h
> +++ b/opcodes/i386-opc.h
> @@ -1047,7 +1047,7 @@ typedef struct
>  #define RegIZ	(RegIP - 1)
>  /* FLAT is a fake segment register (Intel mode).  */
>  #define RegFlat     ((unsigned char) ~0)
> -  signed char dw2_regnum[2];
> +  signed short dw2_regnum[2];
>  #define Dw2Inval (-1)
>  }
>  reg_entry;

It's a little sad that non-64-bit field also has its size increased.
Right now either way the structure size as a whole is the same, but
down the road this may end up a little wasteful.

Jan
  
Kong, Lingling Jan. 11, 2024, 1:35 a.m. UTC | #2
> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Tuesday, January 9, 2024 4:25 PM
> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili <lili.cui@intel.com>; H.J. Lu
> <hjl.tools@gmail.com>; Kong, Lingling <lingling.kong@intel.com>; Hu, Lin1
> <lin1.hu@intel.com>
> Cc: binutils@sourceware.org
> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
> 
> On 09.01.2024 02:12, Indu Bhagat wrote:
> > The DWARF register numbers for the APX EGRPs start with 130.  The data
> > type holding the same currently is signed char.
> >
> > ChangeLog:
> > 	* opcodes/i386-opc.h (reg_entry): Bump to signed short.
> 
> So yes, something needs doing. But there are further questions to be raised to the
> original authors: Was the code tested at all in this regard? Why do numbers start
> at 130, when according to i386-reg.tbl
> 128 and 129 are unused (and would hence be more natural to [also] use)?
> 

Hi,

This is because for some historical reasons, some numbers(126-129) have been agreed to be reserved.
Details can be found in https://groups.google.com/g/x86-64-abi/c/GS8LZf5nQFk.

Thanks!
Lingling

-> > --- a/opcodes/i386-opc.h
> > +++ b/opcodes/i386-opc.h
> > @@ -1047,7 +1047,7 @@ typedef struct
> >  #define RegIZ	(RegIP - 1)
> >  /* FLAT is a fake segment register (Intel mode).  */
> >  #define RegFlat     ((unsigned char) ~0)
> > -  signed char dw2_regnum[2];
> > +  signed short dw2_regnum[2];
> >  #define Dw2Inval (-1)
> >  }
> >  reg_entry;
> 
> It's a little sad that non-64-bit field also has its size increased.
> Right now either way the structure size as a whole is the same, but down the
> road this may end up a little wasteful.
> 
> Jan
  
Jan Beulich Jan. 11, 2024, 7:43 a.m. UTC | #3
On 11.01.2024 02:35, Kong, Lingling wrote:
> 
> 
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@suse.com>
>> Sent: Tuesday, January 9, 2024 4:25 PM
>> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili <lili.cui@intel.com>; H.J. Lu
>> <hjl.tools@gmail.com>; Kong, Lingling <lingling.kong@intel.com>; Hu, Lin1
>> <lin1.hu@intel.com>
>> Cc: binutils@sourceware.org
>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
>>
>> On 09.01.2024 02:12, Indu Bhagat wrote:
>>> The DWARF register numbers for the APX EGRPs start with 130.  The data
>>> type holding the same currently is signed char.
>>>
>>> ChangeLog:
>>> 	* opcodes/i386-opc.h (reg_entry): Bump to signed short.
>>
>> So yes, something needs doing. But there are further questions to be raised to the
>> original authors: Was the code tested at all in this regard? Why do numbers start
>> at 130, when according to i386-reg.tbl
>> 128 and 129 are unused (and would hence be more natural to [also] use)?
> 
> This is because for some historical reasons, some numbers(126-129) have been agreed to be reserved.
> Details can be found in https://groups.google.com/g/x86-64-abi/c/GS8LZf5nQFk.

I'm sorry, there are no details there. There's merely mention of these four
being reserved, without supplying any reason (historical or not).

Jan
  
Kong, Lingling Jan. 11, 2024, 7:59 a.m. UTC | #4
> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Thursday, January 11, 2024 3:43 PM
> To: Kong, Lingling <lingling.kong@intel.com>
> Cc: binutils@sourceware.org; Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Hu, Lin1
> <lin1.hu@intel.com>
> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
> 
> On 11.01.2024 02:35, Kong, Lingling wrote:
> >
> >
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@suse.com>
> >> Sent: Tuesday, January 9, 2024 4:25 PM
> >> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
> >> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Kong, Lingling
> >> <lingling.kong@intel.com>; Hu, Lin1 <lin1.hu@intel.com>
> >> Cc: binutils@sourceware.org
> >> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in
> >> reg_entry
> >>
> >> On 09.01.2024 02:12, Indu Bhagat wrote:
> >>> The DWARF register numbers for the APX EGRPs start with 130.  The
> >>> data type holding the same currently is signed char.
> >>>
> >>> ChangeLog:
> >>> 	* opcodes/i386-opc.h (reg_entry): Bump to signed short.
> >>
> >> So yes, something needs doing. But there are further questions to be
> >> raised to the original authors: Was the code tested at all in this
> >> regard? Why do numbers start at 130, when according to i386-reg.tbl
> >> 128 and 129 are unused (and would hence be more natural to [also] use)?
> >
> > This is because for some historical reasons, some numbers(126-129) have been
> agreed to be reserved.
> > Details can be found in https://groups.google.com/g/x86-64-
> abi/c/GS8LZf5nQFk.
> 
> I'm sorry, there are no details there. There's merely mention of these four being
> reserved, without supplying any reason (historical or not).
> 
> Jan

Sorry, you could see https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6207f9a2c0645f20a7ec591a09e4c382b1675784
There are reserved  for Intel MPX (Memory Protection Extensions) provides 4 128-bit wide bound registers (reg{bnd0} - reg{bnd3}).
  
Jan Beulich Jan. 11, 2024, 8:05 a.m. UTC | #5
On 11.01.2024 08:59, Kong, Lingling wrote:
> 
> 
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@suse.com>
>> Sent: Thursday, January 11, 2024 3:43 PM
>> To: Kong, Lingling <lingling.kong@intel.com>
>> Cc: binutils@sourceware.org; Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Hu, Lin1
>> <lin1.hu@intel.com>
>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
>>
>> On 11.01.2024 02:35, Kong, Lingling wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Jan Beulich <jbeulich@suse.com>
>>>> Sent: Tuesday, January 9, 2024 4:25 PM
>>>> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Kong, Lingling
>>>> <lingling.kong@intel.com>; Hu, Lin1 <lin1.hu@intel.com>
>>>> Cc: binutils@sourceware.org
>>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in
>>>> reg_entry
>>>>
>>>> On 09.01.2024 02:12, Indu Bhagat wrote:
>>>>> The DWARF register numbers for the APX EGRPs start with 130.  The
>>>>> data type holding the same currently is signed char.
>>>>>
>>>>> ChangeLog:
>>>>> 	* opcodes/i386-opc.h (reg_entry): Bump to signed short.
>>>>
>>>> So yes, something needs doing. But there are further questions to be
>>>> raised to the original authors: Was the code tested at all in this
>>>> regard? Why do numbers start at 130, when according to i386-reg.tbl
>>>> 128 and 129 are unused (and would hence be more natural to [also] use)?
>>>
>>> This is because for some historical reasons, some numbers(126-129) have been
>> agreed to be reserved.
>>> Details can be found in https://groups.google.com/g/x86-64-
>> abi/c/GS8LZf5nQFk.
>>
>> I'm sorry, there are no details there. There's merely mention of these four being
>> reserved, without supplying any reason (historical or not).
> 
> Sorry, you could see https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6207f9a2c0645f20a7ec591a09e4c382b1675784
> There are reserved  for Intel MPX (Memory Protection Extensions) provides 4 128-bit wide bound registers (reg{bnd0} - reg{bnd3}).

Then why aren't these marked that way? The commit introducing them to
opcodes used Dw2Inval, and it was never changed from that (i.e. there
wasn't even deliberate undoing with respective justification).

Jan
  
H.J. Lu Jan. 11, 2024, 1:27 p.m. UTC | #6
On Thu, Jan 11, 2024 at 12:05 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 11.01.2024 08:59, Kong, Lingling wrote:
> >
> >
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@suse.com>
> >> Sent: Thursday, January 11, 2024 3:43 PM
> >> To: Kong, Lingling <lingling.kong@intel.com>
> >> Cc: binutils@sourceware.org; Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
> >> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Hu, Lin1
> >> <lin1.hu@intel.com>
> >> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
> >>
> >> On 11.01.2024 02:35, Kong, Lingling wrote:
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Jan Beulich <jbeulich@suse.com>
> >>>> Sent: Tuesday, January 9, 2024 4:25 PM
> >>>> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
> >>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Kong, Lingling
> >>>> <lingling.kong@intel.com>; Hu, Lin1 <lin1.hu@intel.com>
> >>>> Cc: binutils@sourceware.org
> >>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in
> >>>> reg_entry
> >>>>
> >>>> On 09.01.2024 02:12, Indu Bhagat wrote:
> >>>>> The DWARF register numbers for the APX EGRPs start with 130.  The
> >>>>> data type holding the same currently is signed char.
> >>>>>
> >>>>> ChangeLog:
> >>>>>   * opcodes/i386-opc.h (reg_entry): Bump to signed short.
> >>>>
> >>>> So yes, something needs doing. But there are further questions to be
> >>>> raised to the original authors: Was the code tested at all in this
> >>>> regard? Why do numbers start at 130, when according to i386-reg.tbl
> >>>> 128 and 129 are unused (and would hence be more natural to [also] use)?
> >>>
> >>> This is because for some historical reasons, some numbers(126-129) have been
> >> agreed to be reserved.
> >>> Details can be found in https://groups.google.com/g/x86-64-
> >> abi/c/GS8LZf5nQFk.
> >>
> >> I'm sorry, there are no details there. There's merely mention of these four being
> >> reserved, without supplying any reason (historical or not).
> >
> > Sorry, you could see https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6207f9a2c0645f20a7ec591a09e4c382b1675784
> > There are reserved  for Intel MPX (Memory Protection Extensions) provides 4 128-bit wide bound registers (reg{bnd0} - reg{bnd3}).
>
> Then why aren't these marked that way? The commit introducing them to
> opcodes used Dw2Inval, and it was never changed from that (i.e. there
> wasn't even deliberate undoing with respective justification).
>

Leave them as reserved.  We have plenty.
  
Jan Beulich Jan. 11, 2024, 2:05 p.m. UTC | #7
On 11.01.2024 14:27, H.J. Lu wrote:
> On Thu, Jan 11, 2024 at 12:05 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 11.01.2024 08:59, Kong, Lingling wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Jan Beulich <jbeulich@suse.com>
>>>> Sent: Thursday, January 11, 2024 3:43 PM
>>>> To: Kong, Lingling <lingling.kong@intel.com>
>>>> Cc: binutils@sourceware.org; Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Hu, Lin1
>>>> <lin1.hu@intel.com>
>>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
>>>>
>>>> On 11.01.2024 02:35, Kong, Lingling wrote:
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Jan Beulich <jbeulich@suse.com>
>>>>>> Sent: Tuesday, January 9, 2024 4:25 PM
>>>>>> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>>>>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Kong, Lingling
>>>>>> <lingling.kong@intel.com>; Hu, Lin1 <lin1.hu@intel.com>
>>>>>> Cc: binutils@sourceware.org
>>>>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in
>>>>>> reg_entry
>>>>>>
>>>>>> On 09.01.2024 02:12, Indu Bhagat wrote:
>>>>>>> The DWARF register numbers for the APX EGRPs start with 130.  The
>>>>>>> data type holding the same currently is signed char.
>>>>>>>
>>>>>>> ChangeLog:
>>>>>>>   * opcodes/i386-opc.h (reg_entry): Bump to signed short.
>>>>>>
>>>>>> So yes, something needs doing. But there are further questions to be
>>>>>> raised to the original authors: Was the code tested at all in this
>>>>>> regard? Why do numbers start at 130, when according to i386-reg.tbl
>>>>>> 128 and 129 are unused (and would hence be more natural to [also] use)?
>>>>>
>>>>> This is because for some historical reasons, some numbers(126-129) have been
>>>> agreed to be reserved.
>>>>> Details can be found in https://groups.google.com/g/x86-64-
>>>> abi/c/GS8LZf5nQFk.
>>>>
>>>> I'm sorry, there are no details there. There's merely mention of these four being
>>>> reserved, without supplying any reason (historical or not).
>>>
>>> Sorry, you could see https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6207f9a2c0645f20a7ec591a09e4c382b1675784
>>> There are reserved  for Intel MPX (Memory Protection Extensions) provides 4 128-bit wide bound registers (reg{bnd0} - reg{bnd3}).
>>
>> Then why aren't these marked that way? The commit introducing them to
>> opcodes used Dw2Inval, and it was never changed from that (i.e. there
>> wasn't even deliberate undoing with respective justification).
> 
> Leave them as reserved.  We have plenty.

Hmm, the latter sentence doesn't fir what I meant: Why does / did
i386-reg.tbl not / never have those numbers? I could have seen that
they were there and then possibly have been purged, but even then
I would expect there a comment to have been left. So minimally what
I'd like to see / do is to add such comments.

Jan
  
Indu Bhagat Jan. 20, 2024, 12:45 a.m. UTC | #8
On 1/11/24 06:05, Jan Beulich wrote:
> On 11.01.2024 14:27, H.J. Lu wrote:
>> On Thu, Jan 11, 2024 at 12:05 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>
>>> On 11.01.2024 08:59, Kong, Lingling wrote:
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Jan Beulich <jbeulich@suse.com>
>>>>> Sent: Thursday, January 11, 2024 3:43 PM
>>>>> To: Kong, Lingling <lingling.kong@intel.com>
>>>>> Cc: binutils@sourceware.org; Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>>>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Hu, Lin1
>>>>> <lin1.hu@intel.com>
>>>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
>>>>>
>>>>> On 11.01.2024 02:35, Kong, Lingling wrote:
>>>>>>
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Jan Beulich <jbeulich@suse.com>
>>>>>>> Sent: Tuesday, January 9, 2024 4:25 PM
>>>>>>> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>>>>>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Kong, Lingling
>>>>>>> <lingling.kong@intel.com>; Hu, Lin1 <lin1.hu@intel.com>
>>>>>>> Cc: binutils@sourceware.org
>>>>>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in
>>>>>>> reg_entry
>>>>>>>
>>>>>>> On 09.01.2024 02:12, Indu Bhagat wrote:
>>>>>>>> The DWARF register numbers for the APX EGRPs start with 130.  The
>>>>>>>> data type holding the same currently is signed char.
>>>>>>>>
>>>>>>>> ChangeLog:
>>>>>>>>    * opcodes/i386-opc.h (reg_entry): Bump to signed short.
>>>>>>>
>>>>>>> So yes, something needs doing. But there are further questions to be
>>>>>>> raised to the original authors: Was the code tested at all in this
>>>>>>> regard? Why do numbers start at 130, when according to i386-reg.tbl
>>>>>>> 128 and 129 are unused (and would hence be more natural to [also] use)?
>>>>>>
>>>>>> This is because for some historical reasons, some numbers(126-129) have been
>>>>> agreed to be reserved.
>>>>>> Details can be found in https://groups.google.com/g/x86-64-
>>>>> abi/c/GS8LZf5nQFk.
>>>>>
>>>>> I'm sorry, there are no details there. There's merely mention of these four being
>>>>> reserved, without supplying any reason (historical or not).
>>>>
>>>> Sorry, you could see https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6207f9a2c0645f20a7ec591a09e4c382b1675784
>>>> There are reserved  for Intel MPX (Memory Protection Extensions) provides 4 128-bit wide bound registers (reg{bnd0} - reg{bnd3}).
>>>
>>> Then why aren't these marked that way? The commit introducing them to
>>> opcodes used Dw2Inval, and it was never changed from that (i.e. there
>>> wasn't even deliberate undoing with respective justification).
>>
>> Leave them as reserved.  We have plenty.
> 
> Hmm, the latter sentence doesn't fir what I meant: Why does / did
> i386-reg.tbl not / never have those numbers? I could have seen that
> they were there and then possibly have been purged, but even then
> I would expect there a comment to have been left. So minimally what
> I'd like to see / do is to add such comments.
> 

Is the patch (opcodes: i386: fix dw2_regnum data type in reg_entry) OK 
to commit now ?

Thanks
Indu
  
Jan Beulich Jan. 22, 2024, 7:49 a.m. UTC | #9
On 20.01.2024 01:45, Indu Bhagat wrote:
> On 1/11/24 06:05, Jan Beulich wrote:
>> On 11.01.2024 14:27, H.J. Lu wrote:
>>> On Thu, Jan 11, 2024 at 12:05 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>
>>>> On 11.01.2024 08:59, Kong, Lingling wrote:
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Jan Beulich <jbeulich@suse.com>
>>>>>> Sent: Thursday, January 11, 2024 3:43 PM
>>>>>> To: Kong, Lingling <lingling.kong@intel.com>
>>>>>> Cc: binutils@sourceware.org; Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>>>>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Hu, Lin1
>>>>>> <lin1.hu@intel.com>
>>>>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in reg_entry
>>>>>>
>>>>>> On 11.01.2024 02:35, Kong, Lingling wrote:
>>>>>>>
>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Jan Beulich <jbeulich@suse.com>
>>>>>>>> Sent: Tuesday, January 9, 2024 4:25 PM
>>>>>>>> To: Indu Bhagat <indu.bhagat@oracle.com>; Cui, Lili
>>>>>>>> <lili.cui@intel.com>; H.J. Lu <hjl.tools@gmail.com>; Kong, Lingling
>>>>>>>> <lingling.kong@intel.com>; Hu, Lin1 <lin1.hu@intel.com>
>>>>>>>> Cc: binutils@sourceware.org
>>>>>>>> Subject: Re: [PATCH] opcodes: i386: fix dw2_regnum data type in
>>>>>>>> reg_entry
>>>>>>>>
>>>>>>>> On 09.01.2024 02:12, Indu Bhagat wrote:
>>>>>>>>> The DWARF register numbers for the APX EGRPs start with 130.  The
>>>>>>>>> data type holding the same currently is signed char.
>>>>>>>>>
>>>>>>>>> ChangeLog:
>>>>>>>>>    * opcodes/i386-opc.h (reg_entry): Bump to signed short.
>>>>>>>>
>>>>>>>> So yes, something needs doing. But there are further questions to be
>>>>>>>> raised to the original authors: Was the code tested at all in this
>>>>>>>> regard? Why do numbers start at 130, when according to i386-reg.tbl
>>>>>>>> 128 and 129 are unused (and would hence be more natural to [also] use)?
>>>>>>>
>>>>>>> This is because for some historical reasons, some numbers(126-129) have been
>>>>>> agreed to be reserved.
>>>>>>> Details can be found in https://groups.google.com/g/x86-64-
>>>>>> abi/c/GS8LZf5nQFk.
>>>>>>
>>>>>> I'm sorry, there are no details there. There's merely mention of these four being
>>>>>> reserved, without supplying any reason (historical or not).
>>>>>
>>>>> Sorry, you could see https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6207f9a2c0645f20a7ec591a09e4c382b1675784
>>>>> There are reserved  for Intel MPX (Memory Protection Extensions) provides 4 128-bit wide bound registers (reg{bnd0} - reg{bnd3}).
>>>>
>>>> Then why aren't these marked that way? The commit introducing them to
>>>> opcodes used Dw2Inval, and it was never changed from that (i.e. there
>>>> wasn't even deliberate undoing with respective justification).
>>>
>>> Leave them as reserved.  We have plenty.
>>
>> Hmm, the latter sentence doesn't fir what I meant: Why does / did
>> i386-reg.tbl not / never have those numbers? I could have seen that
>> they were there and then possibly have been purged, but even then
>> I would expect there a comment to have been left. So minimally what
>> I'd like to see / do is to add such comments.
> 
> Is the patch (opcodes: i386: fix dw2_regnum data type in reg_entry) OK 
> to commit now ?

To be honest - not sure. I'd like to look into avoiding the growth, by
switching to "unsigned char" instead. But that requires changes elsewhere,
because of the need to double-check uses of (and maybe further special-
case) Dw2Inval.

Jan
  

Patch

diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index 61a11214914..38661ffe70c 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -1047,7 +1047,7 @@  typedef struct
 #define RegIZ	(RegIP - 1)
 /* FLAT is a fake segment register (Intel mode).  */
 #define RegFlat     ((unsigned char) ~0)
-  signed char dw2_regnum[2];
+  signed short dw2_regnum[2];
 #define Dw2Inval (-1)
 }
 reg_entry;