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
981c7390
Commit
981c7390
authored
Feb 28, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(eliminate_regs, case MULT): New case, to apply distributive law, when
needed. From-SVN: r6676
parent
7633af95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
21 deletions
+46
-21
gcc/reload1.c
+46
-21
No files found.
gcc/reload1.c
View file @
981c7390
...
...
@@ -2800,33 +2800,35 @@ eliminate_regs (x, mem_mode, insn)
}
return
x
;
case
EXPR_LIST
:
/* If we have something in XEXP (x, 0), the usual case, eliminate it. */
if
(
XEXP
(
x
,
0
))
{
new
=
eliminate_regs
(
XEXP
(
x
,
0
),
mem_mode
,
insn
);
if
(
new
!=
XEXP
(
x
,
0
))
x
=
gen_rtx
(
EXPR_LIST
,
REG_NOTE_KIND
(
x
),
new
,
XEXP
(
x
,
1
));
}
case
MULT
:
/* If this is the product of an eliminable register and a
constant, apply the distribute law and move the constant out
so that we have (plus (mult ..) ..). This is needed in order
to keep load-address insns valid. This case is pathalogical.
We ignore the possibility of overflow here. */
if
(
GET_CODE
(
XEXP
(
x
,
0
))
==
REG
&&
REGNO
(
XEXP
(
x
,
0
))
<
FIRST_PSEUDO_REGISTER
&&
GET_CODE
(
XEXP
(
x
,
1
))
==
CONST_INT
)
for
(
ep
=
reg_eliminate
;
ep
<
&
reg_eliminate
[
NUM_ELIMINABLE_REGS
];
ep
++
)
if
(
ep
->
from_rtx
==
XEXP
(
x
,
0
)
&&
ep
->
can_eliminate
)
{
if
(
!
mem_mode
/* Refs inside notes don't count for this purpose. */
&&
!
(
insn
!=
0
&&
(
GET_CODE
(
insn
)
==
EXPR_LIST
||
GET_CODE
(
insn
)
==
INSN_LIST
)))
ep
->
ref_outside_mem
=
1
;
return
plus_constant
(
gen_rtx
(
MULT
,
Pmode
,
ep
->
to_rtx
,
XEXP
(
x
,
1
)),
ep
->
previous_offset
*
INTVAL
(
XEXP
(
x
,
1
)));
}
/* ... fall through ... */
case
INSN_LIST
:
/* Now do eliminations in the rest of the chain. If this was
an EXPR_LIST, this might result in allocating more memory than is
strictly needed, but it simplifies the code. */
if
(
XEXP
(
x
,
1
))
{
new
=
eliminate_regs
(
XEXP
(
x
,
1
),
mem_mode
,
insn
);
if
(
new
!=
XEXP
(
x
,
1
))
return
gen_rtx
(
GET_CODE
(
x
),
GET_MODE
(
x
),
XEXP
(
x
,
0
),
new
);
}
return
x
;
case
CALL
:
case
COMPARE
:
case
MINUS
:
case
MULT
:
case
DIV
:
case
UDIV
:
case
MOD
:
case
UMOD
:
case
AND
:
case
IOR
:
case
XOR
:
...
...
@@ -2845,6 +2847,29 @@ eliminate_regs (x, mem_mode, insn)
}
return
x
;
case
EXPR_LIST
:
/* If we have something in XEXP (x, 0), the usual case, eliminate it. */
if
(
XEXP
(
x
,
0
))
{
new
=
eliminate_regs
(
XEXP
(
x
,
0
),
mem_mode
,
insn
);
if
(
new
!=
XEXP
(
x
,
0
))
x
=
gen_rtx
(
EXPR_LIST
,
REG_NOTE_KIND
(
x
),
new
,
XEXP
(
x
,
1
));
}
/* ... fall through ... */
case
INSN_LIST
:
/* Now do eliminations in the rest of the chain. If this was
an EXPR_LIST, this might result in allocating more memory than is
strictly needed, but it simplifies the code. */
if
(
XEXP
(
x
,
1
))
{
new
=
eliminate_regs
(
XEXP
(
x
,
1
),
mem_mode
,
insn
);
if
(
new
!=
XEXP
(
x
,
1
))
return
gen_rtx
(
GET_CODE
(
x
),
GET_MODE
(
x
),
XEXP
(
x
,
0
),
new
);
}
return
x
;
case
PRE_INC
:
case
POST_INC
:
case
PRE_DEC
:
...
...
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