This is an archive of the discontinued LLVM Phabricator instance.

[M68k][AsmParser] Support negative integer constants
ClosedPublic

Authored by myhsu on May 2 2021, 2:58 PM.

Details

Summary

Parsing negative integer constants as expressions.

Diff Detail

Event Timeline

myhsu created this revision.May 2 2021, 2:58 PM
myhsu requested review of this revision.May 2 2021, 2:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2021, 2:58 PM
myhsu updated this revision to Diff 342284.May 2 2021, 3:11 PM

Remove corresponding legacy tests in the test/CodeGen/M68k/Encoding folder

ricky26 accepted this revision.May 2 2021, 3:17 PM

LGTM.

One nitpick, I don't believe it needs addressing but wanted to point it out anyway.

This revision is now accepted and ready to land.May 2 2021, 3:17 PM

Somehow my comment got trimmed (I think because a new diff appeared between me writing it and pressing submit).

llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
590

nit: Is this totally necessary? I don't think - can appear at the start of anything else apart from possibly an identifier (which is parsed by parseExpression anyway).

This doesn't make much difference though (but could preserve const).

myhsu marked an inline comment as done.May 2 2021, 9:23 PM
myhsu added inline comments.
llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
590

Minus sign can be in front of a pre-decrement memory operand. Although currently isExpr is only used by one function (parseMemOp) in which all usages of isExpr are carefully placed such that they will never be confused with pre-decrement operand. But to prevent potential misuse in the future I prefer isExpr to be more explicit.

This revision was landed with ongoing or failed builds.May 5 2021, 5:15 PM
This revision was automatically updated to reflect the committed changes.
myhsu marked an inline comment as done.
llvm/test/CodeGen/M68k/Encoding/Bits/Classes/MxBTST_MI.mir