Amanieu / atomic-rs

Generic Atomic<T> type for Rust
Apache License 2.0
223 stars 23 forks source link

Special methods for float atomics #20

Open droundy opened 4 years ago

droundy commented 4 years ago

It would be lovely to have fetch_add for f64 and f32. I know I could implement them with the provided intrinsics, but that is inconvenient.

Amanieu commented 4 years ago

There is no hardware support for this operations, so it would have to be emulated using compare_exchange anyways. You can easily do that yourself with fetch_update.