On Mon, Mar 16, 2009 at 10:41 AM, Thomas Hellstrom <thellst...@vmware.com> wrote: > tom fogal wrote: >> thellst...@vmware.com writes: >> [snip] >> >>> +#if (defined(PIPE_CC_GCC) && defined(__i386__)) >>> >> >> ^^^^^^^^^^^^^^^^^ >> >> This is basically an #ifdef (__GNUC__), I'm guessing? >> >> > Yes, however it seems like the rest of the gallium code is using private > defines for this, so > I'll stick to that. >>> +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 >> > Thanks for the hint! > The code is not only for GCC, but we'll probably have to code up a lot > of special cases, so this will definitely help. > I'll give it a check. >
Shouldn't we be using PIPE_ARCH_X86 instead of __i386__?? See `pipe/p_config.h'. #if defined(__i386__) /* gcc */ || defined(_M_IX86) /* msvc */ || defined(_X86_) || defined(__386__) || defined(i386) #define PIPE_ARCH_X86 #endif -- Pozdrawiam, Michal Krol ------------------------------------------------------------------------------ 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 Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev