OSDN Git Service

* config/mips/mips.md (sync_compare_and_swap<mode>): Handle compare
authordaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Oct 2007 20:15:34 +0000 (20:15 +0000)
committerdaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Oct 2007 20:15:34 +0000 (20:15 +0000)
against constant zero.
* config/mips/mips.h (MIPS_COMPARE_AND_SWAP):  Handle constant zero
operand.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128963 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/mips/mips.h
gcc/config/mips/mips.md

index 476ca87..f1f28f7 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-02  David Daney  <ddaney@avtrex.com>
+
+       * config/mips/mips.md (sync_compare_and_swap<mode>): Handle compare
+       against constant zero.
+       * config/mips/mips.h (MIPS_COMPARE_AND_SWAP):  Handle constant zero
+       operand.
+
 2007-09-02  Kenneth Zadeck <zadeck@naturalbridge.com>
 
        * ra-conflict.c: New file.
index ce22f4f..534e88b 100644 (file)
@@ -2959,7 +2959,7 @@ while (0)
 #define MIPS_COMPARE_AND_SWAP(SUFFIX, OP)      \
   "%(%<%[%|sync\n"                             \
   "1:\tll" SUFFIX "\t%0,%1\n"                  \
-  "\tbne\t%0,%2,2f\n"                          \
+  "\tbne\t%0,%z2,2f\n"                         \
   "\t" OP "\t%@,%3\n"                          \
   "\tsc" SUFFIX "\t%@,%1\n"                    \
   "\tbeq\t%@,%.,1b\n"                          \
index 890cc70..38800ed 100644 (file)
   [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
        (match_operand:GPR 1 "memory_operand" "+R,R"))
    (set (match_dup 1)
-       (unspec_volatile:GPR [(match_operand:GPR 2 "register_operand" "d,d")
+       (unspec_volatile:GPR [(match_operand:GPR 2 "reg_or_0_operand" "dJ,dJ")
                              (match_operand:GPR 3 "arith_operand" "I,d")]
         UNSPEC_COMPARE_AND_SWAP))]
   "GENERATE_LL_SC"