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

Weiming Zhao weimingz at codeaurora.org
Mon Sep 30 14:24:36 PDT 2013


Hi Renato,

 

Thanks a lot for the info.

Attached is the updated patch.

 

Thanks,

Weiming

 

 

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

 

From: Renato Golin [mailto:renato.golin at linaro.org] 
Sent: Monday, September 30, 2013 12:57 AM
To: Zhao
Cc: İsmail Dönmez; Clang Commits
Subject: Re: Bug fix 12730: Add support for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1, 2, 4, 8} on ARM

 

Hi Weiming,

 

As far as I understand, atomic operations are available since ARMv6 (ex. ARM11), but not in v6M (ex. Cortex-M0), so you might need to change your condition a little.

 

cheers,

--renato

 

On 25 September 2013 19:15, Weiming Zhao <weimingz at codeaurora.org> wrote:

Hi,

 

Please review the attached patch. I added the macro definitions for ARMv7 or up.

 

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

 

From: İsmail Dönmez [mailto:ismail at donmez.ws] 
Sent: Wednesday, September 25, 2013 2:44 AM
To: weimingz at codeaurora.org
Cc: Eli Friedman; cfe-commits at cs.uiuc.edu


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

 

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.

 


_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130930/afd4dc42/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-PATCH-PR-12730-Add-_GCC_HAVE_SYNC_COMPARE_AND_SWAP-m.patch
Type: application/octet-stream
Size: 2690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130930/afd4dc42/attachment.obj>


More information about the cfe-commits mailing list