public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* APX ZU indication
@ 2024-04-05  6:40 Jan Beulich
  2024-04-28  7:43 ` Cui, Lili
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2024-04-05  6:40 UTC (permalink / raw)
  To: Lili Cui; +Cc: Binutils, H.J. Lu

Lili,

before you or your colleagues even get to coding this up, I'd like
to bring up this aspect, now that there is that "Assembly Syntax
Recommendations" do as well (without, sadly, offering any way for
providing feedback): For SETcc, embedding the indicator in the
mnemonic (or alternatively as some kind of mnemonic extension, along
the lines of {sae} or {nf}), simply expressing this via operands
would seem more tidy / readable:

	setnz	%eax

instead of, as that doc has it,

	setunz	%al

making clear at the first glance what register is updated. (Even
if said doc wouldn't be updated, I'd like us to consider supporting
such as an extension, right from the start.)

The situation is, admittedly, less clear for IMUL, as

	imul	$3, %dx, %ecx
	imulw	$3, (%rdx), %ecx

aren't entirely unambiguous - they could also indicate
multiplications storing the full 32-bit result in the destination.
Hence I don't mean to extend the above suggestion to IMUL.

Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: APX ZU indication
  2024-04-05  6:40 APX ZU indication Jan Beulich
@ 2024-04-28  7:43 ` Cui, Lili
  2024-04-29  6:50   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Cui, Lili @ 2024-04-28  7:43 UTC (permalink / raw)
  To: Beulich, Jan; +Cc: Binutils, H.J. Lu

> Lili,
> 
> before you or your colleagues even get to coding this up, I'd like to bring up
> this aspect, now that there is that "Assembly Syntax Recommendations" do
> as well (without, sadly, offering any way for providing feedback): For SETcc,
> embedding the indicator in the mnemonic (or alternatively as some kind of
> mnemonic extension, along the lines of {sae} or {nf}), simply expressing this
> via operands would seem more tidy / readable:
> 
> 	setnz	%eax
> 
> instead of, as that doc has it,
> 
> 	setunz	%al
> 

You meant setzunz, right?

> making clear at the first glance what register is updated. (Even if said doc
> wouldn't be updated, I'd like us to consider supporting such as an extension,
> right from the start.)
> 
> The situation is, admittedly, less clear for IMUL, as
> 
> 	imul	$3, %dx, %ecx
> 	imulw	$3, (%rdx), %ecx
> 
> aren't entirely unambiguous - they could also indicate multiplications storing
> the full 32-bit result in the destination.
> Hence I don't mean to extend the above suggestion to IMUL.
> 

Regarding how to express ZU of SETcc, we initially had a version similar to your suggestion, which is to change the size of reg to distinguish them, instead of the current distinction by adding suffix zu. The reason for the modification was to make the expression of ZU of SETcc and IMUL consistent. I think Binutils could support "setnz %eax", but gcc doesn't use it that way, this would make it seem a bit redundant.

Regards,
Lili.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: APX ZU indication
  2024-04-28  7:43 ` Cui, Lili
@ 2024-04-29  6:50   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2024-04-29  6:50 UTC (permalink / raw)
  To: Cui, Lili; +Cc: Binutils, H.J. Lu

On 28.04.2024 09:43, Cui, Lili wrote:
>> Lili,
>>
>> before you or your colleagues even get to coding this up, I'd like to bring up
>> this aspect, now that there is that "Assembly Syntax Recommendations" do
>> as well (without, sadly, offering any way for providing feedback): For SETcc,
>> embedding the indicator in the mnemonic (or alternatively as some kind of
>> mnemonic extension, along the lines of {sae} or {nf}), simply expressing this
>> via operands would seem more tidy / readable:
>>
>> 	setnz	%eax
>>
>> instead of, as that doc has it,
>>
>> 	setunz	%al
>>
> 
> You meant setzunz, right?

Indeed; too many 'z'. Part of why I dislike that "zu" infix, especially
when followed by a condition code (there's far less room for confusion with
IMUL).

>> making clear at the first glance what register is updated. (Even if said doc
>> wouldn't be updated, I'd like us to consider supporting such as an extension,
>> right from the start.)
>>
>> The situation is, admittedly, less clear for IMUL, as
>>
>> 	imul	$3, %dx, %ecx
>> 	imulw	$3, (%rdx), %ecx
>>
>> aren't entirely unambiguous - they could also indicate multiplications storing
>> the full 32-bit result in the destination.
>> Hence I don't mean to extend the above suggestion to IMUL.
>>
> 
> Regarding how to express ZU of SETcc, we initially had a version similar to your suggestion, which is to change the size of reg to distinguish them, instead of the current distinction by adding suffix zu. The reason for the modification was to make the expression of ZU of SETcc and IMUL consistent. I think Binutils could support "setnz %eax", but gcc doesn't use it that way, this would make it seem a bit redundant.

IMUL is an outlier anyway, so consistency there is of questionable value,
imo. If you/they insist on "zu" for SETcc, then may I ask that the spec at
least formally permit both variants? That'll kind of fit with permitting
variations on other APX aspects as well. (Yet better would be for the insn
page to explicitly name both forms.)

Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-29  6:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05  6:40 APX ZU indication Jan Beulich
2024-04-28  7:43 ` Cui, Lili
2024-04-29  6:50   ` Jan Beulich

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).