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
08cddb03
Commit
08cddb03
authored
Mar 10, 1993
by
Jeff Law
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* pa.md (add reg and large int): New define_splits for the combiner.
From-SVN: r3695
parent
d3907945
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
gcc/config/pa/pa.md
+56
-0
No files found.
gcc/config/pa/pa.md
View file @
08cddb03
...
...
@@ -1681,6 +1681,62 @@
""
"uaddcm %2,%1,%0")
;; define_splits to optimize cases of adding a constant integer
;; to a register when the constant does not fit in 14 bits.
*
/
(define_split
[
(set (match_operand:SI 0 "register_operand" "")
(plus:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "const_int_operand" "")))
(clobber (match_operand:SI 4 "register_operand" ""))]
"! cint_ok_for_move (INTVAL (operands
[
2
]
))
&& VAL_14_BITS_P (INTVAL (operands
[
2
]
) / 2)"
[
(set (match_dup 4) (plus:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0) (plus:SI (match_dup 4) (match_dup 3)))]
"
{
int val = INTVAL (operands
[
2
]
);
int low = (val < 0) ? -0x2000 : 0x1fff;
int rest = val - low;
operands
[
2
]
= GEN_INT (rest);
operands
[
3
]
= GEN_INT (low);
}")
(define_split
[
(set (match_operand:SI 0 "register_operand" "")
(plus:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "const_int_operand" "")))
(clobber (match_operand:SI 4 "register_operand" ""))]
"! cint_ok_for_move (INTVAL (operands
[
2
]
))"
[
(set (match_dup 4) (match_dup 2))
(set (match_dup 0) (plus:SI (mult:SI (match_dup 4) (match_dup 3))
(match_dup 1)))]
"
{
int intval = INTVAL (operands
[
2
]
);
/
*
Try diving the constant by 2, then 4, and finally 8 to see
if we can get a constant which can be loaded into a register
in a single instruction (cint_ok_for_move).
*
/
if (intval % 2 == 0 && cint_ok_for_move (intval / 2))
{
operands
[
2
]
= GEN_INT (INTVAL (operands
[
2
]
) / 2);
operands
[
3
]
= GEN_INT (2);
}
else if (intval % 4 == 0 && cint_ok_for_move (intval / 4))
{
operands
[
2
]
= GEN_INT (INTVAL (operands
[
2
]
) / 4);
operands
[
3
]
= GEN_INT (4);
}
else if (intval % 8 == 0 && cint_ok_for_move (intval / 8))
{
operands
[
2
]
= GEN_INT (INTVAL (operands
[
2
]
) / 8);
operands
[
3
]
= GEN_INT (8);
}
else
FAIL;
}")
(define_insn "addsi3"
[
(set (match_operand:SI 0 "register_operand" "=r,r")
(plus:SI (match_operand:SI 1 "register_operand" "%r,r")
...
...
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