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
7bc88d49
Commit
7bc88d49
authored
Jan 04, 1997
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(output_function_{pro,epi}logue): Use addq/subq when adjusting stack
pointer by small displacements. From-SVN: r13366
parent
fe159061
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
11 deletions
+83
-11
gcc/config/m68k/m68k.c
+83
-11
No files found.
gcc/config/m68k/m68k.c
View file @
7bc88d49
/* Subroutines for insn-output.c for Motorola 68000 family.
Copyright (C) 1987,
1993, 1994, 1995, 1996
Free Software Foundation, Inc.
Copyright (C) 1987,
93, 94, 95, 96, 1997
Free Software Foundation, Inc.
This file is part of GNU CC.
...
...
@@ -211,19 +211,47 @@ output_function_prologue (stream, size)
}
else
if
(
fsize
)
{
/* Adding negative number is faster on the 68040. */
if
(
fsize
+
4
<
0x8000
)
{
if
(
!
TARGET_68040
)
#ifdef NO_ADDSUB_Q
if
(
fsize
+
4
<=
8
)
{
if
(
!
TARGET_5200
)
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
lea (%d,%Rsp),%Rsp
\n
"
,
-
(
fsize
+
4
)
);
asm_fprintf
(
stream
,
"
\t
subq.w %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#else
asm_fprintf
(
stream
,
"
\t
lea %Rsp@(%d),%Rsp
\n
"
,
-
(
fsize
+
4
));
asm_fprintf
(
stream
,
"
\t
subqw %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#endif
}
else
{
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
subq.l %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#else
asm_fprintf
(
stream
,
"
\t
subql %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#endif
}
}
else
else
if
(
fsize
+
4
<=
16
&&
TARGET_CPU32
)
{
/* On the CPU32 it is faster to use two subqw instructions to
subtract a small integer (8 < N <= 16) to a register. */
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
subq.w %OI8,%Rsp
\n\t
subq.w %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#else
asm_fprintf
(
stream
,
"
\t
subqw %OI8,%Rsp
\n\t
subqw %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#endif
}
else
#endif
/* NO_ADDSUB_Q */
if
(
TARGET_68040
)
{
/* Adding negative number is faster on the 68040. */
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
add.w %0I%d,%Rsp
\n
"
,
-
(
fsize
+
4
));
...
...
@@ -231,6 +259,15 @@ output_function_prologue (stream, size)
asm_fprintf
(
stream
,
"
\t
addw %0I%d,%Rsp
\n
"
,
-
(
fsize
+
4
));
#endif
}
else
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
lea (%d,%Rsp),%Rsp
\n
"
,
-
(
fsize
+
4
));
#else
asm_fprintf
(
stream
,
"
\t
lea %Rsp@(%d),%Rsp
\n
"
,
-
(
fsize
+
4
));
#endif
}
}
else
{
...
...
@@ -640,18 +677,44 @@ output_function_epilogue (stream, size)
reg_names
[
FRAME_POINTER_REGNUM
]);
else
if
(
fsize
)
{
if
(
fsize
+
4
<
0x8000
)
#ifdef NO_ADDSUB_Q
if
(
fsize
+
4
<=
8
)
{
if
(
!
TARGET_
6804
0
)
{
if
(
!
TARGET_
520
0
)
{
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
lea (%d,%Rsp)
,%Rsp
\n
"
,
fsize
+
4
);
asm_fprintf
(
stream
,
"
\t
addq.w %OI%d
,%Rsp
\n
"
,
fsize
+
4
);
#else
asm_fprintf
(
stream
,
"
\t
lea %Rsp@(%d)
,%Rsp
\n
"
,
fsize
+
4
);
asm_fprintf
(
stream
,
"
\t
addqw %OI%d
,%Rsp
\n
"
,
fsize
+
4
);
#endif
}
else
{
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
addq.l %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#else
asm_fprintf
(
stream
,
"
\t
addql %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#endif
}
}
else
if
(
fsize
+
4
<=
16
&&
TARGET_CPU32
)
{
/* On the CPU32 it is faster to use two addqw instructions to
add a small integer (8 < N <= 16) to a register. */
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
addq.w %OI8,%Rsp
\n\t
addq.w %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#else
asm_fprintf
(
stream
,
"
\t
addqw %OI8,%Rsp
\n\t
addqw %OI%d,%Rsp
\n
"
,
fsize
+
4
);
#endif
}
else
#endif
/* NO_ADDSUB_Q */
if
(
fsize
+
4
<
0x8000
)
{
if
(
TARGET_68040
)
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
add.w %0I%d,%Rsp
\n
"
,
fsize
+
4
);
...
...
@@ -659,6 +722,15 @@ output_function_epilogue (stream, size)
asm_fprintf
(
stream
,
"
\t
addw %0I%d,%Rsp
\n
"
,
fsize
+
4
);
#endif
}
else
{
/* asm_fprintf() cannot handle %. */
#ifdef MOTOROLA
asm_fprintf
(
stream
,
"
\t
lea (%d,%Rsp),%Rsp
\n
"
,
fsize
+
4
);
#else
asm_fprintf
(
stream
,
"
\t
lea %Rsp@(%d),%Rsp
\n
"
,
fsize
+
4
);
#endif
}
}
else
{
...
...
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