From: "Cui, Lili" <lili.cui@intel.com>
To: "Beulich, Jan" <JBeulich@suse.com>, Binutils <binutils@sourceware.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>
Subject: RE: [PATCH v2 1/4] x86: zap value-less Disp8MemShift from non-EVEX templates
Date: Wed, 24 Apr 2024 06:49:11 +0000 [thread overview]
Message-ID: <SJ0PR11MB5600A0EC091215CBCC77AB9A9E102@SJ0PR11MB5600.namprd11.prod.outlook.com> (raw)
In-Reply-To: <41696d73-4114-4adc-8491-bffddc5d72cc@suse.com>
> In order to allow to continue to use templatized SSE2AVX templates when
> enhancing those to also cover eGPR usage, Disp8MemShift wants using to
> deviate from what general template attributes supply. That requires using
> Disp8MemShift in a way also affecting non-EVEX templates, yet having this
> attribute set would so far implicitly mean EVEX encoding.
> Recognize the case and instead zap the attribute if no other attribute
> indicates EVEX encoding.
>
I'm confused about this patch, is it related to the movsd template? You removed the "Masking" for it and only left Disp8MemShift, but I thought it still belongs to EVEX template.
+movsd, 0xf210, AVX512F, D|Modrm|EVexLIG|Space0F|VexW1|Disp8MemShift=3|NoSuf|SSE2AVX, { Qword|Unspecified|BaseIndex, RegXMM }
> No change in generated tables.
> ---
> This could be folded into the subsequent "x86/APX: extend SSE2AVX
> coverage", but I think it's better kept separate for being a little subtle.
>
> --- a/opcodes/i386-gen.c
> +++ b/opcodes/i386-gen.c
> @@ -1126,6 +1126,7 @@ process_i386_opcode_modifier (FILE *tabl
> char **opnd, int lineno, bool rex2_disallowed) {
> char *str, *next, *last;
> + bool disp8_shift_derived = false;
> bitfield modifiers [ARRAY_SIZE (opcode_modifiers)];
> static const char *const spaces[] = { #define SPACE(n) [SPACE_##n] = #n
> @@ -1190,7 +1191,10 @@ process_i386_opcode_modifier (FILE *tabl
> if (strcasecmp(str, "Broadcast") == 0)
> val = get_element_size (opnd, lineno) + BYTE_BROADCAST;
> else if (strcasecmp(str, "Disp8MemShift") == 0)
> - val = get_element_size (opnd, lineno);
> + {
> + val = get_element_size (opnd, lineno);
> + disp8_shift_derived = true;
> + }
>
> set_bitfield (str, modifiers, val, ARRAY_SIZE (modifiers),
> lineno);
> @@ -1243,13 +1247,21 @@ process_i386_opcode_modifier (FILE *tabl
>
> /* Rather than evaluating multiple conditions at runtime to determine
> whether an EVEX encoding is being dealt with, derive that information
> - right here. A missing EVex attribute means "dynamic". */
> - if (!modifiers[EVex].value
> - && (modifiers[Disp8MemShift].value
> - || modifiers[Broadcast].value
> + right here. A missing EVex attribute means "dynamic". There's one
> + exception though: A value-less Disp8MemShift needs zapping rather than
> + respecting if no other attribute indicates EVEX encoding. This is for
> + certain SSE2AVX templatized templates to work reasonably. */ if
> + (!modifiers[EVex].value)
> + {
> + if (modifiers[Broadcast].value
> || modifiers[Masking].value
> - || modifiers[SAE].value))
> - modifiers[EVex].value = EVEXDYN;
> + || modifiers[SAE].value)
> + modifiers[EVex].value = EVEXDYN;
> + else if (disp8_shift_derived)
> + modifiers[Disp8MemShift].value = 0;
> + else if (modifiers[Disp8MemShift].value)
> + modifiers[EVex].value = EVEXDYN;
> + }
>
Why not just delete the Disp8MemShift? Maybe I missed something.
if (!modifiers[EVex].value
&& (modifiers[Broadcast].value
|| modifiers[Masking].value
|| modifiers[SAE].value))
modifiers[EVex].value = EVEXDYN;
Lili.
next prev parent reply other threads:[~2024-04-24 6:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 9:36 [PATCH v2 0/4] x86/APX: respect -msse2avx Jan Beulich
2024-04-19 9:37 ` [PATCH v2 1/4] x86: zap value-less Disp8MemShift from non-EVEX templates Jan Beulich
2024-04-24 6:49 ` Cui, Lili [this message]
2024-04-24 7:15 ` Jan Beulich
2024-04-24 13:15 ` Cui, Lili
2024-04-24 13:51 ` Jan Beulich
2024-04-25 5:51 ` Cui, Lili
2024-04-19 9:37 ` [PATCH v2 2/4] x86/APX: extend SSE2AVX coverage Jan Beulich
2024-04-25 6:09 ` Cui, Lili
2024-04-25 7:22 ` Jan Beulich
2024-04-19 9:38 ` [PATCH v2 3/4] x86/APX: further " Jan Beulich
2024-04-19 9:38 ` [PATCH v2 4/4] x86: tidy <sse*> templates Jan Beulich
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=SJ0PR11MB5600A0EC091215CBCC77AB9A9E102@SJ0PR11MB5600.namprd11.prod.outlook.com \
--to=lili.cui@intel.com \
--cc=JBeulich@suse.com \
--cc=binutils@sourceware.org \
--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).