Boost logo

Boost :

Subject: Re: [boost] [atomic] unconditional cmpxchg8b support
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-10-23 08:23:17


On 23/10/12 13:46, Tim Blechmann wrote:
>>> using boost.atomic on ia32/gcc causes me quite some headaches these
>>> days, as the cmpxchg8b instruction is enabled via the __i686__ or
>>> __x86_64__ macros.
>>> however on debian for example, the compiler defaults to generate code
>>> for i486. cmpxchg8b has been introduced with the p5 architecture,
>>> though, so compiling without specifying a -march flag won't generate the
>>> instruction.
>>
>> GCC will not let you use instructions outside of the target architecture.
>
> fyi, boost.atomic is using inline assembly

While inline assembly may allow to circumvent that restriction, I do not
think it is a good idea to force a design that requires their usage.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk