Commit Graph

3 Commits

Author SHA1 Message Date
Prashant Varanasi
df5a5c3c08 Add Swap for Float64 (#94)
Float64 wraps a Uint64, and since Uint64 supports Swap, Float64 can also
support Swap. Enable the Swap method in the generated code, and add
tests.

This also adds a note for why String doesn't support Swap (though it
will be possible after Go 1.17+).
2021-06-11 08:23:41 -07:00
Prashant Varanasi
38b6e7fa63 Add note on Float64.CAS matching of NaN (#95)
NaN != NaN when using Go's inbuilt operator, but the same is not true
when used with Float64.CAS. Add a note calling this out.

Changing this would be a behaviour change (requires a major version
bump), and is likely unsafe as it could lead to typical CAS loops
blocking forever.

To add the note, we copy the generated CAS method and extend the
documentation as the generator does not support per-method
customizations on the doc comments.
2021-06-11 08:16:20 -07:00
Abhinav Gupta
e63519f6ea float64: Generate with gen-atomicwrapper
Generate atomic.Float64 with gen-valuewrapper by wrapping atomic.Uint64,
using math.Float64bits and math.Float64frombits to pack and unpack
float64 to uint64.
2020-05-15 15:47:25 -07:00