On Thu, Jan 7, 2021 at 12:50 AM Kito Cheng <kito.ch...@gmail.com> wrote:
> My point is tracking info and consistent behavior/scheme with other > extensions, so personally I strongly prefer it should be guarded with > -march. > It is a hint. We should allow it even if the architecture extension is not enabled. For comparison, I suggest you look at the aarch64 port. They have 3 kinds of hints: branch protection (bti), pointer authentication, and speculation control. They deliberately allow you to emit the instructions even if the hardware doesn't support the feature because they are hints, and execute as nops if the hardware support is missing. The rationale is that the code will work with or without the hardware support, but will work better with the hardware support, so it is best to always allow it. We should do the same with RISC-V hints. I agree that we need to include LLVM folks in the discussion to make sure that GCC and LLVM handle this the same way. Jim