Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify generic Builtins for use with GCC and Clang/LLVM #238

Open
jeremybennett opened this issue Aug 18, 2023 · 1 comment
Open

Identify generic Builtins for use with GCC and Clang/LLVM #238

jeremybennett opened this issue Aug 18, 2023 · 1 comment
Assignees

Comments

@jeremybennett
Copy link
Collaborator

The CORE-V builtin specification requires that where generic builtins exist, they should be reused for CORE-V, rather than defining custom builtins.

This issue is to track the set of builtins for which this is relevant. We can still keep CORE-V specific naming as a wrapper for these in the header.

@melonedo
Copy link

melonedo commented Aug 25, 2023

These bit manipulation builtins have target-independent equivalents in GCC, and Clang should be compatible with GCC in these builtins.

CORE-V Builtin Target-Independent Builtin Note
__builtin_riscv_cv_bitmanip_ff1 __builtin_ctz Undefined for x = 0
__builtin_riscv_cv_bitmanip_fl1 __builtin_clz Undefined for x = 0
__builtin_riscv_cv_bitmanip_clb __builtin_clrsb Seems to return 31 for x = 0?
__builtin_riscv_cv_bitmanip_cnt __builtin_popcount -
__builtin_riscv_cv_bitmanip_ror __builtin_rotateright32 Only available in Clang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants