summaryrefslogtreecommitdiff
path: root/gcc/config/h8300
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-04 18:05:06 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-04 18:05:06 +0000
commit9b406a2eb2137ee1f6dc91f651396b81397e0e33 (patch)
treebfacf793cedcd1a55cfa793c40c99522afd639ff /gcc/config/h8300
parent6ee177a2f9d39b86f3aaa184780cccfa24ba72c0 (diff)
downloadgcc-9b406a2eb2137ee1f6dc91f651396b81397e0e33.tar.gz
* config/h8300/h8300.md: Add comments about peephole2's.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78921 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/h8300')
-rw-r--r--gcc/config/h8300/h8300.md73
1 files changed, 64 insertions, 9 deletions
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 6bd51431cb2..b653cc9e1d7 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -4373,8 +4373,15 @@
;;
;; ---- 65535 geu/ltu mov.w
-;; For a small constant, it is cheaper to actually do the subtraction
-;; and then test the register.
+;; Transform
+;;
+;; cmp.l #1,er0
+;; beq .L1
+;;
+;; into
+;;
+;; dec.l #1,er0
+;; beq .L1
(define_peephole2
[(set (cc0)
@@ -4399,6 +4406,16 @@
(pc)))]
"operands[4] = GEN_INT (- INTVAL (operands[1]));")
+;; Transform
+;;
+;; cmp.l #65536,er0
+;; beq .L1
+;;
+;; into
+;;
+;; dec.l #1,e0
+;; beq .L1
+
(define_peephole2
[(set (cc0)
(compare (match_operand:SI 0 "register_operand" "")
@@ -4425,9 +4442,16 @@
(pc)))]
"operands[4] = GEN_INT (- INTVAL (operands[1]));")
-;; For certain (in)equality comparisons against a constant, we can
-;; XOR the register with the constant, and test the register against
-;; 0.
+;; Transform
+;;
+;; cmp.l #100,er0
+;; beq .L1
+;;
+;; into
+;;
+;; xor.b #100,er0
+;; mov.l er0,er0
+;; beq .L1
(define_peephole2
[(set (cc0)
@@ -4456,6 +4480,17 @@
(pc)))]
"")
+;; Transform
+;;
+;; cmp.l #-100,er0
+;; beq .L1
+;;
+;; into
+;;
+;; xor.b #99,er0
+;; not.l er0
+;; beq .L1
+
(define_peephole2
[(set (cc0)
(compare (match_operand:SI 0 "register_operand" "")
@@ -4484,6 +4519,17 @@
(pc)))]
"operands[4] = GEN_INT (INTVAL (operands[1]) ^ -1);")
+;; Transform
+;;
+;; cmp.l #-2147483648,er0
+;; beq .L1
+;;
+;; into
+;;
+;; rotl.l er0
+;; dec.l #1,er0
+;; beq .L1
+
(define_peephole2
[(set (cc0)
(compare (match_operand:SI 0 "register_operand" "")
@@ -4829,10 +4875,19 @@
const0_rtx);
})
-;; For constants like -1, -2, 1, 2, it is still cheaper to make a copy
-;; of the register being tested, do the subtraction on the copy, and
-;; then test the copy. We avoid this transformation if we see more
-;; than one copy of the same compare insn.
+;; Transform
+;;
+;; cmp.l #1,er0
+;; beq .L1
+;;
+;; into
+;;
+;; mov.l er0,er1
+;; dec.l #1,er1
+;; beq .L1
+
+;; We avoid this transformation if we see more than one copy of the
+;; same compare insn.
(define_peephole2
[(match_scratch:SI 4 "r")