Browse Source

Add cmpxchg16b

gingerBill 3 years ago
parent
commit
f5e5eac3b9
1 changed files with 8 additions and 0 deletions
  1. 8 0
      core/simd/x86/cmpxchg16b.odin

+ 8 - 0
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)
+}