News for hackers. Stuff that matters.
Re:TIL: Go's CompareAndSwap is not always Compare-and-swap by dominikh on Monday January 08, 2024 @04:19PM (#38918296)
Note that the source you're seeing there is the fallback implementation, which is only used if there is no instruction for FMA in the architecture you're compiling for. On AMD64, for example, the call to math.FMA will be replaced by the VFMADD231SD instruction.
Re:TIL: Go's CompareAndSwap is not always Compare-and-swap by pcwalton on Monday January 08, 2024 @06:54PM (#38920287)
In fact, on AArch64 there is no integer multiply instruction; there's only multiply-add, and if you just want a multiply you supply the zero register as the addend.