This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Allow parsing immediates that use tilde & exclaim
ClosedPublic

Authored by lewis-revill on Jan 28 2019, 3:24 AM.

Details

Summary

This patch allows immediates (and CSR alias immediates) which start with a tilde token or an exclaim (!) token to be parsed as intended.

Diff Detail

Repository
rL LLVM

Event Timeline

lewis-revill created this revision.Jan 28 2019, 3:24 AM
jrtc27 requested changes to this revision.Jan 28 2019, 4:48 AM

There's also AsmToken::Exclaim for logical not that we could allow (although that's not one I've ever seen in real-world assembly). Please add tests for the CSR change?

This revision now requires changes to proceed.Jan 28 2019, 4:48 AM

There's also AsmToken::Exclaim for logical not that we could allow (although that's not one I've ever seen in real-world assembly). Please add tests for the CSR change?

It would probably be good to add that for completeness. machine-csr-names.s seems a good place to add CSR tests?

asb added a comment.Jan 28 2019, 6:17 AM

There's also AsmToken::Exclaim for logical not that we could allow (although that's not one I've ever seen in real-world assembly). Please add tests for the CSR change?

It would probably be good to add that for completeness. machine-csr-names.s seems a good place to add CSR tests?

I'd put it in rv32i-valid.s.

lewis-revill retitled this revision from [RISCV] Allow parsing immediates that use tilde to [RISCV] Allow parsing immediates that use tilde & exclaim.
lewis-revill edited the summary of this revision. (Show Details)

Also parse exlaim (!) as a valid token to start an immediate. Add some CSR tests.

asb accepted this revision.Jun 18 2019, 9:14 PM

LGTM, thanks!

test/MC/RISCV/rv32i-valid.s
343 ↗(On Diff #183863)

Should be updated to csrrw s0, fflags, s1 to match current HEAD behaviour.

Herald added a project: Restricted Project. · View Herald TranscriptJun 18 2019, 9:14 PM
Herald added subscribers: Jim, benna, psnobl. · View Herald Transcript
This revision was not accepted when it landed; it landed in state Needs Review.Jun 19 2019, 3:25 AM
This revision was automatically updated to reflect the committed changes.