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
08394eef
Commit
08394eef
authored
Dec 29, 2000
by
Bernd Schmidt
Committed by
Bernd Schmidt
Dec 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce ORIGINAL_REGNO macro
From-SVN: r38546
parent
5538d8a0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
21 deletions
+59
-21
gcc/ChangeLog
+12
-0
gcc/emit-rtl.c
+27
-13
gcc/final.c
+1
-0
gcc/print-rtl.c
+6
-0
gcc/regrename.c
+3
-1
gcc/rtl.def
+4
-6
gcc/rtl.h
+6
-1
No files found.
gcc/ChangeLog
View file @
08394eef
2000-12-29 Bernd Schmidt <bernds@redhat.com>
* emit-rtl.c (gen_raw_REG): New function.
(gen_rtx_REG, gen_reg_rtx, init_emit_once): Use it instead of
gen_rtx_raw_REG.
* print-rtl.c (print_rtx): Print ORIGINAL_REGNO.
* final.c (alter_subreg): Update it.
* regrename.c (do_replace): Likewise. Use gen_raw_REG.
* rtl.def (REG): Update comment.
* rtl.h (X0UINT, ORIGINAL_REGNO): New macros.
(gen_raw_REG): Declare.
2000-12-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2000-12-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* tree.c (get_set_constructor_bits): Use host_integerp and
* tree.c (get_set_constructor_bits): Use host_integerp and
...
...
gcc/emit-rtl.c
View file @
08394eef
...
@@ -228,6 +228,20 @@ rtx_htab_mark (htab)
...
@@ -228,6 +228,20 @@ rtx_htab_mark (htab)
htab_traverse
(
*
((
htab_t
*
)
htab
),
rtx_htab_mark_1
,
NULL
);
htab_traverse
(
*
((
htab_t
*
)
htab
),
rtx_htab_mark_1
,
NULL
);
}
}
/* Generate a new REG rtx. Make sure ORIGINAL_REGNO is set properly, and
don't attempt to share with the various global pieces of rtl (such as
frame_pointer_rtx). */
rtx
gen_raw_REG
(
mode
,
regno
)
enum
machine_mode
mode
;
int
regno
;
{
rtx
x
=
gen_rtx_raw_REG
(
mode
,
regno
);
ORIGINAL_REGNO
(
x
)
=
regno
;
return
x
;
}
/* There are some RTL codes that require special attention; the generation
/* There are some RTL codes that require special attention; the generation
functions do the raw handling. If you add to this list, modify
functions do the raw handling. If you add to this list, modify
special_rtx in gengenrtl.c as well. */
special_rtx in gengenrtl.c as well. */
...
@@ -319,7 +333,7 @@ gen_rtx_REG (mode, regno)
...
@@ -319,7 +333,7 @@ gen_rtx_REG (mode, regno)
return
stack_pointer_rtx
;
return
stack_pointer_rtx
;
}
}
return
gen_r
tx_r
aw_REG
(
mode
,
regno
);
return
gen_raw_REG
(
mode
,
regno
);
}
}
rtx
rtx
...
@@ -569,7 +583,7 @@ gen_reg_rtx (mode)
...
@@ -569,7 +583,7 @@ gen_reg_rtx (mode)
f
->
emit
->
regno_pointer_align_length
=
old_size
*
2
;
f
->
emit
->
regno_pointer_align_length
=
old_size
*
2
;
}
}
val
=
gen_r
tx_r
aw_REG
(
mode
,
reg_rtx_no
);
val
=
gen_raw_REG
(
mode
,
reg_rtx_no
);
regno_reg_rtx
[
reg_rtx_no
++
]
=
val
;
regno_reg_rtx
[
reg_rtx_no
++
]
=
val
;
return
val
;
return
val
;
}
}
...
@@ -4053,22 +4067,22 @@ init_emit_once (line_numbers)
...
@@ -4053,22 +4067,22 @@ init_emit_once (line_numbers)
pc_rtx
=
gen_rtx
(
PC
,
VOIDmode
);
pc_rtx
=
gen_rtx
(
PC
,
VOIDmode
);
cc0_rtx
=
gen_rtx
(
CC0
,
VOIDmode
);
cc0_rtx
=
gen_rtx
(
CC0
,
VOIDmode
);
stack_pointer_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
STACK_POINTER_REGNUM
);
stack_pointer_rtx
=
gen_raw_REG
(
Pmode
,
STACK_POINTER_REGNUM
);
frame_pointer_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
FRAME_POINTER_REGNUM
);
frame_pointer_rtx
=
gen_raw_REG
(
Pmode
,
FRAME_POINTER_REGNUM
);
if
(
hard_frame_pointer_rtx
==
0
)
if
(
hard_frame_pointer_rtx
==
0
)
hard_frame_pointer_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
hard_frame_pointer_rtx
=
gen_raw_REG
(
Pmode
,
HARD_FRAME_POINTER_REGNUM
);
HARD_FRAME_POINTER_REGNUM
);
if
(
arg_pointer_rtx
==
0
)
if
(
arg_pointer_rtx
==
0
)
arg_pointer_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
ARG_POINTER_REGNUM
);
arg_pointer_rtx
=
gen_raw_REG
(
Pmode
,
ARG_POINTER_REGNUM
);
virtual_incoming_args_rtx
=
virtual_incoming_args_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
VIRTUAL_INCOMING_ARGS_REGNUM
);
gen_raw_REG
(
Pmode
,
VIRTUAL_INCOMING_ARGS_REGNUM
);
virtual_stack_vars_rtx
=
virtual_stack_vars_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
VIRTUAL_STACK_VARS_REGNUM
);
gen_raw_REG
(
Pmode
,
VIRTUAL_STACK_VARS_REGNUM
);
virtual_stack_dynamic_rtx
=
virtual_stack_dynamic_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
VIRTUAL_STACK_DYNAMIC_REGNUM
);
gen_raw_REG
(
Pmode
,
VIRTUAL_STACK_DYNAMIC_REGNUM
);
virtual_outgoing_args_rtx
=
virtual_outgoing_args_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
VIRTUAL_OUTGOING_ARGS_REGNUM
);
gen_raw_REG
(
Pmode
,
VIRTUAL_OUTGOING_ARGS_REGNUM
);
virtual_cfa_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
VIRTUAL_CFA_REGNUM
);
virtual_cfa_rtx
=
gen_raw_REG
(
Pmode
,
VIRTUAL_CFA_REGNUM
);
/* These rtx must be roots if GC is enabled. */
/* These rtx must be roots if GC is enabled. */
ggc_add_rtx_root
(
global_rtl
,
GR_MAX
);
ggc_add_rtx_root
(
global_rtl
,
GR_MAX
);
...
@@ -4148,7 +4162,7 @@ init_emit_once (line_numbers)
...
@@ -4148,7 +4162,7 @@ init_emit_once (line_numbers)
#ifdef RETURN_ADDRESS_POINTER_REGNUM
#ifdef RETURN_ADDRESS_POINTER_REGNUM
return_address_pointer_rtx
return_address_pointer_rtx
=
gen_r
tx_r
aw_REG
(
Pmode
,
RETURN_ADDRESS_POINTER_REGNUM
);
=
gen_raw_REG
(
Pmode
,
RETURN_ADDRESS_POINTER_REGNUM
);
#endif
#endif
#ifdef STRUCT_VALUE
#ifdef STRUCT_VALUE
...
...
gcc/final.c
View file @
08394eef
...
@@ -3169,6 +3169,7 @@ alter_subreg (x)
...
@@ -3169,6 +3169,7 @@ alter_subreg (x)
#endif
#endif
PUT_CODE
(
x
,
REG
);
PUT_CODE
(
x
,
REG
);
REGNO
(
x
)
=
regno
;
REGNO
(
x
)
=
regno
;
ORIGINAL_REGNO
(
x
)
=
ORIGINAL_REGNO
(
y
);
/* This field has a different meaning for REGs and SUBREGs. Make sure
/* This field has a different meaning for REGs and SUBREGs. Make sure
to clear it! */
to clear it! */
x
->
used
=
0
;
x
->
used
=
0
;
...
...
gcc/print-rtl.c
View file @
08394eef
...
@@ -170,6 +170,12 @@ print_rtx (in_rtx)
...
@@ -170,6 +170,12 @@ print_rtx (in_rtx)
An exception is the third field of a NOTE, where it indicates
An exception is the third field of a NOTE, where it indicates
that the field has several different valid contents. */
that the field has several different valid contents. */
case
'0'
:
case
'0'
:
if
(
i
==
1
&&
GET_CODE
(
in_rtx
)
==
REG
)
{
if
(
REGNO
(
in_rtx
)
!=
ORIGINAL_REGNO
(
in_rtx
))
fprintf
(
outfile
,
" [%d]"
,
ORIGINAL_REGNO
(
in_rtx
));
break
;
}
if
(
i
==
3
&&
GET_CODE
(
in_rtx
)
==
NOTE
)
if
(
i
==
3
&&
GET_CODE
(
in_rtx
)
==
NOTE
)
{
{
switch
(
NOTE_LINE_NUMBER
(
in_rtx
))
switch
(
NOTE_LINE_NUMBER
(
in_rtx
))
...
...
gcc/regrename.c
View file @
08394eef
...
@@ -349,7 +349,9 @@ do_replace (chain, reg)
...
@@ -349,7 +349,9 @@ do_replace (chain, reg)
{
{
while
(
chain
)
while
(
chain
)
{
{
*
chain
->
loc
=
gen_rtx_REG
(
GET_MODE
(
*
chain
->
loc
),
reg
);
unsigned
int
regno
=
ORIGINAL_REGNO
(
*
chain
->
loc
);
*
chain
->
loc
=
gen_raw_REG
(
GET_MODE
(
*
chain
->
loc
),
reg
);
ORIGINAL_REGNO
(
*
chain
->
loc
)
=
regno
;
chain
=
chain
->
next_use
;
chain
=
chain
->
next_use
;
}
}
}
}
...
...
gcc/rtl.def
View file @
08394eef
...
@@ -583,12 +583,10 @@ DEF_RTL_EXPR(VALUE, "value", "0", 'o')
...
@@ -583,12 +583,10 @@ DEF_RTL_EXPR(VALUE, "value", "0", 'o')
/* A register. The "operand" is the register number, accessed with
/* A register. The "operand" is the register number, accessed with
the REGNO macro. If this number is less than FIRST_PSEUDO_REGISTER
the REGNO macro. If this number is less than FIRST_PSEUDO_REGISTER
than a hardware register is being referred to. The second operand
than a hardware register is being referred to. The second operand
doesn't really exist. Unfortunately, however, the compiler
holds the original register number - this will be different for a
implicitly assumes that a REG can be transformed in place into a
pseudo register that got turned into a hard register.
MEM, and therefore that a REG is at least as big as a MEM. To
This rtx needs to have as many (or more) fields as a MEM, since we
avoid this memory overhead, which is likely to be substantial,
can change REG rtx's into MEMs during reload. */
search for uses of PUT_CODE that turn REGs into MEMs, and fix them
somehow. Then, the trailing `0' can be removed here. */
DEF_RTL_EXPR(REG, "reg", "i0", 'o')
DEF_RTL_EXPR(REG, "reg", "i0", 'o')
/* A scratch register. This represents a register used only within a
/* A scratch register. This represents a register used only within a
...
...
gcc/rtl.h
View file @
08394eef
...
@@ -328,6 +328,7 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
...
@@ -328,6 +328,7 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
#define X0WINT(RTX, N) (RTL_CHECK1(RTX, N, '0').rtwint)
#define X0WINT(RTX, N) (RTL_CHECK1(RTX, N, '0').rtwint)
#define X0INT(RTX, N) (RTL_CHECK1(RTX, N, '0').rtint)
#define X0INT(RTX, N) (RTL_CHECK1(RTX, N, '0').rtint)
#define X0UINT(RTX, N) (RTL_CHECK1(RTX, N, '0').rtuint)
#define X0STR(RTX, N) (RTL_CHECK1(RTX, N, '0').rtstr)
#define X0STR(RTX, N) (RTL_CHECK1(RTX, N, '0').rtstr)
#define X0EXP(RTX, N) (RTL_CHECK1(RTX, N, '0').rtx)
#define X0EXP(RTX, N) (RTL_CHECK1(RTX, N, '0').rtx)
#define X0VEC(RTX, N) (RTL_CHECK1(RTX, N, '0').rtvec)
#define X0VEC(RTX, N) (RTL_CHECK1(RTX, N, '0').rtvec)
...
@@ -742,9 +743,12 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
...
@@ -742,9 +743,12 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
#define CONTAINING_INSN(RTX) XCEXP(RTX, 2, LABEL_REF)
#define CONTAINING_INSN(RTX) XCEXP(RTX, 2, LABEL_REF)
/* For a REG rtx, REGNO extracts the register number. */
/* For a REG rtx, REGNO extracts the register number. ORIGINAL_REGNO holds
the number the register originally had; for a pseudo register turned into
a hard reg this will hold the old pseudo register number. */
#define REGNO(RTX) XCUINT(RTX, 0, REG)
#define REGNO(RTX) XCUINT(RTX, 0, REG)
#define ORIGINAL_REGNO(RTX) X0UINT(RTX, 1)
/* For a REG rtx, REG_FUNCTION_VALUE_P is nonzero if the reg
/* For a REG rtx, REG_FUNCTION_VALUE_P is nonzero if the reg
is the current function's return value. */
is the current function's return value. */
...
@@ -1539,6 +1543,7 @@ extern rtx return_address_pointer_rtx;
...
@@ -1539,6 +1543,7 @@ extern rtx return_address_pointer_rtx;
extern
rtx
gen_rtx_CONST_DOUBLE
PARAMS
((
enum
machine_mode
,
rtx
,
extern
rtx
gen_rtx_CONST_DOUBLE
PARAMS
((
enum
machine_mode
,
rtx
,
HOST_WIDE_INT
,
HOST_WIDE_INT
));
HOST_WIDE_INT
,
HOST_WIDE_INT
));
extern
rtx
gen_rtx_CONST_INT
PARAMS
((
enum
machine_mode
,
HOST_WIDE_INT
));
extern
rtx
gen_rtx_CONST_INT
PARAMS
((
enum
machine_mode
,
HOST_WIDE_INT
));
extern
rtx
gen_raw_REG
PARAMS
((
enum
machine_mode
,
int
));
extern
rtx
gen_rtx_REG
PARAMS
((
enum
machine_mode
,
int
));
extern
rtx
gen_rtx_REG
PARAMS
((
enum
machine_mode
,
int
));
extern
rtx
gen_rtx_MEM
PARAMS
((
enum
machine_mode
,
rtx
));
extern
rtx
gen_rtx_MEM
PARAMS
((
enum
machine_mode
,
rtx
));
...
...
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