Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
4302db79
Commit
4302db79
authored
Feb 13, 2003
by
Kazu Hirata
Committed by
Kazu Hirata
Feb 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* config/h8300/h8300.md (a peephole2): New.
From-SVN: r62842
parent
6b603eb9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
gcc/ChangeLog
+4
-0
gcc/config/h8300/h8300.md
+62
-0
No files found.
gcc/ChangeLog
View file @
4302db79
2003
-
02
-
13
Kazu
Hirata
<
kazu
@cs
.
umass
.
edu
>
*
config
/
h8300
/
h8300
.
md
(
a
peephole2
)
:
New
.
2003
-
02
-
13
Robert
Lipe
<
robertlipe
@usa
.
net
>
Gerald
Pfeifer
<
pfeifer
@dbai
.
tuwien
.
ac
.
at
>
...
...
gcc/config/h8300/h8300.md
View file @
4302db79
...
...
@@ -3435,6 +3435,36 @@
(pc)))]
"")
;; (compare:SI (reg) (const_int)) takes 6 bytes, so we try to achieve
;; the equivalent with shorter sequences. Here is the summary.
;;
;; reg const_int use insn
;; live -2 eq/ne copy and inc.l
;; live -1 eq/ne copy and inc.l
;; live 1 eq/ne copy and dec.l
;; live 2 eq/ne copy and dec.l
;; dead -6 eq/ne adds and inc.l
;; dead -5 eq/ne adds and inc.l
;; dead -4 eq/ne adds and test
;; dead -3 eq/ne adds and inc.l
;; dead -2 eq/ne inc.l
;; dead -1 eq/ne inc.l
;; dead 1 eq/ne dec.l
;; dead 2 eq/ne dec.l
;; dead 0x000000?? except 1 and 2 eq/ne xor.b and test
;; dead 0x0000??00 eq/ne xor.b and test
;; dead 0x0000ffff eq/ne not.w and test
;; dead 0xffff0000 eq/ne not.w and test
;; dead 1 geu/ltu and.b and test
;; dead 3 geu/ltu and.b and test
;; dead 7 geu/ltu and.b and test
;; dead 15 geu/ltu and.b and test
;; dead 31 geu/ltu and.b and test
;; dead 63 geu/ltu and.b and test
;; dead 127 geu/ltu and.b and test
;; dead 255 geu/ltu and.b and test
;; dead 65535 geu/ltu mov.w
;; For a small constant, it is cheaper to actually do the subtraction
;; and then test the register.
...
...
@@ -3480,6 +3510,38 @@
"operands
[
1
]
= GEN_INT (- INTVAL (operands
[
1
]
));
split_adds_subs (SImode, operands, 1);")
;; For certain (in)equaltity comparisions against a constant, we can
;; XOR the register with the constant, and test the register against
;; 0.
(define_peephole2
[
(set (cc0)
(compare:SI (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "const_int_operand" "")))
(set (pc)
(if_then_else (match_operator 3 "eqne_operator"
[
(cc0) (const_int 0)
]
)
(label_ref (match_operand 2 "" ""))
(pc)))]
"(TARGET_H8300H || TARGET_H8300S)
&& peep2_reg_dead_p (1, operands
[
0
]
)
&& ((INTVAL (operands
[
1
]
) & 0x00ff) == INTVAL (operands
[
1
]
)
|| (INTVAL (operands
[
1
]
) & 0xff00) == INTVAL (operands
[
1
]
)
|| INTVAL (operands
[
1
]
) == 0x0000ffff
|| INTVAL (operands
[
1
]
) == 0xffff0000)
&& INTVAL (operands
[
1
]
) != 1
&& INTVAL (operands
[
1
]
) != 2"
[
(set (match_dup 0)
(xor:SI (match_dup 0)
(match_dup 1)))
(set (cc0)
(match_dup 0))
(set (pc)
(if_then_else (match_op_dup 3
[
(cc0) (const_int 0)
]
)
(label_ref (match_dup 2))
(pc)))]
"")
;; Transform A <= 1 to (A & 0xfffffffe) == 0.
(define_peephole2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment