aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-29 14:46:05 +0100
committergingerBill <bill@gingerbill.org>2022-05-29 14:46:05 +0100
commitf5e5eac3b9c8458eef17ffe062507fd0b531f0a0 (patch)
tree6b001ad51b52e1fdfdcc4ca2bc4f42b3d3dbaeab
parent0ccbea17aa874b50dd943d83ff39c1e1270f4ea2 (diff)
Add cmpxchg16b
-rw-r--r--core/simd/x86/cmpxchg16b.odin8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/simd/x86/cmpxchg16b.odin b/core/simd/x86/cmpxchg16b.odin
new file mode 100644
index 000000000..d575dd9df
--- /dev/null
+++ b/core/simd/x86/cmpxchg16b.odin
@@ -0,0 +1,8 @@
+//+build amd64
+package simd_x86
+
+import "core:intrinsics"
+
+cmpxchg16b :: #force_inline proc "c" (dst: ^u128, old, new: u128, $success, $failure: intrinsics.Atomic_Memory_Order) -> (val: u128) {
+ return intrinsics.atomic_compare_exchange_strong_explicit(dst, old, new, success, failure)
+} \ No newline at end of file