Skip to content

gccrs: Implement rust-intrinsics atomic binary operators - #4948

Open
Polygonalr wants to merge 1 commit into
Rust-GCC:masterfrom
Polygonalr:atomic-binary-1
Open

Polygonalr wants to merge 1 commit into
Rust-GCC:masterfrom
Polygonalr:atomic-binary-1

Conversation

@Polygonalr

Copy link
Copy Markdown
Contributor

Working on other atomic intrinsics next

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>

This branch has not been deployed

No deployments
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.

1 participant