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
8aecce0a
Commit
8aecce0a
authored
Sep 29, 1992
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_binop): Convert X - C to X + (-C).
From-SVN: r2278
parent
7f11183e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
gcc/optabs.c
+9
-13
No files found.
gcc/optabs.c
View file @
8aecce0a
...
...
@@ -297,6 +297,15 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
op1
=
force_not_mem
(
op1
);
}
/* If subtracting an integer constant, convert this into an addition of
the negated constant. */
if
(
binoptab
==
sub_optab
&&
GET_CODE
(
op1
)
==
CONST_INT
)
{
op1
=
negate_rtx
(
mode
,
op1
);
binoptab
=
add_optab
;
}
/* If we are inside an appropriately-short loop and one operand is an
expensive constant, force it into a register. */
if
(
CONSTANT_P
(
op0
)
&&
preserve_subexpressions_p
()
...
...
@@ -307,19 +316,6 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
&&
rtx_cost
(
op1
,
binoptab
->
code
)
>
2
)
op1
=
force_reg
(
shift_op
?
word_mode
:
mode
,
op1
);
#if 0 /* Turned off because it seems to be a kludgy method. */
/* If subtracting integer from pointer, and the pointer has a special mode,
then change it to an add. We use the add insn of Pmode for combining
integers with pointers, and the sub insn to subtract two pointers. */
if (binoptab == sub_optab
&& GET_MODE (op0) == Pmode && GET_MODE (op1) != Pmode)
{
op1 = negate_rtx (GET_MODE(op1), op1);
binoptab = add_optab;
}
#endif /* 0 */
/* Record where to delete back to if we backtrack. */
last
=
get_last_insn
();
...
...
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