[Patch] Make atomics work on FreeBSD+arm

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun May 26 09:22:07 PDT 2013


On 26 May 2013 11:39, Ed Schouten <ed at 80386.nl> wrote:
> Hi,
>
> Some time ago there was discussion about the value of
> MaxAtomicInlineWidth on ARM, which was not set, causing Clang not to
> fall back to the __sync_* intrinsics. It seems that this got fixed for
> Linux (r181728 and r181750), even though this issue is also present on
> FreeBSD.
>
> On FreeBSD, we can simply set MaxAtomicInlineWidth unconditionally, as
> FreeBSD/arm always provides these __sync_* intrinsics:


Note that this patch (like r181728), makes clang *not* use the
function calls and instead use atomic instructions. This is safe given
* How these functions are implemented on linux (call a vdso in the kernel)
* The assumption that the kernel is as new as cpu.

Given that older binaries/libraries built by gcc that call those
functions are still ABI compatible with newer binaries that use atomic
instructions.

The provided patch would also try to use atomic instructions in armv5,
where they are not available. Are those not supported by freebsd?

Cheers,
Rafael



More information about the cfe-commits mailing list