[email protected] writes:
[snip]
> +#if (defined(PIPE_CC_GCC) && defined(__i386__))

         ^^^^^^^^^^^^^^^^^

This is basically an #ifdef (__GNUC__), I'm guessing?

> +struct pipe_atomic {
> +   int32_t count;
> +};
[snip]
> +static INLINE int32_t
> +p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t new)
> +{
> +   int32_t previous;
> +
> +   __asm__ __volatile__("lock; cmpxchgl %k1,%2":"=a"(previous)
> +                     :"r"(new), "m"(v->count), "0"(old)
> +                     :"memory");
> +
> +   return previous;
> +}

If the code is only compiled on gcc anyway, it seems like one could
apply the atomics primitives provided by the compiler:

    http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Atomic-Builtins.html

That might allow you to remove the __i386__ qualification as well.

(Note that I've never tried these extensions, just an idea.)

-tom

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to