From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2005-04-04 16:05:57
Peter Dimov wrote:
> I don't need the value, but it doesn't matter; it's just as fast. Or just as
> slow. x86 isn't very predictable (I don't know how familiar you are with
> it); some instructions look better on paper but are (or were) actually
1996 or 1997 was the last time I wrote something in x86 asm. On "Blue
> slower (on 586 and above) than an equivalent RISC-style read/modify/write
> sequence, inc included. And of course the rules change with every generation
> (in some cases, sub-generation) of CPUs.
> Basically, the only way to know which is faster is to measure it.
> > Nah. For the sake of killing C/C++ volatiles rather sooner than later,
> > I strongly suggest that you hide that load in asm. Just add load+cmp
> > followed by ZF branch prior to "lock dec" which also sets ZF, IIRC.
> Eh, __asm__ is no better than a volatile. Both are non-portable.
Except that volatile has defined semantics (both must die too in
favor of threads and exceptions) that has really nothing to do
with multiple threads and msync. I mean "decoration function" for
sig_atomic_t statics and setjmp/longjmp()-sensitive locals in C
and POSIX (C++ aside for a moment).
"Promotion" of volatile mess is much worse than use of good asm,
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk