riscv-non-isa/riscv-c-api-doc

Intrinsic function naming scheme

kito-cheng opened this issue · 0 comments

There is many extension has propose to add their own intrinsic function, like V, B, K and P.

And all of those extension are using slight different naming scheme:

K and B using same naming scheme:

_rv_<opname> for XLEN sensitive operations. 
_rv32_<opname> for 32-bits operation 
_rv64_<opname> for 64-bits operation 

P's naming scheme is just using __rv__ as prefix, and also provide GNU SIMD vector extension version with prefix __rv__v_<opname>

__rv__<opname> for scalar operation and SIMD operation in XLEN unsigned integer version.
__rv__v_<opname> for SIMD operation

V's naming scheme is quite different than others, it didn't use __ as prefix, but I think intrinsic for vector it more like a language extension.

v<opname>

I think it would be great if we have consistent intrinsic function naming scheme for all extension.
I don't have strong opinions here, but I think create an issue to gather feedback and raise discussion here would be great.