diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-09-09 14:07:01 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-09-09 14:07:01 +0000 |
commit | c68f6b1ccf6b1d5b79d7ffc7d300cabf16fe9a10 (patch) | |
tree | 26dfbcf9ccb9b9cd028ed36114887e9cce217ced | |
parent | 62e39b06536e5378f7e2d0c99a9440784b019540 (diff) | |
download | gcc-c68f6b1ccf6b1d5b79d7ffc7d300cabf16fe9a10.tar.gz |
* config/nvptx/nvptx.md (atomic_compare_and_swap<mode>): Use
sel_truesi, not andsi.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227587 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.md | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 618bbe63abc..ed788ff4d34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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... diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index b857e53bb22..f2ec3e4b0bf 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -1351,14 +1351,12 @@ (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; }) |