Boost logo

Boost :

Subject: Re: [boost] [atomic] unconditional cmpxchg8b support
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-10-23 05:51:04


On Oct 23, 2012 1:41 PM, "Tim Blechmann" <tim_at_[hidden]> wrote:
>
> hi helge & list,
>
> 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.
>
> whatever, i wonder if it would be reasonable to enable cmpxchg8b by
> default on *all* ia32 platforms, not just on i686. advantage: less
> trouble, as we can be sure that the instruction is generated.
> boost.lockfree e.g. is not lockfree on ia32 without. disadvantage: the
> code won't work on i386 and i486 machines.
>
> imo, all ia32 machines without cmpxchg8b should belong to a museum, and
> we could introduce a macro like BOOST_ATOMIC_NO_CMPXCHG8B if we really
> care of compiling for any of those machines.
>
> thoughts?

I think the library should be fair and compile for the platform it is
requested for. The question of the default target platform should be
directed to compiler or Debian dev team.


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