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
23865616
Commit
23865616
authored
Jul 31, 2009
by
Anthony Green
Committed by
Anthony Green
Jul 31, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak ABI & add moxie-uclinux target.
From-SVN: r150307
parent
20e19db4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
23 deletions
+81
-23
gcc/ChangeLog
+18
-0
gcc/config.gcc
+9
-0
gcc/config/moxie/moxie.c
+9
-9
gcc/config/moxie/moxie.h
+6
-14
gcc/config/moxie/uclinux.h
+39
-0
No files found.
gcc/ChangeLog
View file @
23865616
2009-07-31 Anthony Green <green@moxielogic.com>
* config/moxie/moxie.c (moxie_expand_prologue): Use $r5 instead of
$r12 in prologue.
(moxie_expand_epilogue): Ditto for epilogue.
(moxie_setup_incoming_varargs): ABI change. Use 5 registers for
incoming arguments.
(moxie_function_arg): Ditto.
(moxie_pass_by_reference): Ditto.
(moxie_arg_partial_bytes): Ditto.
* config/moxie/moxie.h (CALL_USED_REGISTERS): Ditto.
(FUNCTION_ARG_ADVANCE) Ditto.
(REG_PARM_STACK_SPACE) Ditto.
(FUNCTION_ARG_REGNO_P) Dito.
* config.gcc: Add moxie linux config support.
* gcc/config/moxie/uclinux.h: New file.
2009-07-31 DJ Delorie <dj@redhat.com>
* config/sh/sh.md (UNSPECV_SP_SWITCH_B): New.
...
...
gcc/config.gcc
View file @
23865616
...
...
@@ -894,6 +894,15 @@ moxie-*-elf)
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp"
;;
moxie-*-uclinux*)
gas=yes
gnu_ld=yes
tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h glibc-stdint.h moxie/uclinux.h"
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp"
tm_defines="${tm_defines} UCLIBC_DEFAULT=1"
extra_options="${extra_options} linux.opt"
;;
h8300-*-rtems*)
tmake_file="h8300/t-h8300 h8300/t-elf t-rtems h8300/t-rtems"
tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h h8300/rtems.h rtems.h newlib-stdint.h"
...
...
gcc/config/moxie/moxie.c
View file @
23865616
...
...
@@ -284,12 +284,12 @@ moxie_expand_prologue (void)
{
insn
=
emit_insn
(
gen_movsi
(
gen_rtx_REG
(
Pmode
,
MOXIE_R
12
),
(
gen_rtx_REG
(
Pmode
,
MOXIE_R
5
),
GEN_INT
(
-
cfun
->
machine
->
size_for_adjusting_sp
)));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
insn
=
emit_insn
(
gen_addsi3
(
stack_pointer_rtx
,
stack_pointer_rtx
,
gen_rtx_REG
(
Pmode
,
MOXIE_R
12
)));
gen_rtx_REG
(
Pmode
,
MOXIE_R
5
)));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
}
}
...
...
@@ -303,7 +303,7 @@ moxie_expand_epilogue (void)
if
(
cfun
->
machine
->
callee_saved_reg_size
!=
0
)
{
reg
=
gen_rtx_REG
(
Pmode
,
MOXIE_R
12
);
reg
=
gen_rtx_REG
(
Pmode
,
MOXIE_R
5
);
if
(
cfun
->
machine
->
callee_saved_reg_size
<=
255
)
{
emit_move_insn
(
reg
,
hard_frame_pointer_rtx
);
...
...
@@ -359,14 +359,14 @@ moxie_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
int
*
pretend_size
,
int
no_rtl
)
{
int
regno
;
int
regs
=
4
-
*
cum
;
int
regs
=
7
-
*
cum
;
*
pretend_size
=
regs
<
0
?
0
:
GET_MODE_SIZE
(
SImode
)
*
regs
;
if
(
no_rtl
)
return
;
for
(
regno
=
*
cum
;
regno
<
4
;
regno
++
)
for
(
regno
=
*
cum
;
regno
<
7
;
regno
++
)
{
rtx
reg
=
gen_rtx_REG
(
SImode
,
regno
);
rtx
slot
=
gen_rtx_PLUS
(
Pmode
,
...
...
@@ -395,7 +395,7 @@ rtx
moxie_function_arg
(
CUMULATIVE_ARGS
cum
,
enum
machine_mode
mode
,
tree
type
ATTRIBUTE_UNUSED
,
int
named
ATTRIBUTE_UNUSED
)
{
if
(
cum
<
4
)
if
(
cum
<
7
)
return
gen_rtx_REG
(
mode
,
cum
);
else
return
NULL_RTX
;
...
...
@@ -420,7 +420,7 @@ moxie_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
else
size
=
GET_MODE_SIZE
(
mode
);
return
size
>
8
;
return
size
>
4
*
5
;
}
/* Some function arguments will only partially fit in the registers
...
...
@@ -434,7 +434,7 @@ moxie_arg_partial_bytes (CUMULATIVE_ARGS *cum,
{
int
bytes_left
,
size
;
if
(
*
cum
>=
4
)
if
(
*
cum
>=
7
)
return
0
;
if
(
moxie_pass_by_reference
(
cum
,
mode
,
type
,
named
))
...
...
@@ -448,7 +448,7 @@ moxie_arg_partial_bytes (CUMULATIVE_ARGS *cum,
else
size
=
GET_MODE_SIZE
(
mode
);
bytes_left
=
8
-
((
*
cum
-
2
)
*
4
);
bytes_left
=
(
4
*
5
)
-
((
*
cum
-
2
)
*
4
);
if
(
size
>
bytes_left
)
return
bytes_left
;
...
...
gcc/config/moxie/moxie.h
View file @
23865616
...
...
@@ -144,7 +144,7 @@ enum reg_class
#define REG_CLASS_CONTENTS \
{ { 0x00000000 },
/* Empty */
\
{ 0x0003FFFF },
/* $fp, $sp, $r0 to $r
5, ?fp */
\
{ 0x0003FFFF },
/* $fp, $sp, $r0 to $r
13, ?fp */
\
{ 0x00040000 },
/* $pc */
\
{ 0x00080000 },
/* ?cc */
\
{ 0x000FFFFF }
/* All registers */
\
...
...
@@ -166,7 +166,7 @@ enum reg_class
1, 1, 1, 1 }
#define CALL_USED_REGISTERS { 1, 1, 1, 1, \
0, 0, 0, 0
, \
1, 1, 1, 1
, \
0, 0, 0, 0, \
0, 0, 1, 1, \
1, 1, 1, 1 }
...
...
@@ -263,7 +263,7 @@ enum reg_class
: (unsigned) int_size_in_bytes (TYPE))
#define FUNCTION_ARG_ADVANCE(CUM,MODE,TYPE,NAMED) \
(CUM = (CUM < MOXIE_R
2
? \
(CUM = (CUM < MOXIE_R
5
? \
CUM + ((3 + MOXIE_FUNCTION_ARG_SIZE(MODE,TYPE))/4) : CUM ))
/* How Scalar Function Values Are Returned */
...
...
@@ -299,7 +299,7 @@ enum reg_class
/* Define this if it is the responsibility of the caller to allocate
the area reserved for arguments passed in registers. */
#define REG_PARM_STACK_SPACE(FNDECL) (
2
* UNITS_PER_WORD)
#define REG_PARM_STACK_SPACE(FNDECL) (
5
* UNITS_PER_WORD)
/* Offset from the argument pointer register to the first argument's
address. On some machines it may depend on the data type of the
...
...
@@ -425,7 +425,7 @@ do \
/* The register number of the stack pointer register, which must also
be a fixed register according to `FIXED_REGISTERS'. */
#define STACK_POINTER_REGNUM
1
#define STACK_POINTER_REGNUM
MOXIE_SP
/* The register number of the frame pointer register, which is used to
access automatic variables in the stack frame. */
...
...
@@ -448,17 +448,9 @@ do \
#define HARD_FRAME_POINTER_REGNUM MOXIE_FP
#if 0
#define ELIMINABLE_REGS \
{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
{ ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }}
#else
#define ELIMINABLE_REGS \
{{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
{ ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }}
#endif
/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
specifies the initial difference between the specified pair of
...
...
@@ -471,7 +463,7 @@ do \
/* A C expression that is nonzero if REGNO is the number of a hard
register in which function arguments are sometimes passed. */
#define FUNCTION_ARG_REGNO_P(r) (r
== MOXIE_R0 || r == MOXIE_R1
)
#define FUNCTION_ARG_REGNO_P(r) (r
>= MOXIE_R0 && r <= MOXIE_R4
)
/* A C expression that is nonzero if REGNO is the number of a hard
register in which the values of called function may come back. */
...
...
gcc/config/moxie/uclinux.h
0 → 100644
View file @
23865616
/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared: crt1%O%s} crti%O%s crtbegin%O%s"
#undef LINK_SPEC
#define LINK_SPEC "-elf2flt"
#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
/* Like the definition in gcc.c, but for purposes of uClinux, every link is
static. */
#define MFWRAP_SPEC " %{fmudflap|fmudflapth: \
--wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\
--wrap=mmap --wrap=munmap --wrap=alloca\
%{fmudflapth: --wrap=pthread_create\
}} %{fmudflap|fmudflapth: --wrap=main}"
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