On 05/07/21 18:31, Peter Maydell wrote:
8 here means "8 bytes", not "8 bits". And indeed on i386 you can't do 8-byte atomics with simple insns.
You can, there's a cmpxchg8b instruction. The problem is that somehow configure's view of this disagrees with what happens during compilation.
If anybody can send a config.log and make V=1 log, I can look at it. Paolo
The compiler's answer to this is "emit a call to a helper in libatomic, which will emulate an atomic access by taking some kind of lock". We don't ever want to fall back to "take a lock" because sometimes our accesses to the atomic variables are from TCG generated code -- this is why we don't link against libatomic. The problem is that we have not correctly detected that this compiler can't do inline atomics for 64-bit values and avoided using them. But at least we have made this a compile failure rather than a silently-wrong-code bug:-)