Skip to content

Commit

Permalink
x86: re-work build_modrm_byte()'s register assignment
Browse files Browse the repository at this point in the history
The function has accumulated a number of special cases for no real
reason. Some were necessary because insn attributes (SwapSources in
particular) weren't suitably utilized instead. Note that the addition of
SwapSources actually increases consistency among the templates: Like
others which already have the attribute, these are all insns where the
VEX.VVVV-encoded register comes first (or last when looking at the SDM).

Note that the vexvvvv attribute now has merely boolean meaning anymore,
in line with the SDM long having dropped the NDS/NDD/DDS concept of
identifying encoding variants. The fallout will be taken care of
subsequently, though, to not further clutter the change here.

As to the TILEZERO special case: If more instructions like this
appeared, a new attribute would likely be the way to go. But as long as
it's only a single insn, going from the mnemonic is cheaper.
  • Loading branch information
jbeulich authored and ouuleilei-bot committed Mar 7, 2023
1 parent aac9c5d commit d09e2c6
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 300 deletions.
Loading

0 comments on commit d09e2c6

Please sign in to comment.