LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 36706 - [X86] Could commute some VEX encoded instructions to enable 2 byte VEX prefix
Summary: [X86] Could commute some VEX encoded instructions to enable 2 byte VEX prefix
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: X86 (show other bugs)
Version: trunk
Hardware: PC All
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks: 26299
  Show dependency tree
 
Reported: 2018-03-13 11:33 PDT by Craig Topper
Modified: 2019-11-08 10:01 PST (History)
2 users (show)

See Also:
Fixed By Commit(s): f65493a83e3bdb402fb1dfa92bcc25707e961147


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Topper 2018-03-13 11:33:41 PDT
The VEX prefix comes in two forms, 2 byte and 3 byte. The 2 byte version is missing some fields from the 3 byte version so can't encode all instructions.

The missing fields are VEX.W, VEX.mmmmm, VEX.X, and VEX.B. VEX.X is only used by memory instructions. VEX.W isn't used on most instructions.

For a commutable instructions like the register only form of VPADDD, if one input is xmm8-15 and the other is xmm0-7, we could take advantage of commuting to always put the xmm8-15 in the operand that uses VEX.R to avoid needing VEX.B.

This would only work for instructions that use VEX.mmmmm = 0x1, but that's the more common encoding for that field.
Comment 1 Craig Topper 2019-10-05 23:42:49 PDT
Candidate patch https://reviews.llvm.org/D68550
Comment 2 Craig Topper 2019-11-08 10:01:05 PST
Fixed in f65493a83e3bdb402fb1dfa92bcc25707e961147