This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add assembler support for {disp8} and {disp32} to control the size of displacement used for memory operands.
ClosedPublic

Authored by craig.topper on Jul 28 2020, 1:09 PM.

Details

Summary

These prefixes should override the default behavior and force a larger immediate size. I don't believe gas issues any warning if you use {disp8} when a 32-bit displacement is already required. And this patch doesn't either.

This completes the {disp8} and {disp32} support from PR46650.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 28 2020, 1:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2020, 1:09 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper requested review of this revision.Jul 28 2020, 1:09 PM

I think I'd find the conditionals easier to "read" if they were positive rather than negative? It'd help if the comments spelled out the conditions a little more as well.

Thoughts?

Add some more variables to make the conditionals positive.
Try to improve some of the comments.

RKSimon accepted this revision.Aug 1 2020, 12:38 PM

LGTM - please can you deal with the the double spaces that clang-format is warning about?

This revision is now accepted and ready to land.Aug 1 2020, 12:38 PM
This revision was landed with ongoing or failed builds.Aug 1 2020, 2:13 PM
This revision was automatically updated to reflect the committed changes.