[PATCH] D122490: [RISCV] Generate EF_RISCV_RVC when .option rvc

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 02:24:34 PDT 2022


luismarques added a comment.

In D122490#3413034 <https://reviews.llvm.org/D122490#3413034>, @StephenFan wrote:

> I am still confused about when do we need the `RVC` flag ? For example, if we have both `.option rvc` and `option norvc` in an assembly file, should `RVC` flag be emitted ? Or if we use command line `-mattr=+c` to assemble file, but `option norvc` is specified in assembly file, should `RVC` flag be emitted ?

This whole thing is weird but IMO the natural extrapolation from your current patch is that we'd do an `OR` and set the `EF_RISCV_RVC` flag whenever we emit some C code, be it due to `-mattr=+c` or `.option rvc`, even if some portion of the file disables RVC with `.option norvc`. If the GNU tools hadn't already gone the route of setting `EF_RISCV_RVC` due to `.option rvc` this is NOT what I would suggest, but I guess it's too late now to explore other options if we want to be fully compatible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122490



More information about the llvm-commits mailing list