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

Add atomic intrinsics #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

wangpc-pp
Copy link
Contributor

@wangpc-pp wangpc-pp commented Jun 6, 2024

We need this when optimizing some locks' implementation, but using inline assembly will stop some optimizations. For example, if we use inline assembly, the compiler doesn't know lr.w will sign-extend the result.

ARM provides similar intrinsics like __builtin_arm_ldaex.

Currently, we only add intrinsics for Zawrs.

@wangpc-pp
Copy link
Contributor Author

I don't know if we should add intrinsics for AMO instructions as we have some "standard" C builtins for AMO.

riscv-c-api.md Outdated Show resolved Hide resolved
@wangpc-pp
Copy link
Contributor Author

Ping. :-)

riscv-c-api.md Outdated Show resolved Hide resolved
riscv-c-api.md Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

2 participants