Bug fix 12730: Add support for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1, 2, 4, 8} on ARM

İsmail Dönmez ismail at donmez.ws
Wed Sep 25 02:44:09 PDT 2013


Hi,


On Sat, Sep 7, 2013 at 2:08 AM, Weiming Zhao <weimingz at codeaurora.org>wrote:

> Hi Eli,****
>
> ** **
>
> I didn’t find much info about atomics for targets. I find two attributes
> are relevant: MaxAtomicPromoteWidth and  MaxAtomicInlineWidth, but they
> cannot be used to compute the macros.****
>
> Besides, even for the same target, the macros are dependent on CPU types.
> For example, for X86 target:****
>
>   if (CPU >= CK_i486) {****
>
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");****
>
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");****
>
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");****
>
>   }****
>
>   if (CPU >= CK_i586)****
>
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");****
>
> }****
>
>
> How about adding these macros for only ARMv7 and up? Without this patch
std::thread just fails on ARM so it would be rather nice to have this fixed
in clang 3.4 release.

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130925/d0d5f342/attachment.html>


More information about the cfe-commits mailing list