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
a73a5114
Commit
a73a5114
authored
Sep 05, 1996
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(LEGITIMIZE_ADDRESS): Define nonempty.
From-SVN: r12691
parent
7a8940aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
2 deletions
+45
-2
gcc/config/sh/sh.h
+45
-2
No files found.
gcc/config/sh/sh.h
View file @
a73a5114
...
@@ -1059,9 +1059,52 @@ extern struct rtx_def *sh_builtin_saveregs ();
...
@@ -1059,9 +1059,52 @@ extern struct rtx_def *sh_builtin_saveregs ();
GO_IF_LEGITIMATE_ADDRESS.
GO_IF_LEGITIMATE_ADDRESS.
It is always safe for this macro to do nothing. It exists to recognize
It is always safe for this macro to do nothing. It exists to recognize
opportunities to optimize the output.
*/
opportunities to optimize the output.
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) ;
For the SH, if X is almost suitable for indexing, but the offset is
out of range, convert it into a normal form so that cse has a chance
of reducing the number of address registers used. */
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
{ \
if (GET_CODE (x) == PLUS \
&& (GET_MODE_SIZE (MODE) == 4 \
|| GET_MODE_SIZE (MODE) == 8) \
&& GET_CODE (XEXP (X, 1)) == CONST_INT \
&& BASE_REGISTER_RTX_P (XEXP (X, 0)) \
&& ! (TARGET_SH3E && MODE == SFmode)) \
{ \
rtx index_rtx = XEXP (X, 1); \
HOST_WIDE_INT offset = INTVAL (index_rtx), offset_base; \
rtx sum; \
\
GO_IF_LEGITIMATE_INDEX (MODE, index_rtx, WIN); \
/* On rare occaisons, we might get an unaligned pointer \
that is indexed in a way to give an aligned address. \
Therefore, keep the lower two bits in offset_base. */
\
/* Instead of offset_base 128..131 use 124..127, so that \
simple add suffices. */
\
if (offset > 127) \
{ \
offset_base = ((offset + 4) & ~60) - 4; \
} \
else \
offset_base = offset & ~60; \
/* Sometimes the normal form does not suit DImode. We \
could avoid that by using smaller ranges, but that \
would give less optimized code when SImode is
prevalent. */
\
if (GET_MODE_SIZE (MODE) + offset - offset_base <= 64) \
{ \
sum = expand_binop (Pmode, add_optab, XEXP (x, 0), \
GEN_INT (offset_base), NULL_RTX, 0, \
OPTAB_LIB_WIDEN); \
\
(X) = gen_rtx (PLUS, Pmode, sum, GEN_INT (offset - offset_base)); \
goto WIN; \
} \
} \
}
/* Go to LABEL if ADDR (a legitimate address expression)
/* Go to LABEL if ADDR (a legitimate address expression)
has an effect that depends on the machine mode it is used for. */
has an effect that depends on the machine mode it is used for. */
...
...
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