]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ia64.c (ia64_expand_atomic_op): Only use fetchadd{4,8}.acq instruction if CODE is...
authorJakub Jelinek <jakub@redhat.com>
Wed, 30 Nov 2005 08:30:48 +0000 (09:30 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 30 Nov 2005 08:30:48 +0000 (09:30 +0100)
* config/ia64/ia64.c (ia64_expand_atomic_op): Only use
fetchadd{4,8}.acq instruction if CODE is PLUS or MINUS, for MINUS
negate VAL.

From-SVN: r107703

gcc/ChangeLog
gcc/config/ia64/ia64.c

index 1dee38ec0c1b46c848a373849c4a08feab1c51fe..b7067e95002876e97f1849fb7c754e7df766fd99 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-30  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/ia64/ia64.c (ia64_expand_atomic_op): Only use
+       fetchadd{4,8}.acq instruction if CODE is PLUS or MINUS, for MINUS
+       negate VAL.
+
 2005-11-30  Paolo Bonzini  <bonzini@gnu.org>
 
        * simplify-rtx.c (simplify_plus_minus): Remove final parameter.
index 72676255c007a4ba30f1cc306194c5f2a2244340..a07cc6e2fa13d6577f770589951bf64c1429e8d1 100644 (file)
@@ -2039,8 +2039,13 @@ ia64_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
   enum insn_code icode;
 
   /* Special case for using fetchadd.  */
-  if ((mode == SImode || mode == DImode) && fetchadd_operand (val, mode))
+  if ((mode == SImode || mode == DImode)
+      && (code == PLUS || code == MINUS)
+      && fetchadd_operand (val, mode))
     {
+      if (code == MINUS)
+       val = GEN_INT (-INTVAL (val));
+
       if (!old_dst)
         old_dst = gen_reg_rtx (mode);