From 966b774d3ee4a815985f45e5357d4ebcc789c413 Mon Sep 17 00:00:00 2001 From: David Daney Date: Tue, 2 Oct 2007 20:15:34 +0000 Subject: [PATCH] mips.md (sync_compare_and_swap): Handle compare against constant zero. * config/mips/mips.md (sync_compare_and_swap): Handle compare against constant zero. * config/mips/mips.h (MIPS_COMPARE_AND_SWAP): Handle constant zero operand. From-SVN: r128963 --- gcc/ChangeLog | 7 +++++++ gcc/config/mips/mips.h | 2 +- gcc/config/mips/mips.md | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 476ca871393..f1f28f7c372 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-10-02 David Daney + + * config/mips/mips.md (sync_compare_and_swap): Handle compare + against constant zero. + * config/mips/mips.h (MIPS_COMPARE_AND_SWAP): Handle constant zero + operand. + 2007-09-02 Kenneth Zadeck * ra-conflict.c: New file. diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index ce22f4f5be9..534e88b36e6 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -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" \ diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 890cc706590..38800ed15e7 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -4329,7 +4329,7 @@ [(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"