[CFT] i386 sync functions for PR 39677

Richard Henderson rth@redhat.com
Sat Oct 17 17:14:00 GMT 2009


On 10/16/2009 11:07 PM, Ross Ridge wrote:
> Is really worth support supporting older CPUs?  It wouldn't seem
> unreasonble to me for GCC to require that the CPU support at least the
> CMPXCHG8 instruction (ie. Pentium or better) to use the __sync* functions.
>
> Not that it really matters, but your CPUID logic seems a bit wrong.
> All Intel 80486 CPUs supported CMPXCHG, but only the later ones supported
> CPUID.

You're quite right -- I'd misremembered cmpxchg in 586.

And having slept on the problem I'm sure I don't think we should get 
into the spinlock thing -- there's too many ways for that to go wrong. 
I'll simplify the cpuid check to only look for the amd cpu with the 
eratta, and use the atomic instructions as needed.  The resulting sigill 
will be no different than at present, when we simply compile the 
libraries with -march=i586.


r~



More information about the Gcc-patches mailing list