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
9492393e
Commit
9492393e
authored
Jul 31, 2000
by
Kazu Hirata
Committed by
Jeff Law
Jul 31, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* h8300.c (split_adds_subs): Rearrange code for conciseness.
From-SVN: r35371
parent
91f9a498
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
47 deletions
+21
-47
gcc/ChangeLog
+4
-0
gcc/config/h8300/h8300.c
+17
-47
No files found.
gcc/ChangeLog
View file @
9492393e
2000-07-31 Kazu Hirata <kazu@hxi.com>
* h8300.c (split_adds_subs): Rearrange code for conciseness.
Mon Jul 31 12:27:55 MET DST 2000 Jan Hubicka <jh@suse.cz>
* i386.md (addsi to lea splitter, ashlqi3_1_lea): Fix bugs
...
...
gcc/config/h8300/h8300.c
View file @
9492393e
...
...
@@ -682,61 +682,31 @@ split_adds_subs (mode, operands)
{
HOST_WIDE_INT
val
=
INTVAL
(
operands
[
1
]);
rtx
reg
=
operands
[
0
];
rtx
tmp
;
HOST_WIDE_INT
sign
=
1
;
HOST_WIDE_INT
amount
;
/* Take care of +/- 4 for H8300H and H8300S. */
if
(
TARGET_H8300H
||
TARGET_H8300S
)
/* Force VAL to be positive so that we do not have to consider the
sign. */
if
(
val
<
0
)
{
/* Get the value in range of +/- 4. */
if
(
val
>
4
)
{
tmp
=
gen_rtx_PLUS
(
mode
,
reg
,
GEN_INT
(
4
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
reg
,
tmp
));
val
-=
4
;
}
else
if
(
val
<
-
4
)
{
tmp
=
gen_rtx_PLUS
(
mode
,
reg
,
GEN_INT
(
-
4
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
reg
,
tmp
));
val
+=
4
;
}
val
=
-
val
;
sign
=
-
1
;
}
if
(
val
==
4
||
val
==
-
4
)
/* Try different amounts in descending order. */
for
(
amount
=
(
TARGET_H8300H
||
TARGET_H8300S
)
?
4
:
2
;
amount
>
0
;
amount
/=
2
)
{
while
(
val
>=
amount
)
{
tmp
=
gen_rtx_PLUS
(
mode
,
reg
,
GEN_INT
(
val
));
rtx
tmp
=
gen_rtx_PLUS
(
mode
,
reg
,
GEN_INT
(
sign
*
amount
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
reg
,
tmp
));
return
;
val
-=
amount
;
}
}
/* Get the value in range of +/- 2. */
if
(
val
>
2
)
{
tmp
=
gen_rtx_PLUS
(
mode
,
reg
,
GEN_INT
(
2
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
reg
,
tmp
));
val
-=
2
;
}
else
if
(
val
<
-
2
)
{
tmp
=
gen_rtx_PLUS
(
mode
,
reg
,
GEN_INT
(
-
2
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
reg
,
tmp
));
val
+=
2
;
}
/* If not optimizing, we might be asked to add 0. */
if
(
val
==
0
)
return
;
/* We should have one or two now. */
if
(
val
>=
-
2
&&
val
<=
2
)
{
tmp
=
gen_rtx_PLUS
(
mode
,
reg
,
GEN_INT
(
val
));
emit_insn
(
gen_rtx_SET
(
VOIDmode
,
reg
,
tmp
));
return
;
}
/* In theory, this can't happen. */
abort
();
return
;
}
/* Return true if OP is a valid call operand, and OP represents
...
...
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