[Issue 20838] on modern (x86_64) CPUs, dmd emit cmpxchg8b instead of CMPXCHG16B

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 19 15:44:42 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20838

--- Comment #14 from kinke <kinke at gmx.net> ---
(In reply to mw from comment #13)
> Can I log another bug for this suggestion of DMD compiler improvement?

Sure. The druntime library is supposed to take care of this already, at least
with enabled contracts, see
https://github.com/dlang/druntime/blob/48082ac4e4aa1a3c9f1a1ef87659c941dae0f7f6/src/core/atomic.d#L624-L655.
It only checks for insufficient size_t alignment though, so that needs to be
fixed.

Wrt. original DMD issue here, DMD is supposed to use cmpxchg16b already, see
https://github.com/dlang/druntime/blob/48082ac4e4aa1a3c9f1a1ef87659c941dae0f7f6/src/core/internal/atomic.d#L582.
As it apparently doesn't, I guess the bug is in DMD's codegen.

--


More information about the Digitalmars-d-bugs mailing list