]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[PARISC] small atomic.h optimization
authorCarlos O'Donell <carlos_odonell@mentor.com>
Thu, 22 Mar 2012 04:05:14 +0000 (00:05 -0400)
committerCarlos O'Donell <carlos_odonell@mentor.com>
Thu, 22 Mar 2012 04:05:14 +0000 (00:05 -0400)
We do not negate the light-weight syscall return and instead
just check for the negative errno value allowing the compiler
to optimize as required.

ChangeLog.hppa
sysdeps/unix/sysv/linux/hppa/bits/atomic.h

index 52714754426c5f1caed4785380453c953d325c7b..700c78fe05ace0892c282f0a2c879ba2b82b30a6 100644 (file)
@@ -1,3 +1,10 @@
+2012-03-22  Carlos O'Donell  <carlos@systemhalted.org>
+
+       [BZ #6730]
+
+       * sysdeps/unix/sysv/linux/hppa/bits/atomic.h: Don't negate %r21 and
+       check for -EFAULT and -ENOSYS instead.
+
 2012-03-09  Richard Henderson  <rth@twiddle.net>
 
        * sysdeps/hppa/hppa1.1/s_signbit.c: Use <> to include math_private.h.
index 89823d279f95f55c1e6a9eecd3333c23ad91f72f..d94daf10a91635d15b125adcfb46d415625a09b3 100644 (file)
@@ -79,14 +79,13 @@ typedef uintmax_t uatomic_max_t;
        "cmpb,=,n %%r25, %%r21, 0b              \n\t"                   \
        "nop                                    \n\t"                   \
        "stw    %%r28, %0                       \n\t"                   \
-        "sub   %%r0, %%r21, %%r21              \n\t"                   \
        "stw    %%r21, %1                       \n\t"                   \
        : "=m" (lws_ret), "=m" (lws_errno)                              \
         : "r" (mem), "r" (oldval), "r" (newval)                                \
        : _LWS_CLOBBER                                                  \
      );                                                                        \
                                                                        \
-     if(lws_errno == EFAULT || lws_errno == ENOSYS)                    \
+     if(lws_errno == -EFAULT || lws_errno == -ENOSYS)                  \
        ABORT_INSTRUCTION;                                              \
                                                                        \
      lws_ret;                                                          \