gccrs: Implement rust-intrinsics atomic binary operators - #4948
Open
Polygonalr wants to merge 1 commit into
Open
Polygonalr wants to merge 1 commit into
Polygonalr wants to merge 1 commit into
Conversation
gcc/rust/ChangeLog: * util/rust-intrinsic-values.h (Intrinsics): Add new entries for atomic binary op function names. * backend/rust-intrinsic-handlers.h (inner::atomic_binary_op): New function for compiling atomic binary op intrinsics. (atomic_xadd): New function to handle atomic_xadd and its variants. (atomic_xsub): New function to handle atomic_xsub and its variants. (atomic_and): New function to handle atomic_and and its variants. (atomic_nand): New function to handle atomic_nand and its variants. (atomic_or): New function to handle atomic_or and its variants. (atomic_xor): New function to handle atomic_xor and its variants. * backend/rust-intrinsic-handlers.cc (inner::atomic_store): Add new assert for return type. (inner::atomic_load): Likewise. (inner::atomic_binary_op): Implement. (atomic_xadd): Implement. (atomic_xsub): Implement. (atomic_and): Implement (atomic_nand): Implement. (atomic_or): Implement. (atomic_xor): Implement. * backend/rust-compile-intrinsic.cc (generic_intrinsics): Add entries for the new atomic binary op intrinsics. * typecheck/rust-hir-type-check-intrinsic.cc (intrinsic_rules): Likewise, but for type checking. Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
Polygonalr
force-pushed
the
atomic-binary-1
branch
from
October 2, 2026 13:01
d4ce9b9 to
277f71d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Working on other atomic intrinsics next