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
210aa14a
Commit
210aa14a
authored
Mar 30, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r635
parent
4b69d2a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
25 deletions
+95
-25
gcc/config/sparc/sparc.c
+95
-25
No files found.
gcc/config/sparc/sparc.c
View file @
210aa14a
...
@@ -20,6 +20,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
...
@@ -20,6 +20,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <stdio.h>
#include "config.h"
#include "config.h"
#include "tree.h"
#include "rtl.h"
#include "rtl.h"
#include "regs.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "hard-reg-set.h"
...
@@ -1425,6 +1426,7 @@ output_block_move (operands)
...
@@ -1425,6 +1426,7 @@ output_block_move (operands)
rtx
sizertx
=
operands
[
2
];
rtx
sizertx
=
operands
[
2
];
rtx
alignrtx
=
operands
[
3
];
rtx
alignrtx
=
operands
[
3
];
int
align
=
INTVAL
(
alignrtx
);
int
align
=
INTVAL
(
alignrtx
);
char
label3
[
30
],
label5
[
30
];
xoperands
[
0
]
=
operands
[
0
];
xoperands
[
0
]
=
operands
[
0
];
xoperands
[
1
]
=
operands
[
1
];
xoperands
[
1
]
=
operands
[
1
];
...
@@ -1523,6 +1525,9 @@ output_block_move (operands)
...
@@ -1523,6 +1525,9 @@ output_block_move (operands)
xoperands
[
4
]
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
align
);
xoperands
[
4
]
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
align
);
xoperands
[
5
]
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
movstrsi_label
++
);
xoperands
[
5
]
=
gen_rtx
(
CONST_INT
,
VOIDmode
,
movstrsi_label
++
);
ASM_GENERATE_INTERNAL_LABEL
(
label3
,
"Lm"
,
INTVAL
(
xoperands
[
3
]));
ASM_GENERATE_INTERNAL_LABEL
(
label5
,
"Lm"
,
INTVAL
(
xoperands
[
5
]));
/* This is the size of the transfer. Emit code to decrement the size
/* This is the size of the transfer. Emit code to decrement the size
value by ALIGN, and store the result in the temp1 register. */
value by ALIGN, and store the result in the temp1 register. */
output_size_for_block_move
(
sizertx
,
temp1
,
alignrtx
);
output_size_for_block_move
(
sizertx
,
temp1
,
alignrtx
);
...
@@ -1538,11 +1543,12 @@ output_block_move (operands)
...
@@ -1538,11 +1543,12 @@ output_block_move (operands)
be a harmless insn between the branch here and the next label emitted
be a harmless insn between the branch here and the next label emitted
below. */
below. */
#ifdef NO_UNDERSCORES
{
output_asm_insn
(
"cmp %2,0
\n\t
bl .Lm%5"
,
xoperands
);
char
pattern
[
100
];
#else
output_asm_insn
(
"cmp %2,0
\n\t
bl Lm%5"
,
xoperands
);
sprintf
(
pattern
,
"cmp %%2,0
\n\t
bl %s"
,
&
label5
[
1
]);
#endif
output_asm_insn
(
pattern
,
xoperands
);
}
zoperands
[
0
]
=
operands
[
0
];
zoperands
[
0
]
=
operands
[
0
];
zoperands
[
3
]
=
plus_constant_for_output
(
operands
[
0
],
align
);
zoperands
[
3
]
=
plus_constant_for_output
(
operands
[
0
],
align
);
...
@@ -1558,29 +1564,18 @@ output_block_move (operands)
...
@@ -1558,29 +1564,18 @@ output_block_move (operands)
/* Output the first label separately, so that it is spaced properly. */
/* Output the first label separately, so that it is spaced properly. */
#ifdef NO_UNDERSCORES
ASM_OUTPUT_INTERNAL_LABEL
(
asm_out_file
,
".Lm"
,
INTVAL
(
xoperands
[
3
]));
#else
ASM_OUTPUT_INTERNAL_LABEL
(
asm_out_file
,
"Lm"
,
INTVAL
(
xoperands
[
3
]));
ASM_OUTPUT_INTERNAL_LABEL
(
asm_out_file
,
"Lm"
,
INTVAL
(
xoperands
[
3
]));
#endif
#ifdef NO_UNDERSCORES
{
if
(
align
==
1
)
char
pattern
[
200
];
output_asm_insn
(
"ldub [%1+%2],%%g1
\n\t
subcc %2,%4,%2
\n\t
bge .Lm%3
\n\t
stb %%g1,[%0+%2]
\n
.Lm%5:"
,
xoperands
);
register
char
*
ld_suffix
=
(
align
==
1
)
?
"ub"
:
(
align
==
2
)
?
"uh"
:
""
;
else
if
(
align
==
2
)
register
char
*
st_suffix
=
(
align
==
1
)
?
"b"
:
(
align
==
2
)
?
"h"
:
""
;
output_asm_insn
(
"lduh [%1+%2],%%g1
\n\t
subcc %2,%4,%2
\n\t
bge .Lm%3
\n\t
sth %%g1,[%0+%2]
\n
.Lm%5:"
,
xoperands
);
else
sprintf
(
pattern
,
"ld%s [%%1+%%2],%%%%g1
\n\t
subcc %%2,%%4,%%2
\n\t
bge %s
\n\t
st%s %%%%g1,[%%0+%%2]
\n
%s:"
,
ld_suffix
,
&
label3
[
1
],
st_suffix
,
&
label5
[
1
]);
output_asm_insn
(
"ld [%1+%2],%%g1
\n\t
subcc %2,%4,%2
\n\t
bge .Lm%3
\n\t
st %%g1,[%0+%2]
\n
.Lm%5:"
,
xoperands
);
output_asm_insn
(
pattern
,
xoperands
);
return
""
;
}
#else
if
(
align
==
1
)
output_asm_insn
(
"ldub [%1+%2],%%g1
\n\t
subcc %2,%4,%2
\n\t
bge Lm%3
\n\t
stb %%g1,[%0+%2]
\n
Lm%5:"
,
xoperands
);
else
if
(
align
==
2
)
output_asm_insn
(
"lduh [%1+%2],%%g1
\n\t
subcc %2,%4,%2
\n\t
bge Lm%3
\n\t
sth %%g1,[%0+%2]
\n
Lm%5:"
,
xoperands
);
else
output_asm_insn
(
"ld [%1+%2],%%g1
\n\t
subcc %2,%4,%2
\n\t
bge Lm%3
\n\t
st %%g1,[%0+%2]
\n
Lm%5:"
,
xoperands
);
return
""
;
return
""
;
#endif
}
}
/* Output reasonable peephole for set-on-condition-code insns.
/* Output reasonable peephole for set-on-condition-code insns.
...
@@ -2571,4 +2566,79 @@ output_double_int (file, value)
...
@@ -2571,4 +2566,79 @@ output_double_int (file, value)
else
else
abort
();
abort
();
}
}
/* Compute the code to put in the .proc statement
for a function that returns type TYPE. */
unsigned
long
sparc_type_code
(
type
)
register
tree
type
;
{
register
unsigned
long
qualifiers
=
0
;
register
unsigned
shift
=
6
;
for
(;;)
{
switch
(
TREE_CODE
(
type
))
{
case
ERROR_MARK
:
return
qualifiers
;
case
ARRAY_TYPE
:
qualifiers
|=
(
3
<<
shift
);
shift
+=
2
;
type
=
TREE_TYPE
(
type
);
break
;
case
FUNCTION_TYPE
:
case
METHOD_TYPE
:
qualifiers
|=
(
2
<<
shift
);
shift
+=
2
;
type
=
TREE_TYPE
(
type
);
break
;
case
POINTER_TYPE
:
case
REFERENCE_TYPE
:
case
OFFSET_TYPE
:
qualifiers
|=
(
1
<<
shift
);
shift
+=
2
;
type
=
TREE_TYPE
(
type
);
break
;
case
RECORD_TYPE
:
return
(
qualifiers
|
8
);
case
UNION_TYPE
:
return
(
qualifiers
|
9
);
case
ENUMERAL_TYPE
:
return
(
qualifiers
|
10
);
case
VOID_TYPE
:
return
(
qualifiers
|
16
);
case
INTEGER_TYPE
:
/* This return value is not always completely the same as Sun's
but the Sun assembler's peephole optimizer probably doesn't
care. */
return
(
qualifiers
|
4
);
case
REAL_TYPE
:
if
(
TYPE_PRECISION
(
type
)
==
32
)
return
(
qualifiers
|
6
);
else
return
(
qualifiers
|
7
);
/* Who knows? */
case
COMPLEX_TYPE
:
/* GNU Fortran COMPLEX type. */
case
CHAR_TYPE
:
/* GNU Pascal CHAR type. Not used in C. */
case
BOOLEAN_TYPE
:
/* GNU Fortran BOOLEAN type. */
case
FILE_TYPE
:
/* GNU Pascal FILE type. */
case
STRING_TYPE
:
/* GNU Fortran STRING type. */
case
LANG_TYPE
:
/* ? */
abort
();
default
:
abort
();
/* Not a type! */
}
}
}
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