[PATCH] Support APX NF
Jan Beulich
jbeulich@suse.com
Fri Mar 1 07:04:52 GMT 2024
On 27.02.2024 10:01, Cui, Lili wrote:
> @@ -1888,7 +1892,7 @@ static INLINE bool need_evex_encoding (const insn_template *t)
> return i.encoding == encoding_evex
> || i.encoding == encoding_evex512
> || (t->opcode_modifier.vex && i.has_egpr)
> - || i.mask.reg;
> + || i.mask.reg || i.has_nf;
> }
This, at least, can be avoided if ...
> @@ -7187,6 +7198,10 @@ parse_insn (const char *line, char *mnemonic, bool prefix_only)
> /* {rex2} */
> i.rex2_encoding = true;
> break;
> + case Prefix_NF:
> + /* {NF} */
> + i.has_nf = true;
> + break;
.. you suitably update i.encoding here.
Which reminds me of another aspect wanting testing: Either order of {nf}
and {vex} together wants proving that it is properly rejected. Note that
this is different from a programmer using both {vex} and {evex}, where
the latter simply overrides the earlier. (While this is reasonable
behavior imo, this isn't to say that this is the only way of reasonably
dealing with such. But that's the way things have been.)
> @@ -2619,25 +2622,25 @@ static const struct dis386 reg_table[][8] = {
> },
> /* REG_C0 */
> {
> - { "rolA", { VexGb, Eb, Ib }, NO_PREFIX },
> - { "rorA", { VexGb, Eb, Ib }, NO_PREFIX },
> - { "rclA", { VexGb, Eb, Ib }, NO_PREFIX },
> - { "rcrA", { VexGb, Eb, Ib }, NO_PREFIX },
> - { "shlA", { VexGb, Eb, Ib }, NO_PREFIX },
> - { "shrA", { VexGb, Eb, Ib }, NO_PREFIX },
> - { "shlA", { VexGb, Eb, Ib }, NO_PREFIX },
> - { "sarA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNrolA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNrorA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNrclA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNrcrA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNshlA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNshrA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNshlA", { VexGb, Eb, Ib }, NO_PREFIX },
> + { "%XNsarA", { VexGb, Eb, Ib }, NO_PREFIX },
> },
Just to mention it, as it occurred to me only now: Switching to using
N here wouldn't be quite as straightforward as I first thought,
because of these and other table entries which are also used for
legacy encodings. That's not to say though that I withdraw that
suggestion - I still view it as wanting to at least consider.
Jan
More information about the Binutils
mailing list