This is an archive of the discontinued LLVM Phabricator instance.

Add support for parsing the not operator in Microsoft inline assembly
ClosedPublic

Authored by • ehsan on Jul 4 2014, 7:29 AM.

Details

Diff Detail

Event Timeline

• ehsan updated this revision to Diff 11086.Jul 4 2014, 7:29 AM
• ehsan retitled this revision from to Add support for parsing the not operator in Microsoft inline assembly.
• ehsan updated this object.
• ehsan edited the test plan for this revision. (Show Details)
• ehsan added a reviewer: majnemer.
• ehsan added a subscriber: Unknown Object (MLST).
majnemer added inline comments.Jul 4 2014, 11:22 AM
lib/Target/X86/AsmParser/X86AsmParser.cpp
412–413

Can you please explain why you have IES_PLUS and IES_MINUS here?

• ehsan added inline comments.Jul 4 2014, 11:30 AM
lib/Target/X86/AsmParser/X86AsmParser.cpp
412–413

IES_PLUS is the default value when we want to parse ~15 for example. MSVC also accepts ~-15, but my patch doesn't support that properly I just realized, so I need to take the IES_MINUS out.

• ehsan updated this revision to Diff 11092.Jul 4 2014, 11:31 AM

Removed IES_MINUS as requested.

majnemer accepted this revision.Jul 4 2014, 11:38 AM
majnemer edited edge metadata.

LGTM. Out of curiosity, does it work with parenthesized expressions? e.g. ~(3 + ~7)

This revision is now accepted and ready to land.Jul 4 2014, 11:38 AM
In D4391#8, @majnemer wrote:

LGTM. Out of curiosity, does it work with parenthesized expressions? e.g. ~(3 + ~7)

No, I didn't fix that because I realized that doesn't work with minus either (such as -(3 + 7)). If you want, I can give that a shot too.

Nope, LGTM as-is.

• ehsan closed this revision.Jul 4 2014, 12:21 PM

Landed in r212352.