From: David Schleef Date: Mon, 19 May 2003 21:04:53 +0000 (+0000) Subject: Fix sparc asm code for gcc prior to 3.2 X-Git-Tag: BRANCH-ERROR-ROOT~190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0859eb74a1db71254960e1b320f984a4fa9777d;p=platform%2Fupstream%2Fgstreamer.git Fix sparc asm code for gcc prior to 3.2 Original commit message from CVS: Fix sparc asm code for gcc prior to 3.2 --- diff --git a/gst/gstatomic_impl.h b/gst/gstatomic_impl.h index 4945fce..bcb1777 100644 --- a/gst/gstatomic_impl.h +++ b/gst/gstatomic_impl.h @@ -253,6 +253,7 @@ gst_atomic_int_add (GstAtomicInt *aint, gint val) ptr = &(aint->counter); +#if __GNUC__ > 3 || (__GNUC__ >=3 && __GNUC_MINOR__ >= 2) __asm__ __volatile__("1: ldstub [%[ptr] + 3], %[lock]\n" "\torcc %[lock], 0, %%g0\n" "\tbne 1b\n" /* go back until we have the lock */ @@ -264,6 +265,19 @@ gst_atomic_int_add (GstAtomicInt *aint, gint val) : [inc] "=&r" (increment), [lock] "=r" (lock) : "0" (increment), [ptr] "r" (ptr), [val] "r" (val) ); +#else + __asm__ __volatile__("1: ldstub [%3 + 3], %1\n" + "\torcc %1, 0, %%g0\n" + "\tbne 1b\n" /* go back until we have the lock */ + "\tld [%3], %0\n" + "\tsra %0, 8, %0\n" + "\tadd %0, %4, %0\n" + "\tsll %0, 8, %1\n" + "\tst %1,[%3]\n" /* Release the lock */ + : "=&r" (increment), "=r" (lock) + : "0" (increment), "r" (ptr), "r" (val) + ); +#endif } GST_INLINE_FUNC void