gccrs: Implement rust-intrinsics atomic binary operators
GCC Rust compiler adds support for atomic arithmetic and bitwise operations.
The GCC Rust compiler now supports a range of atomic binary operations, including add, subtract, AND, NAND, OR, and XOR. These intrinsics are essential for lock-free programming, allowing threads to atomically modify shared integer values. The implementation updates intrinsic definitions and handlers, and renames a utility function for better clarity in resolving atomic builtins.
In Details
gccrs has gained support for various atomic binary operations (fetch-and-add, fetch-and-sub, etc.). This involved defining new entries in rust-intrinsic-values.h, implementing handler functions like inner::atomic_binary_op in rust-intrinsic-handlers.cc, and adding them to the generic_intrinsics table in rust-compile-intrinsic.cc. The resolve_atomic_builtin function was refactored for clarity.
- atomic binary operations
- Operations that atomically perform a binary computation (like addition or bitwise AND) on a memory location and return the original value. They are crucial for implementing lock-free algorithms and concurrent data structures.