public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "Christoph Müllner" <christoph.muellner@vrull.eu>
Cc: Liao Shihua <shihua@iscas.ac.cn>,
	gcc-patches@gcc.gnu.org, kito.cheng@gmail.com,
	shiyulong@iscas.ac.cn, jiawei@iscas.ac.cn,
	chenyixuan@iscas.an.cn
Subject: Re: [PATCH] RISC-V: fix scalar crypto pattern
Date: Thu, 14 Dec 2023 12:30:25 -0700	[thread overview]
Message-ID: <dfc8eba2-cdf1-4e3c-98fd-538a79ad1e5f@gmail.com> (raw)
In-Reply-To: <CAEg0e7j8fc5rTJYrKc5Mv87RW1DneR7JRUwkTQYNtwcaAn0tfA@mail.gmail.com>



On 12/14/23 02:48, Christoph Müllner wrote:
> On Thu, Dec 14, 2023 at 1:40 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>> On 12/13/23 02:03, Christoph Müllner wrote:
>>> On Wed, Dec 13, 2023 at 9:22 AM Liao Shihua <shihua@iscas.ac.cn> wrote:
>>>>
>>>> In Scalar Crypto Built-In functions, some require immediate parameters,
>>>> But register_operand are incorrectly used in the pattern.
>>>>
>>>> E.g.:
>>>>      __builtin_riscv_aes64ks1i(rs1,1)
>>>>      Before:
>>>>         li a5,1
>>>>         aes64ks1i a0,a0,a5
>>>>
>>>>         Assembler messages:
>>>>         Error: instruction aes64ks1i requires absolute expression
>>>>
>>>>      After:
>>>>         aes64ks1i a0,a0,1
>>>
>>> Looks good to me (also tested with rv32 and rv64).
>>> (I was actually surprised that the D03 constraint was not sufficient)
>>>
>>> Reviewed-by: Christoph Muellner <christoph.muellner@vrull.eu>
>>> Tested-by: Christoph Muellner <christoph.muellner@vrull.eu>
>>>
>>> Nit: I would prefer to separate arguments with a comma followed by a space.
>>> Even if the existing code was not written like that.
>>> E.g. __builtin_riscv_sm4ed(rs1,rs2,1); -> __builtin_riscv_sm4ed(rs1, rs2, 1);
>>>
>>> I propose to remove the builtin tests for scalar crypto and scalar bitmanip
>>> as part of the patchset that adds the intrinsic tests (no value in
>>> duplicated tests).
>>>
>>>> gcc/ChangeLog:
>>>>
>>>>           * config/riscv/crypto.md: Use immediate_operand instead of register_operand.
>> You should mention the actual patterns changed.
>>
>> I would strongly recommend adding some tests that out of range cases are
>> rejected (out of range constants as well as a variable for that last
>> argument).  I did that in my patch from June to fix this problem (which
>> was never acked/reviewed).
> 
> Sorry, I was not aware of this patch.
No worries.  I'd planned to ping it again as part of the stage3 
bugfixing effort ;-)  It wasn't until I started looking at Liao's patch 
that I realized he was fixing the same problem.

> Since Jeff's patch was here first and also includes more tests, I
> propose to move forward with his patch (but I'm not a maintainer!).
> Therefore, I've reviewed Jeff's patch and replied to his email.
Thanks.  I think the combination of your review, the high overlap with 
Liao's work and my status as a global maintainer should be sufficient to 
move this forward.


Jeff

      parent reply	other threads:[~2023-12-14 19:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  8:22 Liao Shihua
2023-12-13  9:03 ` Christoph Müllner
2023-12-14  0:40   ` Jeff Law
2023-12-14  9:48     ` Christoph Müllner
2023-12-14 11:12       ` Liao Shihua
2023-12-14 19:31         ` Jeff Law
2023-12-14 14:57       ` Jeff Law
2023-12-14 19:30       ` Jeff Law [this message]

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=dfc8eba2-cdf1-4e3c-98fd-538a79ad1e5f@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=chenyixuan@iscas.an.cn \
    --cc=christoph.muellner@vrull.eu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jiawei@iscas.ac.cn \
    --cc=kito.cheng@gmail.com \
    --cc=shihua@iscas.ac.cn \
    --cc=shiyulong@iscas.ac.cn \
    /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).