diff options
author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-31 05:11:21 +0000 |
---|---|---|
committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-31 05:11:21 +0000 |
commit | 447e8aaad08c564bac7fe74861b2f4a1a52c5ff2 (patch) | |
tree | c54f2113af4b25275af797e82b62a1380e0c7162 /gcc/config | |
parent | 5e11de885b49f08477a4ca1ef7c07b7c04ccedfa (diff) | |
download | gcc-447e8aaad08c564bac7fe74861b2f4a1a52c5ff2.tar.gz |
Tweak ABI & add moxie-uclinux target.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150307 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/moxie/moxie.c | 18 | ||||
-rw-r--r-- | gcc/config/moxie/moxie.h | 20 | ||||
-rw-r--r-- | gcc/config/moxie/uclinux.h | 39 |
3 files changed, 54 insertions, 23 deletions
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c index 897717b40df..39a5c10bb69 100644 --- a/gcc/config/moxie/moxie.c +++ b/gcc/config/moxie/moxie.c @@ -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; diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h index bf3d7e3eb6b..f50a6b2a27e 100644 --- a/gcc/config/moxie/moxie.h +++ b/gcc/config/moxie/moxie.h @@ -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. */ diff --git a/gcc/config/moxie/uclinux.h b/gcc/config/moxie/uclinux.h new file mode 100644 index 00000000000..0e5ee3d6b6b --- /dev/null +++ b/gcc/config/moxie/uclinux.h @@ -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}" |