This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Move FRM parsing in the assembler to a custom operand parser.
ClosedPublic

Authored by craig.topper on Jan 28 2023, 11:45 PM.

Details

Summary

Previously we parsed it as a symbol, and then accessed the name.
This works, but seems like an unusual way to do it.

This adds a custom parser that looks for an Identifier token containing
one of the valid FRM strings.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 28 2023, 11:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2023, 11:45 PM
craig.topper requested review of this revision.Jan 28 2023, 11:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2023, 11:45 PM
luismarques accepted this revision.Jan 29 2023, 11:36 AM

LGTM.

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
905

I suppose you kept this because it was easier to initialize it (vs asserting on access), rather than it actually being needed for a rounding mode operand?

This revision is now accepted and ready to land.Jan 29 2023, 11:36 AM
craig.topper added inline comments.Jan 29 2023, 11:49 AM
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
905

Are you referring to IsRV64?

This revision was landed with ongoing or failed builds.Jan 29 2023, 12:25 PM
This revision was automatically updated to reflect the committed changes.
luismarques added inline comments.Jan 29 2023, 1:16 PM
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
905

Yes.