riscv / riscv-bitmanip

Working draft of the proposed RISC-V Bitmanipulation extension

Home Page:https://jira.riscv.org/browse/RVG-122

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C preprocessor definitions to check for B extension

stnolting opened this issue · comments

Are there any official definitions made by the C/C++ preprocessor to check for the B extension?

I am looking for something like this:
__riscv_compressed -> defined when targeting the C ISA extension.

And accordingly for the B extension:
"__riscv_bitmanip" -> defined when targeting the B ISA extension? 🤔

See https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md

__riscv_b is the preferred solution. Some older compilers may support __riscv_bitmanip which is now deprecated.

That was exactly what I was looking for.
Thank you very much!