mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-13 15:45:20 +08:00
Tweak ABI & add moxie-uclinux target.
From-SVN: r150307
This commit is contained in:
parent
20e19db49e
commit
23865616d6
@ -1,3 +1,21 @@
|
||||
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.
|
||||
|
@ -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"
|
||||
|
@ -284,12 +284,12 @@ moxie_expand_prologue (void)
|
||||
{
|
||||
insn =
|
||||
emit_insn (gen_movsi
|
||||
(gen_rtx_REG (Pmode, MOXIE_R12),
|
||||
(gen_rtx_REG (Pmode, MOXIE_R5),
|
||||
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_R12)));
|
||||
gen_rtx_REG (Pmode, MOXIE_R5)));
|
||||
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_R12);
|
||||
reg = gen_rtx_REG (Pmode, MOXIE_R5);
|
||||
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;
|
||||
|
@ -144,7 +144,7 @@ enum reg_class
|
||||
|
||||
#define REG_CLASS_CONTENTS \
|
||||
{ { 0x00000000 }, /* Empty */ \
|
||||
{ 0x0003FFFF }, /* $fp, $sp, $r0 to $r5, ?fp */ \
|
||||
{ 0x0003FFFF }, /* $fp, $sp, $r0 to $r13, ?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_R2 ? \
|
||||
(CUM = (CUM < MOXIE_R5 ? \
|
||||
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. */
|
||||
|
39
gcc/config/moxie/uclinux.h
Normal file
39
gcc/config/moxie/uclinux.h
Normal file
@ -0,0 +1,39 @@
|
||||
/* 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}"
|
Loading…
Reference in New Issue
Block a user