public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Haochen Jiang <haochen.jiang@intel.com>
Cc: hjl.tools@gmail.com, amodra@gmail.com, binutils@sourceware.org
Subject: Re: [PATCH 2/5] Support Intel SHA512
Date: Thu, 13 Jul 2023 12:02:55 +0200	[thread overview]
Message-ID: <5a822c87-7be8-ba36-c8c1-84fa673f5bbc@suse.com> (raw)
In-Reply-To: <20230713063303.205862-3-haochen.jiang@intel.com>

Up-front question on title and naming in the patch: Doc indeed says just
SHA512 (same for SM3 and SM4), but are you (including those who
assigned those names) sure that's going to stay this way by the time
this is merged into the SDM? Considering other ISA names, AVX-SHA512
would seem more consistent to me.

On 13.07.2023 08:33, Haochen Jiang wrote:
> In SHA512 patch, I have considered to eliminate the ModR/M table pass
> for vsha512msg1 and vsha512rnds2 since you just introduced OP_R with
> Uxmm.
> 
> However, xmm_mode in OP_R requires VEX128 or less. But unfortunately,
> for both instructions, they are VEX256. Therefore, I still keep the
> ModR/M table pass in the patch.

I guess I don't (fully) understand. Uxmm and xmm_mode aren't well suited
here anyway. What's wrong with introducing

#define Rxmmq { OP_R, xmmq_mode }

(or Uxmmq) and using it there, rejecting VEX.L==0 just like VEX.L==1 is
rejected for xmm_mode?

> --- a/gas/testsuite/gas/i386/i386.exp
> +++ b/gas/testsuite/gas/i386/i386.exp
> @@ -498,6 +498,8 @@ if [gas_32_check] then {
>      run_list_test "amx-complex-inval"
>      run_dump_test "avx-vnni-int16"
>      run_dump_test "avx-vnni-int16-intel"
> +    run_dump_test "sha512"
> +    run_dump_test "sha512-intel"

Perhaps worth having further tests proving that both assembler and
disassembler correctly deal with (invalid) memory operands / encodings?
(The disassembler part may not need to be a separate test; I think we
already have one which could be extended: disassem.[sd] and its 64-bit
counterpart.)

> --- a/opcodes/i386-gen.c
> +++ b/opcodes/i386-gen.c
> @@ -168,6 +168,8 @@ static const dependency isa_dependencies[] =
>      "LKGS" },
>    { "AVX_VNNI_INT16",
>      "AVX2" },
> +  { "SHA512",
> +    "AVX" },

Like for the earlier patch this wants to move up a little. I also
question that it's AVX that's the baseline feature here. While correct
for SM3, I expect it needs to be AVX2 both here and for SM4, for AVX
offering no real 256-bit integer operations. (Obviously this wants
taking care of in the doc as well.)

> --- a/opcodes/i386-opc.tbl
> +++ b/opcodes/i386-opc.tbl
> @@ -3375,3 +3375,11 @@ vpdpwsud, 0xf3d2, AVX_VNNI_INT16, Modrm|Vex|Space0F38|VexVVVV|VexW0|CheckOperand
>  vpdpwsuds, 0xf3d3, AVX_VNNI_INT16, Modrm|Vex|Space0F38|VexVVVV|VexW0|CheckOperandSize|NoSuf, { RegXMM|RegYMM|Unspecified|BaseIndex, RegXMM|RegYMM, RegXMM|RegYMM }
>  
>  // AVX_VNNI_INT16 instructions end.
> +
> +// SHA512 instructions.
> +
> +vsha512rnds2, 0xf2cb, SHA512, Vex256|Space0F38|Modrm|VexVVVV|VexW0|NoSuf, { RegXMM, RegYMM, RegYMM }
> +vsha512msg1, 0xf2cc, SHA512, Vex256|Space0F38|Modrm|VexW0|NoSuf, { RegXMM, RegYMM }
> +vsha512msg2, 0xf2cd, SHA512, Vex256|Space0F38|Modrm|VexW0|NoSuf, { RegYMM, RegYMM }

Can we please stick to Modrm coming first?

Jan

  reply	other threads:[~2023-07-13 10:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13  6:32 [PATCH 0/5] Support Intel Arrow Lake/Lunar Lake ISAs Haochen Jiang
2023-07-13  6:32 ` [PATCH 1/5] Support Intel AVX-VNNI-INT16 Haochen Jiang
2023-07-13  9:29   ` Jan Beulich
2023-07-14  5:51     ` Jiang, Haochen
2023-07-13  6:33 ` [PATCH 2/5] Support Intel SHA512 Haochen Jiang
2023-07-13 10:02   ` Jan Beulich [this message]
2023-07-14  3:40     ` Jiang, Haochen
2023-07-14  7:12       ` Jan Beulich
2023-07-18  7:20         ` Jiang, Haochen
2023-07-18  7:54           ` [PATCH v2] " Haochen Jiang
2023-07-18  7:59             ` Jiang, Haochen
2023-07-18  8:51             ` Jan Beulich
2023-07-20  8:32               ` Jiang, Haochen
2023-07-20 10:37                 ` Jan Beulich
2023-07-20  8:32               ` [PATCH] " Haochen Jiang
2023-07-20 11:07                 ` [PATCH v3] " Jan Beulich
2023-07-27  5:52                   ` Jiang, Haochen
2023-07-18  8:11           ` [PATCH 2/5] " Jan Beulich
2023-07-13  6:33 ` [PATCH 3/5] Support Intel SM3 Haochen Jiang
2023-07-13 10:20   ` Jan Beulich
2023-07-18  8:09     ` [PATCH v2] " Haochen Jiang
2023-07-18  9:03       ` Jan Beulich
2023-07-24  2:54         ` Jiang, Haochen
2023-07-13  6:33 ` [PATCH 4/5] Support Intel SM4 Haochen Jiang
2023-07-13 10:25   ` Jan Beulich
2023-07-18  7:21     ` Jiang, Haochen
2023-07-18  8:13       ` [PATCH v2] " Haochen Jiang
2023-07-18  9:11         ` Jan Beulich
2023-07-13  6:33 ` [PATCH 5/5] Support Intel PBNDKB Haochen Jiang
2023-07-13 10:29   ` Jan Beulich
2023-07-14  7:15     ` Jiang, Haochen

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=5a822c87-7be8-ba36-c8c1-84fa673f5bbc@suse.com \
    --to=jbeulich@suse.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=haochen.jiang@intel.com \
    --cc=hjl.tools@gmail.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).