mgorny added a comment.

In https://reviews.llvm.org/D28213#666269, @dim wrote:

> > What's the value of `__atomic_always_lock_free(sizeof(long long), 0)` for 
> > gcc and clang?
>
> For gcc, it is always 0, for clang (I tested 3.4.1 through 4.0.0) it is 
> always 1.  Maybe that was always incorrect on 32-bit FreeBSD, then?


That's what I suspected. Yeah, looks like clang always made the wrong 
assumption and possibly someone just swept it under the carpet.

In https://reviews.llvm.org/D28213#666352, @dim wrote:

> Hmm, I just noticed the following rather disappointing comment in 
> `tools/clang/lib/Basic/Targets.cpp`:
>
>   X86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
>       : X86TargetInfo(Triple, Opts) {
>     [...]
>     // x86-32 has atomics up to 8 bytes
>     // FIXME: Check that we actually have cmpxchg8b before setting
>     // MaxAtomicInlineWidth. (cmpxchg8b is an i586 instruction.)
>     MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
>   
>
> So this can never have worked properly for e.g. i486 and i586...


Yep, looks like it. I see that the triple is passed there, so I guess making 
that conditional to `>=i586-*` should be relatively easy. However, I don't know 
how to make it properly respect `-march`.


Repository:
  rL LLVM

https://reviews.llvm.org/D28213



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to