public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
To: "Andre Vieira (lists)" <andre.simoesdiasvieira@arm.com>,
	srinath <srinath.parvathaneni@arm.com>,
	binutils@sourceware.org
Cc: nickc@redhat.com
Subject: Re: [PATCH v1 10/11] [Binutils] aarch64: Fix FEAT_B16B16 sve2 instruction constraints.
Date: Fri, 14 Jun 2024 17:20:37 +0100	[thread overview]
Message-ID: <843f078d-2201-4e05-8bf4-379f1cc08854@arm.com> (raw)
In-Reply-To: <3cbc3100-d03b-427a-b592-95dbecaf327b@arm.com>

On 14/06/2024 16:44, Andre Vieira (lists) wrote:
> 
> 
> On 13/06/2024 16:44, Richard Earnshaw (lists) wrote:
>> On 12/06/2024 16:59, srinath wrote:
>>>
>>> Hi,
>>>
>>> This patch adds missing contraints to FEAT_B16B16 sve2 instructions
>>> bfclamp, bfmla and bfmls and add negative tests for all the bfloat
>>> instructions.
>>>
>>> Regression tested for aarch64-none-elf target and found no regressions.
>>>
>>> Ok for binutils-master?
>>>
>>> Regards,
>>> Srinath.
>>> ---
>>>   gas/testsuite/gas/aarch64/bfloat16-1.d        |   6 +
>>>   gas/testsuite/gas/aarch64/bfloat16-1.s        |   7 +-
>>>   .../gas/aarch64/bfloat16-2-invalid.d          |   4 +
>>>   .../gas/aarch64/bfloat16-2-invalid.l          | 265 ++++++++++++++++++
>>>   .../gas/aarch64/bfloat16-2-invalid.s          | 147 ++++++++++
>>>   gas/testsuite/gas/aarch64/bfloat16-bad.l      |   3 +
>>>   gas/testsuite/gas/aarch64/bfloat16-invalid.d  |   2 +-
>>>   gas/testsuite/gas/aarch64/bfloat16-invalid.l  |  17 +-
>>>   gas/testsuite/gas/aarch64/bfloat16-invalid.s  |   9 +-
>>>   opcodes/aarch64-tbl.h                         |  46 +--
>>>   10 files changed, 468 insertions(+), 38 deletions(-)
>>>   create mode 100644 gas/testsuite/gas/aarch64/bfloat16-2-invalid.d
>>>   create mode 100644 gas/testsuite/gas/aarch64/bfloat16-2-invalid.l
>>>   create mode 100644 gas/testsuite/gas/aarch64/bfloat16-2-invalid.s
>>>
>> --- a/gas/testsuite/gas/aarch64/bfloat16-invalid.l
>> +++ b/gas/testsuite/gas/aarch64/bfloat16-invalid.l
>> ...
>> +.*: Error: operand 3 must be the same register as operand 1 -- `bfmul .*
>> +.*: Error: operand 3 must be the same register as operand 1 -- `bfsub .*
>> +.*: Error: selected processor does not support `bfclamp z3.h,z4.h,z16.h'
>> +.*: Error: selected processor does not support `bfmla z3.h,z16.h,z6.h\[7\]'
>> +.*: Error: selected processor does not support `bfmls z3.h,z16.h,z6.h\[7\]'
>>
>> It doesn't seem right to me that a test that is supposedly checking for invalid operand combinations would be reporting unsupported instructions.  Perhaps these should be in a separate test with different command-line options?
> 
> I think you misunderstood here Richard, Srinath turned this test into a 'wrong command-line option/unsupported test' see:
> diff --git a/gas/testsuite/gas/aarch64/bfloat16-invalid.d b/gas/testsuite/gas/aarch64/bfloat16-invalid.d
> index 8f24dc62083..02e3e8d8e3d 100644
> --- a/gas/testsuite/gas/aarch64/bfloat16-invalid.d
> +++ b/gas/testsuite/gas/aarch64/bfloat16-invalid.d
> @@ -1,4 +1,4 @@
> -#name: Test Bfloat16 instructions with wrong operand combinations
> +#name: Negative test with missing +b16b16 bfloat16 flag.

That doesn't make sense to me.  Why change an existing test for one thing into a different test that does something else?  The existing test entries in the file now no-longer match the test summary.

This sort of change should be highlighted in the patch summary; patch review for complex patches is difficult enough as it is, without explanations as to why certain changes are made it's nearly impossible to intuit the reasoning behind the changes.

> 
> The reason you got confused I think is because it also has wrong operand errors, which is because gas reports these before it reports missing support. It does so for other features too mind you, so we are consistent here AFAICT.

Everything in the existing bfloat16-invalid.l is an operand test, so why conflate this with something else?  That doesn't look consistent to me.

Perhaps this could be addressed by writing it in the style of mops_invalid.[sdl] where we change the architecture features on the fly to test different errors.  It would also help if the assembler source had some comments about the expected failures.  

> 
> I do think however, that this test should have at least one of each of the new instructions with proper operands, so that we can make sure the test checks these are unsupported. For instance bfadd is only in here with wrong operands. So it's not actually testing that we don't support bfadd with -march=armv9.4-a
> 
> Whether we should also include wrong operands here, testing that gas checks those before support for the actual instruction is a decision that I'll leave to you Richard.  On one side if we decide to change the behavior we'd have to go back and change these files, but that itself may be a benefit to having the tests... we could make sure the behavior doesn't change unnoticed.


R.

  reply	other threads:[~2024-06-14 16:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 15:58 [PATCH v2 0/11][Binutils] aarch64: Fix the FEAT_SVE2p1 related issues srinath
2024-06-12 15:58 ` [PATCH v1 01/11] [Binutils] aarch64: Enable mandatory feature bits for v9.4-A srinath
2024-06-12 15:59 ` [PATCH v2 02/11] [Binutils] aarch64: Fix sve2p1 dupq instruction operands srinath
2024-06-13  6:20   ` Jan Beulich
2024-06-12 15:59 ` [PATCH v1 03/11] [Binutils] aarch64: Fix sve2p1 dupq instruction operands (regenerated files) srinath
2024-06-12 15:59 ` [PATCH v1 04/11] [Binutils] aarch64: Fix sve2p1 extq instruction operands srinath
2024-06-13  6:24   ` Jan Beulich
2024-06-12 15:59 ` [PATCH v1 05/11] [Binutils] aarch64: Fix sve2p1 extq instruction operands (regenerated files) srinath
2024-06-12 15:59 ` [PATCH v2 06/11] [Binutils] aarch64: Fix sve2p1 ld[1-4]/st[1-4]q instruction operands srinath
2024-06-13 15:10   ` Richard Earnshaw (lists)
2024-06-12 15:59 ` [PATCH v1 07/11] [Binutils] aarch64: Fix sve2p1 ld[1-4]/st[1-4]q instruction operands (regenerated files) srinath
2024-06-12 15:59 ` [PATCH v1 08/11] [BINUTILS] aarch64: Fix the wrong constraint used for sve2p1 instructions srinath
2024-06-12 15:59 ` [PATCH v1 09/11] [Binutils] aarch64: Add extra tests for sve2p1 min max instructions srinath
2024-06-12 15:59 ` [PATCH v1 10/11] [Binutils] aarch64: Fix FEAT_B16B16 sve2 instruction constraints srinath
2024-06-13 15:44   ` Richard Earnshaw (lists)
2024-06-14 15:44     ` Andre Vieira (lists)
2024-06-14 16:20       ` Richard Earnshaw (lists) [this message]
2024-06-12 15:59 ` [PATCH v1 11/11] [Binutils] aarch64: Fix FEAT_B16B16 sve2 instruction constraints (regenerated files) srinath

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=843f078d-2201-4e05-8bf4-379f1cc08854@arm.com \
    --to=richard.earnshaw@arm.com \
    --cc=andre.simoesdiasvieira@arm.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=srinath.parvathaneni@arm.com \
    /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).