This is an archive of the discontinued LLVM Phabricator instance.

[X86][MS-compatability]Allow named synonymous for MS-assembly operators
ClosedPublic

Authored by coby on Mar 22 2017, 11:09 PM.

Details

Summary

This patch enhances X86AsmParser's immediate expression parsing abilities, to include a named synonymous for selected binary/unary bitwise operators: {and,shl,shr,or,xor,not}, ultimately achieving better MS-compatability
MASM reference:
https://msdn.microsoft.com/en-us/library/94b6khh4.aspx

Diff Detail

Repository
rL LLVM

Event Timeline

coby created this revision.Mar 22 2017, 11:09 PM
myatsina added inline comments.Mar 27 2017, 4:34 AM
lib/Target/X86/AsmParser/X86AsmParser.cpp
685 ↗(On Diff #92760)

I don't think it should be part of the state machine. I think this function should move to the parser and be activates as part of ParseIntelExpression.

test/MC/X86/intel-syntax-bitwise-ops.s
9 ↗(On Diff #92760)

It seems you have a space instead of a tab in all the checks

42 ↗(On Diff #92760)

Add a few tests for the upper case as well (AND, OR).
Add some complex case like "(6 and 3) XOR 9"

coby updated this revision to Diff 93217.Mar 28 2017, 12:28 AM

Addressed Marina's comments

myatsina accepted this revision.Mar 28 2017, 12:34 AM
This revision is now accepted and ready to land.Mar 28 2017, 12:34 AM
rnk accepted this revision.Mar 30 2017, 4:27 PM

Nice, looks good.