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
fe21b3c2
Commit
fe21b3c2
authored
Jul 07, 2015
by
Anatoly Sokolov
Committed by
Anatoly Sokolov
Jul 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MOXIE] Hookize GO_IF_LEGITIMATE_ADDRESS
From-SVN: r225524
parent
3457d39e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
24 deletions
+48
-24
gcc/ChangeLog
+7
-0
gcc/config/moxie/moxie.c
+41
-0
gcc/config/moxie/moxie.h
+0
-24
No files found.
gcc/ChangeLog
View file @
fe21b3c2
2015-07-07 Anatoly Sokolov <aesok@post.ru>
* config/moxie/moxie.h (GO_IF_LEGITIMATE_ADDRESS): Remove macros.
* config/moxie/moxie.c (moxie_reg_ok_for_base_p,
moxie_legitimate_address_p): New functions.
(TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define.
2015-07-07 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/66642
...
...
gcc/config/moxie/moxie.c
View file @
fe21b3c2
...
...
@@ -595,6 +595,45 @@ moxie_offset_address_p (rtx x)
return
0
;
}
/* Helper function for `moxie_legitimate_address_p'. */
static
bool
moxie_reg_ok_for_base_p
(
const_rtx
reg
,
bool
strict_p
)
{
int
regno
=
REGNO
(
reg
);
if
(
strict_p
)
return
HARD_REGNO_OK_FOR_BASE_P
(
regno
)
||
HARD_REGNO_OK_FOR_BASE_P
(
reg_renumber
[
regno
]);
else
return
!
HARD_REGISTER_NUM_P
(
regno
)
||
HARD_REGNO_OK_FOR_BASE_P
(
regno
);
}
/* Worker function for TARGET_LEGITIMATE_ADDRESS_P. */
static
bool
moxie_legitimate_address_p
(
machine_mode
mode
ATTRIBUTE_UNUSED
,
rtx
x
,
bool
strict_p
,
addr_space_t
as
)
{
gcc_assert
(
ADDR_SPACE_GENERIC_P
(
as
));
if
(
GET_CODE
(
x
)
==
PLUS
&&
REG_P
(
XEXP
(
x
,
0
))
&&
moxie_reg_ok_for_base_p
(
XEXP
(
x
,
0
),
strict_p
)
&&
CONST_INT_P
(
XEXP
(
x
,
1
))
&&
IN_RANGE
(
INTVAL
(
XEXP
(
x
,
1
)),
-
32768
,
32767
))
return
true
;
if
(
REG_P
(
x
)
&&
moxie_reg_ok_for_base_p
(
x
,
strict_p
))
return
true
;
if
(
GET_CODE
(
x
)
==
SYMBOL_REF
||
GET_CODE
(
x
)
==
LABEL_REF
||
GET_CODE
(
x
)
==
CONST
)
return
true
;
return
false
;
}
/* The Global `targetm' Variable. */
/* Initialize the GCC target structure. */
...
...
@@ -615,6 +654,8 @@ moxie_offset_address_p (rtx x)
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE moxie_function_arg_advance
#undef TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P
#define TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P moxie_legitimate_address_p
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS moxie_setup_incoming_varargs
...
...
gcc/config/moxie/moxie.h
View file @
fe21b3c2
...
...
@@ -451,30 +451,6 @@ enum reg_class
elements of a jump-table should have. */
#define CASE_VECTOR_MODE SImode
/* A C compound statement with a conditional `goto LABEL;' executed
if X (an RTX) is a legitimate memory address on the target machine
for a memory operand of mode MODE. */
#define GO_IF_LEGITIMATE_ADDRESS(MODE,X,LABEL) \
do { \
if (GET_CODE(X) == PLUS) \
{ \
rtx op1,op2; \
op1 = XEXP(X,0); \
op2 = XEXP(X,1); \
if (GET_CODE(op1) == REG \
&& GET_CODE(op2) == CONST_INT \
&& IN_RANGE (INTVAL (op2), -32768, 32767) \
&& REGNO_OK_FOR_BASE_P(REGNO(op1))) \
goto LABEL; \
} \
if (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X))) \
goto LABEL; \
if (GET_CODE (X) == SYMBOL_REF \
|| GET_CODE (X) == LABEL_REF \
|| GET_CODE (X) == CONST) \
goto LABEL; \
} while (0)
/* Run-time Target Specification */
#define TARGET_CPU_CPP_BUILTINS() \
...
...
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