This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fold MMX_MOVD64from64rr + store to MMX_MOVQ64mr instead of MMX_MOVD64from64mr.
ClosedPublic

Authored by craig.topper on Mar 22 2022, 10:46 AM.

Details

Summary

MMX_MOVD64from64rr moves an MMX register to a 64-bit GPR.

MMX_MOVD64from64mr is the memory version of moving a MMX register to a
64-bit GPR. It requires the REX.W bit to be set. There are no isel
patterns that use this instruction.

MMX_MOVQ64mr is the MMX register store instruction. It doesn't
require a REX.W prefix. This makes it one byte shorter to encode
than MMX_MOVD64from64mr in many cases.

Both store instructions output the same mnemonic string. The assembler
would choose MMX_MOVQ64mr if it was to parse the output. Which is
another reason using it is the correct thing to do.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 22 2022, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 10:46 AM
craig.topper requested review of this revision.Mar 22 2022, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 10:46 AM
RKSimon accepted this revision.Mar 22 2022, 11:00 AM

nice catch! LGTM

This revision is now accepted and ready to land.Mar 22 2022, 11:00 AM
This revision was landed with ongoing or failed builds.Mar 22 2022, 2:22 PM
This revision was automatically updated to reflect the committed changes.