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
a9d91d6f
Commit
a9d91d6f
authored
Jun 04, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r1160
parent
e38e5ba8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
43 deletions
+62
-43
gcc/config/pa/pa.c
+36
-24
gcc/config/pa/pa.h
+26
-19
No files found.
gcc/config/pa/pa.c
View file @
a9d91d6f
...
...
@@ -1398,31 +1398,10 @@ output_function_prologue (file, size, leaf_function)
fprintf
(
file
,
",NO_CALLS
\n
"
);
fprintf
(
file
,
"
\t
.ENTRY
\n
"
);
/* Instead of taking one argument, the counter label, as most normal
mcounts do, _mcount appears to behave differently on the HPPA. It
takes the return address of the caller, the address of this
routine, and the address of the label. Also, it isn't magic, so
caller saves have to be preserved. We get around this by calling
our own gcc_mcount, which takes arguments on the stack and saves
argument registers. */
if
(
profile_flag
)
{
fprintf
(
file
,
"
\t
stw 2,-20(30)
\n\t
ldo 48(30),30
\n
\
\t
addil L'LP$%04d-$global$,27
\n\t
ldo R'LP$%04d-$global$(1),1
\n
\
\t
bl __gcc_mcount,2
\n\t
stw 1,-16(30)
\n\t
ldo -48(30),30
\n\t
ldw -20(30),2
\n
"
,
hp_profile_labelno
,
hp_profile_labelno
);
}
/* Some registers have places to go in the current stack
structure. */
#if 0
/* However, according to the hp docs, there's no need to save the
sp. */
fprintf (file, "\tstw 30,-4(30)\n");
#endif
if
(
regs_ever_live
[
2
])
if
(
regs_ever_live
[
2
]
||
profile_flag
)
fprintf
(
file
,
"
\t
stw 2,-20(0,30)
\n
"
);
/* Reserve space for local variables. */
...
...
@@ -1447,7 +1426,36 @@ output_function_prologue (file, size, leaf_function)
fprintf
(
file
,
"
\t
addil L'%d,30
\n\t
ldo R'%d(1),30
\n
"
,
actual_fsize
,
actual_fsize
);
}
/* Instead of taking one argument, the counter label, as most normal
mcounts do, _mcount appears to behave differently on the HPPA. It
takes the return address of the caller, the address of this
routine, and the address of the label. Also, it isn't magic, so
argument registers have to be preserved. */
if
(
profile_flag
)
{
unsigned
int
pc_offset
=
(
4
+
(
frame_pointer_needed
?
(
VAL_14_BITS_P
(
actual_fsize
)
?
12
:
20
)
:
(
VAL_14_BITS_P
(
actual_fsize
)
?
4
:
8
)));
int
i
,
arg_offset
;
for
(
i
=
26
,
arg_offset
=
-
36
;
i
>=
23
;
i
--
,
arg_offset
-=
4
)
if
(
regs_ever_live
[
i
])
{
print_stw
(
file
,
i
,
arg_offset
,
4
);
pc_offset
+=
4
;
}
fprintf
(
file
,
"
\t
copy %%r2,%%r26
\n\t
addil L'LP$%04d-$global$,%%r27
\n
\
\t
ldo R'LP$%04d-$global$(%%r1),%%r24
\n\t
bl _mcount,%%r2
\n
\
\t
ldo %d(%%r2),%%r25
\n
"
,
hp_profile_labelno
,
hp_profile_labelno
,
-
pc_offset
-
12
-
8
);
for
(
i
=
26
,
arg_offset
=
-
36
;
i
>=
23
;
i
--
,
arg_offset
-=
4
)
if
(
regs_ever_live
[
i
])
print_ldw
(
file
,
i
,
arg_offset
,
4
);
}
/* Normal register save. */
if
(
frame_pointer_needed
)
{
...
...
@@ -2192,7 +2200,11 @@ output_arg_descriptor (insn)
arg_mode
=
GET_MODE
(
XEXP
(
PATTERN
(
prev_insn
),
0
));
regno
=
REGNO
(
XEXP
(
PATTERN
(
prev_insn
),
0
));
if
(
regno
>=
23
&&
regno
<=
26
)
arg_regs
[
26
-
regno
]
=
"GR"
;
{
arg_regs
[
26
-
regno
]
=
"GR"
;
if
(
arg_mode
==
DImode
)
arg_regs
[
25
-
regno
]
=
"GR"
;
}
else
if
(
!
TARGET_SNAKE
)
/* fp args */
{
if
(
arg_mode
==
SFmode
)
...
...
gcc/config/pa/pa.h
View file @
a9d91d6f
...
...
@@ -441,16 +441,18 @@ extern int leaf_function;
1.1 fp regs, and the high 1.1 fp regs, to which the operands of
fmpyadd and fmpysub are restricted. */
enum
reg_class
{
NO_REGS
,
R1_REGS
,
GENERAL_REGS
,
FP_REGS
,
HI_SNAKE_FP_REGS
,
SNAKE_FP_REGS
,
FP_OR_SNAKE_FP_REGS
,
SHIFT_REGS
,
ALL_REGS
,
LIM_REG_CLASSES
};
enum
reg_class
{
NO_REGS
,
R1_REGS
,
GENERAL_REGS
,
FP_REGS
,
GENERAL_OR_FP_REGS
,
HI_SNAKE_FP_REGS
,
SNAKE_FP_REGS
,
GENERAL_OR_SNAKE_FP_REGS
,
SHIFT_REGS
,
ALL_REGS
,
LIM_REG_CLASSES
};
#define N_REG_CLASSES (int) LIM_REG_CLASSES
/* Give names of register classes as strings for dump file. */
#define REG_CLASS_NAMES \
{ "NO_REGS", "R1_REGS", "GENERAL_REGS", "FP_REGS", "HI_SNAKE_FP_REGS",\
"SNAKE_FP_REGS", "FP_OR_SNAKE_FP_REGS", "SHIFT_REGS", "ALL_REGS"}
{ "NO_REGS", "R1_REGS", "GENERAL_REGS", "FP_REGS", "GENERAL_OR_FP_REGS",\
"HI_SNAKE_FP_REGS", "SNAKE_FP_REGS", "GENERAL_OR_SNAKE_FP_REGS",\
"SHIFT_REGS", "ALL_REGS"}
/* Define which registers fit in which classes.
This is an initializer for a vector of HARD_REG_SET
...
...
@@ -462,9 +464,10 @@ enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FP_REGS, HI_SNAKE_FP_REGS,
{0x2, 0, 0, 0},
/* R1_REGS */
\
{-2, 0, 0, 0},
/* GENERAL_REGS */
\
{0, 0xffff, 0, 0},
/* FP_REGS */
\
{-2, 0xffff, 0, 0},
/* GENERAL_OR_FP_REGS */
\
{0, 0, 0xffff0000, 0xffff},
/* HI_SNAKE_FP_REGS */
\
{0, 0xffff0000, ~0, 0xffff},
/* SNAKE_FP_REGS */
\
{
0, ~0, ~0, 0xffff},
/* FP
_OR_SNAKE_FP_REGS */
\
{
-2, 0xffff0000, ~0, 0xffff},
/* GENERAL
_OR_SNAKE_FP_REGS */
\
{0, 0, 0, 0x10000},
/* SHIFT_REGS */
\
{-2, ~0, ~0, 0x1ffff}}
/* ALL_REGS */
...
...
@@ -774,23 +777,31 @@ extern enum cmp_type hppa_branch_type;
fputs ("\t.EXPORT ", FILE); assemble_name (FILE, NAME); \
fputs (",PRIV_LEV=3", FILE); \
for (parm = DECL_ARGUMENTS (DECL), i = 0; parm && i < 4; \
parm = TREE_CHAIN (parm)
, i++)
\
parm = TREE_CHAIN (parm)
)
\
{ \
if (TYPE_MODE (DECL_ARG_TYPE (parm)) == SFmode) \
fprintf (FILE, ",ARGW%d=FR", i); \
fprintf (FILE, ",ARGW%d=FR", i
++
); \
else if (TYPE_MODE (DECL_ARG_TYPE (parm)) == DFmode) \
{ \
if (i == 0 || i == 2) \
{ \
ASM_DOUBLE_ARG_DESCRIPTORS (FILE, i++, i); \
} \
else if (i == 1) \
if (i == 1) i++; \
ASM_DOUBLE_ARG_DESCRIPTORS (FILE, i++, i++); \
} \
else \
{ \
int arg_size = \
FUNCTION_ARG_SIZE (TYPE_MODE (DECL_ARG_TYPE (parm)),\
DECL_ARG_TYPE (parm)); \
if (arg_size == 2 && i <= 2) \
{ \
ASM_DOUBLE_ARG_DESCRIPTORS (FILE, ++i, ++i); \
if (i == 1) i++; \
fprintf (FILE, ",ARGW%d=GR", i++); \
fprintf (FILE, ",ARGW%d=GR", i++); \
} \
else if (arg_size == 1) \
fprintf (FILE, ",ARGW%d=GR", i++); \
else \
i += arg_size; \
} \
else \
fprintf (FILE, ",ARGW%d=GR", i); \
} \
/* anonymous args */
\
if (TYPE_ARG_TYPES (tree_type) != 0 \
...
...
@@ -840,13 +851,9 @@ extern int apparent_fsize;
profiling code in function_prologue. This just stores LABELNO for
that. */
#ifdef hp800
/* Don't have the proper libraries yet */
#define FUNCTION_PROFILER(FILE, LABELNO) {}
#else
#define PROFILE_BEFORE_PROLOGUE
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ extern int hp_profile_labelno; hp_profile_labelno = (LABELNO);}
#endif
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
...
...
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