diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-19 17:52:04 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-19 17:52:04 +0000 |
commit | 7459c90a9a5687b47dfc019e649031fa0db02377 (patch) | |
tree | 6bb4b9009d9f2d285b77183175577ae4cde50a76 /gcc/config/m68k | |
parent | d59573df2d3aa2061709882063dc6b87fdbf8e3c (diff) | |
download | gcc-7459c90a9a5687b47dfc019e649031fa0db02377.tar.gz |
PR target/25111
* config/m68k/m68k.md (bsetdreg): New pattern.
(bchgdreg, bclrdreg): Likewise.
PR target/25111
* gcc.target/m68k/pr25111.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242623 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m68k')
-rw-r--r-- | gcc/config/m68k/m68k.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 7b7f3731f07..208561996e7 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -5336,6 +5336,45 @@ } [(set_attr "type" "bitrw")]) +(define_insn "*bsetdreg" + [(set (match_operand:SI 0 "register_operand" "+d") + (ior:SI (ashift:SI (const_int 1) + (and:SI (match_operand:SI 1 "register_operand" "d") + (const_int 31))) + (match_operand:SI 2 "register_operand" "0")))] + "" +{ + CC_STATUS_INIT; + return "bset %1,%0"; +} + [(set_attr "type" "bitrw")]) + +(define_insn "*bchgdreg" + [(set (match_operand:SI 0 "register_operand" "+d") + (xor:SI (ashift:SI (const_int 1) + (and:SI (match_operand:SI 1 "register_operand" "d") + (const_int 31))) + (match_operand:SI 2 "register_operand" "0")))] + "" +{ + CC_STATUS_INIT; + return "bchg %1,%0"; +} + [(set_attr "type" "bitrw")]) + +(define_insn "*bclrdreg" + [(set (match_operand:SI 0 "register_operand" "+d") + (and:SI (rotate:SI (const_int -2) + (and:SI (match_operand:SI 1 "register_operand" "d") + (const_int 31))) + (match_operand:SI 2 "register_operand" "0")))] + "" +{ + CC_STATUS_INIT; + return "bclr %1,%0"; +} + [(set_attr "type" "bitrw")]) + ;; clear bit, bit number is int (define_insn "bclrmemqi" [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+m") |