nvptx.md (atomic_compare_and_swap<mode>): Use sel_truesi, not andsi.
authorNathan Sidwell <nathan@acm.org>
Wed, 9 Sep 2015 14:07:01 +0000 (14:07 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 9 Sep 2015 14:07:01 +0000 (14:07 +0000)
* config/nvptx/nvptx.md (atomic_compare_and_swap<mode>): Use
sel_truesi, not andsi.

From-SVN: r227587

gcc/ChangeLog
gcc/config/nvptx/nvptx.md

index 618bbe63abc271a8a576acb75dfe4579791466ac..ed788ff4d344f4b0803fa4b21f6025d81b8368d7 100644 (file)
@@ -1,3 +1,8 @@
+2015-09-09  Nathan Sidwell  <nathan@acm.org>
+
+       * config/nvptx/nvptx.md (atomic_compare_and_swap<mode>): Use
+       sel_truesi, not andsi.
+
 2015-09-09  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/arm/arm.md (*subsi3_compare0): Rename to...
index b857e53bb22053de7f35423362fd4f79a7dd44d7..f2ec3e4b0bf7490a66debaa67a907fe0ec7d97f2 100644 (file)
    (match_operand:SI 7 "const_int_operand")]           ;; failure model
   ""
 {
-  emit_insn (gen_atomic_compare_and_swap<mode>_1 (operands[1], operands[2], operands[3],
-                                                 operands[4], operands[6]));
-
-  rtx tmp = gen_reg_rtx (GET_MODE (operands[0]));
-  emit_insn (gen_cstore<mode>4 (tmp,
-                               gen_rtx_EQ (SImode, operands[1], operands[3]),
-                               operands[1], operands[3]));
-  emit_insn (gen_andsi3 (operands[0], tmp, GEN_INT (1)));
+  emit_insn (gen_atomic_compare_and_swap<mode>_1
+    (operands[1], operands[2], operands[3], operands[4], operands[6]));
+
+  rtx cond = gen_reg_rtx (BImode);
+  emit_move_insn (cond, gen_rtx_EQ (BImode, operands[1], operands[3]));
+  emit_insn (gen_sel_truesi (operands[0], cond, GEN_INT (1), GEN_INT (0)));
   DONE;
 })