[PATCH] D123515: [RISCV] Support '.option arch' directive

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 03:05:08 PDT 2023


luismarques requested changes to this revision.
luismarques added a comment.
This revision now requires changes to proceed.

Thanks for all of the improvements so far.

Two additional problems I noticed:

1. It currently accepts non-extension features like `.option arch, +svnapot, +relax`.

2. This patch currently allows switching between rv32 and rv64 when using the full arch string. The spec doesn't seem to say anything about that and I could see some obscure uses for it, but I'm not sure we actually want to support it, so it's probably safer to reject it (opinions from others about this are welcome). Either way, we should have test coverage for that scenario.



================
Comment at: llvm/test/MC/RISCV/option-invalid.s:34-39
+# CHECK: :[[#@LINE+1]]:16: error: Extension version number parsing not currently implemented
+.option arch, +c2p0
+
+.option arch, +d
+# CHECK: :[[#@LINE+1]]:17: error: Can't disable f extension, d extension requires f extension be enabled
+.option arch, -f
----------------
Nit: don't capitalize the error message, for consistency.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123515/new/

https://reviews.llvm.org/D123515



More information about the llvm-commits mailing list