Commit 1951818c by J"orn Rennecke Committed by Joern Rennecke

config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h.

	* config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h.
	(sh64-*-elf*, sh-*-rtemself*): Likewise.
	* config/sh/embed_bb.c: New file.
	* config/sh/embed-elf.h: New file.
	* sh.h (CPP_SPEC): Supply __SIZE_TYPE__ and __PTRDIFF_TYPE__
	if -m[12345]* option is given.  Don't use subtarget_cpp_ptr_spec.
	(CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and
	__PTRDIFF_TYPE__ .
	(SUBTARGET_CPP_PTR_SPEC): Don't define.
	(EXTRA_SPECS): Remove subtarget_cpp_ptr_spec.
	Add subtarget_asm_endian_spec.
	(ASM_SPEC): Use subtarget_asm_endian_spec.
	(SUBTARGET_ASM_ENDIAN_SPEC): Define.
	(RETURN_ADDR_RTX): Use PR_MEDIA_REG for TARGET_SH5.
	(WCHAR_UNSIGNED): Define.
	(SH_ELF_WCHAR_TYPE, SH_DBX_REGISTER_NUMBER): Define.
	(DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER.
	(ALLOCATE_INITIAL_VALUE): Use PR_MEDIA_REG for TARGET_SH5.
	Fix value.
	* sh.c (calc_live_regs): Use PR_MEDIA_REG for TARGET_SH5.
	(sh_adjust_cost): Likewise.
	sh64.h (CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and
	__PTRDIFF_TYPE__ .
	(SUBTARGET_CPP_PTR_SPEC, WCHAR_TYPE): Don't #undef/ #define.
	(WCHAR_TYPE_SIZE): Likewise.
	(ASM_SPEC): Use subtarget_asm_endian_spec.
	(SH_ELF_WCHAR_TYPE): #undef/ #define.
	(MAX_WCHAR_TYPE_SIZE): Don't #undef.
	* config/sh/elf.h (WCHAR_UNSIGNED): #undef .
	(MAX_WCHAR_TYPE_SIZE): Don't #define .
	(WCHAR_TYPE, WCHAR_TYPE_SIZE): #undef / #define .
	(USER_LABEL_PREFIX): Don't #undef /#define .
	(DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER.
	* config/elf/linux.h (USER_LABEL_PREFIX): Don't #undef /#define .
	(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Likewise.
	(ASM_SPEC): Likewise.
	(SUBTARGET_ASM_ENDIAN_SPEC): #undef / #define .
	(CC1_SPEC): don't supply -m3 for -m4*, -m5*.
	* t-sh: (LIB1ASMFUNCS): Use LIB1ASMFUNCS_CACHE.
	(LIB2FUNCS_EXTRA): Define.
	* t-sh64 (LIB2FUNCS_EXTRA): Define.
	* config/sh/t-linux (LIB1ASMFUNCS): Don't redefine.
	(LIB1ASMFUNCS_CACHE): Define.
	(LIB2FUNCS_EXTRA): Redefine empty.

From-SVN: r52091
parent 34295799
Tue Apr 9 19:15:57 2002 J"orn Rennecke <joern.rennecke@superh.com>
* config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h.
(sh64-*-elf*, sh-*-rtemself*): Likewise.
* config/sh/embed_bb.c: New file.
* config/sh/embed-elf.h: New file.
* sh.h (CPP_SPEC): Supply __SIZE_TYPE__ and __PTRDIFF_TYPE__
if -m[12345]* option is given. Don't use subtarget_cpp_ptr_spec.
(CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and
__PTRDIFF_TYPE__ .
(SUBTARGET_CPP_PTR_SPEC): Don't define.
(EXTRA_SPECS): Remove subtarget_cpp_ptr_spec.
Add subtarget_asm_endian_spec.
(ASM_SPEC): Use subtarget_asm_endian_spec.
(SUBTARGET_ASM_ENDIAN_SPEC): Define.
(RETURN_ADDR_RTX): Use PR_MEDIA_REG for TARGET_SH5.
(WCHAR_UNSIGNED): Define.
(SH_ELF_WCHAR_TYPE, SH_DBX_REGISTER_NUMBER): Define.
(DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER.
(ALLOCATE_INITIAL_VALUE): Use PR_MEDIA_REG for TARGET_SH5.
Fix value.
* sh.c (calc_live_regs): Use PR_MEDIA_REG for TARGET_SH5.
(sh_adjust_cost): Likewise.
sh64.h (CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and
__PTRDIFF_TYPE__ .
(SUBTARGET_CPP_PTR_SPEC, WCHAR_TYPE): Don't #undef/ #define.
(WCHAR_TYPE_SIZE): Likewise.
(ASM_SPEC): Use subtarget_asm_endian_spec.
(SH_ELF_WCHAR_TYPE): #undef/ #define.
(MAX_WCHAR_TYPE_SIZE): Don't #undef.
* config/sh/elf.h (WCHAR_UNSIGNED): #undef .
(MAX_WCHAR_TYPE_SIZE): Don't #define .
(WCHAR_TYPE, WCHAR_TYPE_SIZE): #undef / #define .
(USER_LABEL_PREFIX): Don't #undef /#define .
(DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER.
* config/elf/linux.h (USER_LABEL_PREFIX): Don't #undef /#define .
(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Likewise.
(ASM_SPEC): Likewise.
(SUBTARGET_ASM_ENDIAN_SPEC): #undef / #define .
(CC1_SPEC): don't supply -m3 for -m4*, -m5*.
* t-sh: (LIB1ASMFUNCS): Use LIB1ASMFUNCS_CACHE.
(LIB2FUNCS_EXTRA): Define.
* t-sh64 (LIB2FUNCS_EXTRA): Define.
* config/sh/t-linux (LIB1ASMFUNCS): Don't redefine.
(LIB1ASMFUNCS_CACHE): Define.
(LIB2FUNCS_EXTRA): Redefine empty.
2002-04-08 Richard Henderson <rth@redhat.com> 2002-04-08 Richard Henderson <rth@redhat.com>
* reorg.c (get_branch_condition): Use reversed_comparison_code. * reorg.c (get_branch_condition): Use reversed_comparison_code.
......
...@@ -2925,12 +2925,12 @@ s390x-*-linux*) ...@@ -2925,12 +2925,12 @@ s390x-*-linux*)
;; ;;
sh-*-elf*) sh-*-elf*)
tmake_file="sh/t-sh sh/t-elf" tmake_file="sh/t-sh sh/t-elf"
tm_file="${tm_file} sh/elf.h" tm_file="${tm_file} sh/embed-elf.h"
float_format=sh float_format=sh
;; ;;
sh64-*-elf*) sh64-*-elf*)
tmake_file="sh/t-sh sh/t-elf sh/t-sh64" tmake_file="sh/t-sh sh/t-elf sh/t-sh64"
tm_file="${tm_file} sh/sh.h sh/elf.h sh/sh64.h" tm_file="${tm_file} sh/sh.h sh/embed-elf.h sh/sh64.h"
float_format=sh float_format=sh
extra_headers="../../config/sh/shmedia.h ../../config/sh/ushmedia.h ../../config/sh/sshmedia.h" extra_headers="../../config/sh/shmedia.h ../../config/sh/ushmedia.h ../../config/sh/sshmedia.h"
# Not strictly necessary to check this, but a good idea anyway. # Not strictly necessary to check this, but a good idea anyway.
...@@ -2941,7 +2941,7 @@ sh64-*-elf*) ...@@ -2941,7 +2941,7 @@ sh64-*-elf*)
sh-*-rtemself*) sh-*-rtemself*)
xm_defines=POSIX xm_defines=POSIX
tmake_file="sh/t-sh sh/t-elf t-rtems" tmake_file="sh/t-sh sh/t-elf t-rtems"
tm_file="${tm_file} sh/elf.h sh/rtemself.h rtems.h" tm_file="${tm_file} sh/embed-elf.h sh/rtemself.h rtems.h"
float_format=sh float_format=sh
if test x$enable_threads = xyes; then if test x$enable_threads = xyes; then
thread_file='rtems' thread_file='rtems'
......
/* Definitions of target machine for gcc for Hitachi / SuperH SH using ELF. /* Definitions of target machine for gcc for Hitachi / SuperH SH using ELF.
Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor <ian@cygnus.com>. Contributed by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -30,6 +30,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -30,6 +30,9 @@ Boston, MA 02111-1307, USA. */
#undef SIZE_TYPE #undef SIZE_TYPE
#undef PTRDIFF_TYPE #undef PTRDIFF_TYPE
/* And one that is defined in sh.h and should be undefined in svr4.h... */
#undef WCHAR_UNSIGNED
/* Be ELF-like. */ /* Be ELF-like. */
/* TODO: convert includes to ${tm_file} list in config.gcc. */ /* TODO: convert includes to ${tm_file} list in config.gcc. */
#include "dbxelf.h" #include "dbxelf.h"
...@@ -49,17 +52,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -49,17 +52,17 @@ Boston, MA 02111-1307, USA. */
/* use a more compact format for line information */ /* use a more compact format for line information */
#define DWARF2_ASM_LINE_DEBUG_INFO 1 #define DWARF2_ASM_LINE_DEBUG_INFO 1
/* WCHAR_TYPE_SIZE is defined to BITS_PER_WORD in svr4.h, but /* WCHAR_TYPE / WCHAR_TYPE_SIZE are defined to long int / BITS_PER_WORD in
BITS_PER_WORD isn't constant any more. Fortunately, on no SH svr4.h, but these work out as 64 bit for shmedia64. */
platform is it wider than 32-bits. */ #undef WCHAR_TYPE
#define MAX_WCHAR_TYPE_SIZE 32 /* #define WCHAR_TYPE (TARGET_SH5 ? "int" : "long int") */
#define WCHAR_TYPE SH_ELF_WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
/* The prefix to add to user-visible assembler symbols.
Note that svr4.h redefined it from the original value (that we want)
in sh.h */
#undef USER_LABEL_PREFIX /* The prefix to add to user-visible assembler symbols. */
#define USER_LABEL_PREFIX "_"
#undef LOCAL_LABEL_PREFIX #undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "." #define LOCAL_LABEL_PREFIX "."
...@@ -109,29 +112,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -109,29 +112,7 @@ Boston, MA 02111-1307, USA. */
/* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it /* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
again. */ again. */
#define DBX_REGISTER_NUMBER(REGNO) \ #define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
(GENERAL_REGISTER_P (REGNO) \
? ((REGNO) - FIRST_GENERAL_REG) \
: FP_REGISTER_P (REGNO) \
? ((REGNO) - FIRST_FP_REG + (TARGET_SH5 ? (TARGET_SHCOMPACT ? 245 \
: 77) : 25)) \
: XD_REGISTER_P (REGNO) \
? ((REGNO) - FIRST_XD_REG + (TARGET_SH5 ? 289 : 87)) \
: TARGET_REGISTER_P (REGNO) \
? ((REGNO) - FIRST_TARGET_REG + 68) \
: (REGNO) == PR_REG \
? (TARGET_SH5 ? 241 : 17) \
: (REGNO) == T_REG \
? (TARGET_SH5 ? 242 : 18) \
: (REGNO) == GBR_REG \
? (TARGET_SH5 ? 238 : 19) \
: (REGNO) == MACH_REG \
? (TARGET_SH5 ? 239 : 20) \
: (REGNO) == MACL_REG \
? (TARGET_SH5 ? 240 : 21) \
: (REGNO) == FPUL_REG \
? (TARGET_SH5 ? 244 : 23) \
: (abort(), -1))
#undef ASM_GENERATE_INTERNAL_LABEL #undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \ #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
......
/* Definitions of target machine for GNU compiler for Hitachi / SuperH SH
non-Linux embedded targets.
Copyright (C) 2002 Free Software Foundation, Inc.
Contributed by J"orn Rennecke <joern.rennecke@superh.com>
This file is part of GNU CC.
GNU CC 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 2, or (at your option)
any later version.
GNU CC 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.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "sh/elf.h"
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
#undef TARGET_HAS_F_SETLKW
#define L_bb
#undef inhibit_libc
#include "../../libgcc2.c"
/* Definitions for SH running Linux-based GNU systems using ELF /* Definitions for SH running Linux-based GNU systems using ELF
Copyright (C) 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by Kazumoto Kojima <kkojima@rr.iij4u.or.jp> Contributed by Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
This file is part of GNU CC. This file is part of GNU CC.
...@@ -23,22 +23,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,22 +23,6 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION #undef TARGET_VERSION
#define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr); #define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr);
/* Return to the original ELF way. */
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "long int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
#undef SUBTARGET_CPP_SPEC #undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC "\ #define SUBTARGET_CPP_SPEC "\
%{fPIC:-D__PIC__ -D__pic__} \ %{fPIC:-D__PIC__ -D__pic__} \
...@@ -59,12 +43,12 @@ Boston, MA 02111-1307, USA. */ ...@@ -59,12 +43,12 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES #undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -Dlinux -Asystem=posix" #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -Dlinux -Asystem=posix"
#undef ASM_SPEC #undef SUBTARGET_ASM_ENDIAN_SPEC
#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}" #define SUBTARGET_ASM_ENDIAN_SPEC "%{!mb:-little}"
#undef CC1_SPEC #undef CC1_SPEC
#define CC1_SPEC \ #define CC1_SPEC \
"-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" "-musermode %{!mb:-ml} %{!m3e:%{!m4*:%{!m5*:-m3}}}"
#undef CC1PLUS_SPEC #undef CC1PLUS_SPEC
#define CC1PLUS_SPEC \ #define CC1PLUS_SPEC \
......
/* Definitions of target machine for GNU compiler for Hitachi / SuperH SH /* Definitions of target machine for GNU compiler for Hitachi / SuperH SH.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com). Contributed by Steve Chamberlain (sac@cygnus.com).
......
...@@ -4343,10 +4343,11 @@ calc_live_regs (count_ptr, live_regs_mask) ...@@ -4343,10 +4343,11 @@ calc_live_regs (count_ptr, live_regs_mask)
target_flags &= ~FPU_SINGLE_BIT; target_flags &= ~FPU_SINGLE_BIT;
break; break;
} }
pr_initial = has_hard_reg_initial_val (Pmode, PR_REG); pr_initial = has_hard_reg_initial_val (Pmode,
TARGET_SH5 ? PR_MEDIA_REG : PR_REG);
pr_live = (pr_initial pr_live = (pr_initial
? REGNO (pr_initial) != PR_REG ? REGNO (pr_initial) != (TARGET_SH5 ? PR_MEDIA_REG : PR_REG)
: regs_ever_live[PR_REG]); : regs_ever_live[TARGET_SH5 ? PR_MEDIA_REG : PR_REG]);
/* Force PR to be live if the prologue has to call the SHmedia /* Force PR to be live if the prologue has to call the SHmedia
argument decoder or register saver. */ argument decoder or register saver. */
if (TARGET_SHCOMPACT if (TARGET_SHCOMPACT
...@@ -4356,7 +4357,7 @@ calc_live_regs (count_ptr, live_regs_mask) ...@@ -4356,7 +4357,7 @@ calc_live_regs (count_ptr, live_regs_mask)
pr_live = 1; pr_live = 1;
for (count = 0, reg = FIRST_PSEUDO_REGISTER - 1; reg >= 0; reg--) for (count = 0, reg = FIRST_PSEUDO_REGISTER - 1; reg >= 0; reg--)
{ {
if (reg == PR_REG if (reg == (TARGET_SH5 ? PR_MEDIA_REG : PR_REG)
? pr_live ? pr_live
: (interrupt_handler && ! pragma_trapa) : (interrupt_handler && ! pragma_trapa)
? (/* Need to save all the regs ever live. */ ? (/* Need to save all the regs ever live. */
...@@ -6697,7 +6698,7 @@ sh_adjust_cost (insn, link, dep_insn, cost) ...@@ -6697,7 +6698,7 @@ sh_adjust_cost (insn, link, dep_insn, cost)
int int
sh_pr_n_sets () sh_pr_n_sets ()
{ {
return REG_N_SETS (PR_REG); return REG_N_SETS (TARGET_SH5 ? PR_MEDIA_REG : PR_REG);
} }
/* SHmedia requires registers for branches, so we can't generate new /* SHmedia requires registers for branches, so we can't generate new
......
...@@ -56,10 +56,11 @@ extern int code_for_indirect_jump_scratch; ...@@ -56,10 +56,11 @@ extern int code_for_indirect_jump_scratch;
%{m4-single:-D__SH4_SINGLE__} \ %{m4-single:-D__SH4_SINGLE__} \
%{m4-nofpu:-D__sh3__ -D__SH4_NOFPU__} \ %{m4-nofpu:-D__sh3__ -D__SH4_NOFPU__} \
%{m4:-D__SH4__} \ %{m4:-D__SH4__} \
%{m1|m2|m3*|m4*:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
%{m5*:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
%{!m1:%{!m2:%{!m3*:%{!m4*:%{!m5*:%(cpp_default_cpu_spec)}}}}} \ %{!m1:%{!m2:%{!m3*:%{!m4*:%{!m5*:%(cpp_default_cpu_spec)}}}}} \
%{mhitachi:-D__HITACHI__} \ %{mhitachi:-D__HITACHI__} \
%(subtarget_cpp_spec) \ %(subtarget_cpp_spec) \
%(subtarget_cpp_ptr_spec) \
%(subtarget_cpp_endian_spec) " %(subtarget_cpp_endian_spec) "
#ifndef SUBTARGET_CPP_ENDIAN_SPEC #ifndef SUBTARGET_CPP_ENDIAN_SPEC
...@@ -71,25 +72,24 @@ extern int code_for_indirect_jump_scratch; ...@@ -71,25 +72,24 @@ extern int code_for_indirect_jump_scratch;
#endif #endif
#ifndef CPP_DEFAULT_CPU_SPEC #ifndef CPP_DEFAULT_CPU_SPEC
#define CPP_DEFAULT_CPU_SPEC "-D__sh1__" #define CPP_DEFAULT_CPU_SPEC \
"-D__sh1__ -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int"
#endif #endif
#ifndef SUBTARGET_CPP_PTR_SPEC
#define SUBTARGET_CPP_PTR_SPEC "\
%{m5-64media|m5-64media-nofpu|m5-32media|m5-32media-nofpu|m5-compact|m5-compact-nofpu:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
%{!m5-64media:%{!m5-64media-nofpu:%{!m5-32media:%{!m5-32media-nofpu:%{!m5-compact:%{!m5-compact-nofpu:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}}}}} \
"
#endif
#define EXTRA_SPECS \ #define EXTRA_SPECS \
{ "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \
{ "subtarget_cpp_endian_spec", SUBTARGET_CPP_ENDIAN_SPEC }, \ { "subtarget_cpp_endian_spec", SUBTARGET_CPP_ENDIAN_SPEC }, \
{ "subtarget_cpp_ptr_spec", SUBTARGET_CPP_PTR_SPEC }, \ { "cpp_default_cpu_spec", CPP_DEFAULT_CPU_SPEC }, \
{ "cpp_default_cpu_spec", CPP_DEFAULT_CPU_SPEC }, { "subtarget_asm_endian_spec", SUBTARGET_ASM_ENDIAN_SPEC },
#define CPP_PREDEFINES "-D__sh__ -Acpu=sh -Amachine=sh" #define CPP_PREDEFINES "-D__sh__ -Acpu=sh -Amachine=sh"
#define ASM_SPEC "%{ml:-little} %{mrelax:-relax}" #define ASM_SPEC "%(subtarget_asm_endian_spec) %{mrelax:-relax}"
#ifndef SUBTARGET_ASM_ENDIAN_SPEC
#define SUBTARGET_ASM_ENDIAN_SPEC "%{ml:-little}"
#endif
#define LINK_SPEC "%{ml:-m shl} %{mrelax:-relax}" #define LINK_SPEC "%{ml:-m shl} %{mrelax:-relax}"
...@@ -2057,7 +2057,7 @@ while (0) ...@@ -2057,7 +2057,7 @@ while (0)
#define RETURN_ADDR_RTX(COUNT, FRAME) \ #define RETURN_ADDR_RTX(COUNT, FRAME) \
(((COUNT) == 0) \ (((COUNT) == 0) \
? get_hard_reg_initial_val (Pmode, PR_REG) \ ? get_hard_reg_initial_val (Pmode, TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG) \
: (rtx) 0) : (rtx) 0)
/* Generate necessary RTL for __builtin_saveregs(). */ /* Generate necessary RTL for __builtin_saveregs(). */
...@@ -2522,6 +2522,9 @@ while (0) ...@@ -2522,6 +2522,9 @@ while (0)
#define WCHAR_TYPE "short unsigned int" #define WCHAR_TYPE "short unsigned int"
#define WCHAR_TYPE_SIZE 16 #define WCHAR_TYPE_SIZE 16
#define WCHAR_UNSIGNED 1
#define SH_ELF_WCHAR_TYPE "long int"
/* Don't cse the address of the function being compiled. */ /* Don't cse the address of the function being compiled. */
/*#define NO_RECURSIVE_FUNCTION_CSE 1*/ /*#define NO_RECURSIVE_FUNCTION_CSE 1*/
...@@ -2892,8 +2895,11 @@ while (0) ...@@ -2892,8 +2895,11 @@ while (0)
/* DBX register number for a given compiler register number. */ /* DBX register number for a given compiler register number. */
/* GDB has FPUL at 23 and FP0 at 25, so we must add one to all FP registers /* GDB has FPUL at 23 and FP0 at 25, so we must add one to all FP registers
to match gdb. */ to match gdb. */
/* If you change this macro, make sure you update it in elf.h too. */ /* svr4.h undefines this macro, yet we really want to use the same numbers
#define DBX_REGISTER_NUMBER(REGNO) \ for coff as for elf, so we go via another macro: SH_DBX_REGISTER_NUMBER. */
#define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
#define SH_DBX_REGISTER_NUMBER(REGNO) \
(GENERAL_REGISTER_P (REGNO) \ (GENERAL_REGISTER_P (REGNO) \
? ((REGNO) - FIRST_GENERAL_REG) \ ? ((REGNO) - FIRST_GENERAL_REG) \
: FP_REGISTER_P (REGNO) \ : FP_REGISTER_P (REGNO) \
...@@ -3298,10 +3304,13 @@ extern struct rtx_def *fpscr_rtx; ...@@ -3298,10 +3304,13 @@ extern struct rtx_def *fpscr_rtx;
#endif /* (defined CRT_BEGIN || defined CRT_END) && ! __SHMEDIA__ */ #endif /* (defined CRT_BEGIN || defined CRT_END) && ! __SHMEDIA__ */
#define ALLOCATE_INITIAL_VALUE(hard_reg) \ #define ALLOCATE_INITIAL_VALUE(hard_reg) \
(REGNO (hard_reg) == PR_REG \ (REGNO (hard_reg) == (TARGET_SH5 ? PR_MEDIA_REG : PR_REG) \
? (current_function_is_leaf && ! sh_pr_n_sets () \ ? (current_function_is_leaf && ! sh_pr_n_sets () \
? (hard_reg) \ ? (hard_reg) \
: gen_rtx_MEM (Pmode, arg_pointer_rtx)) \ : gen_rtx_MEM (Pmode, TARGET_SH5 \
? (plus_constant (arg_pointer_rtx, \
TARGET_SHMEDIA64 ? -8 : -4)) \
: frame_pointer_rtx)) \
: NULL_RTX) : NULL_RTX)
#endif /* ! GCC_SH_H */ #endif /* ! GCC_SH_H */
/* Definitions of target machine for GNU compiler for SuperH SH 5. /* Definitions of target machine for GNU compiler for SuperH SH 5.
Copyright 2000, 2001 Free Software Foundation, Inc. Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com> Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of GNU CC. This file is part of GNU CC.
...@@ -24,20 +24,15 @@ Boston, MA 02111-1307, USA. */ ...@@ -24,20 +24,15 @@ Boston, MA 02111-1307, USA. */
fputs (" (SuperH SH)", stderr); fputs (" (SuperH SH)", stderr);
#undef CPP_DEFAULT_CPU_SPEC #undef CPP_DEFAULT_CPU_SPEC
#define CPP_DEFAULT_CPU_SPEC "-D__SH5__=32 -D__SHMEDIA__" #define CPP_DEFAULT_CPU_SPEC "-D__SH5__=32 -D__SHMEDIA__ \
-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int"
#undef SUBTARGET_CPP_PTR_SPEC
#define SUBTARGET_CPP_PTR_SPEC "\
%{!m1:%{!m2:%{!m3:%{!m3e:%{!m4:%{!m4-single:%{!m4-single-only:%{!m4-nofpu:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}}}}}}} \
%{m1|m2|m3|m3e|m4|m4-single|m4-single-only|m4-nofpu:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
"
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC "%{ml:-little} %{mrelax:-relax} \ #define ASM_SPEC "%(subtarget_asm_endian_spec) %{mrelax:-relax} \
%{m5-compact:--isa=SHcompact} %{m5-compact-nofpu:--isa=shcompact} \ %{m5-compact*:--isa=SHcompact} \
%{m5-32media:--isa=SHmedia --abi=32} %{m5-32media-nofpu:--isa=SHmedia --abi=32} \ %{m5-32media*:--isa=SHmedia --abi=32} \
%{m5-64media:--isa=SHmedia --abi=64} %{m5-64media-nofpu:--isa=SHmedia --abi=64} \ %{m5-64media*:--isa=SHmedia --abi=64} \
%{!m1:%{!m2:%{!m3:%{!m3e:%{!m4:%{!m4-single:%{!m4-single-only:%{!m4-nofpu:%{!m5-64media:%{!m5-64media-nofpu:%{!m5-32media:%{!m5-32media-nofpu:%{!m5-compact:%{!m5-compact-nofpu:--isa=SHmedia --abi=32}}}}}}}}}}}}}} \ %{!m1:%{!m2:%{!m3*:%{!m4*:%{!m5*:--isa=SHmedia --abi=32}}}}} \
" "
#undef LINK_SPEC #undef LINK_SPEC
...@@ -54,12 +49,5 @@ Boston, MA 02111-1307, USA. */ ...@@ -54,12 +49,5 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT #undef TARGET_DEFAULT
#define TARGET_DEFAULT (SH5_BIT|SH4_BIT|SH3E_BIT) #define TARGET_DEFAULT (SH5_BIT|SH4_BIT|SH3E_BIT)
/* These have been overridden in svr4.h, included in elf.h. Restore #undef SH_ELF_WCHAR_TYPE
them. */ #define SH_ELF_WCHAR_TYPE "int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#undef MAX_WCHAR_TYPE_SIZE
TARGET_LIBGCC2_CFLAGS = -fpic TARGET_LIBGCC2_CFLAGS = -fpic
LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \ LIB1ASMFUNCS_CACHE = _ic_invalidate
_movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
_ic_invalidate LIB2FUNCS_EXTRA=
MULTILIB_OPTIONS= mb m3e/m4 MULTILIB_OPTIONS= mb m3e/m4
MULTILIB_DIRNAMES= MULTILIB_DIRNAMES=
......
LIB1ASMSRC = sh/lib1funcs.asm LIB1ASMSRC = sh/lib1funcs.asm
LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \ LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
_movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
$(LIB1ASMFUNCS_CACHE)
LIB2FUNCS_EXTRA=$(srcdir)/config/sh/embed_bb.c
# We want fine grained libraries, so use the new code to build the # We want fine grained libraries, so use the new code to build the
# floating point emulation libraries. # floating point emulation libraries.
......
...@@ -6,6 +6,8 @@ LIB1ASMFUNCS = \ ...@@ -6,6 +6,8 @@ LIB1ASMFUNCS = \
_shcompact_incoming_args _ic_invalidate _nested_trampoline \ _shcompact_incoming_args _ic_invalidate _nested_trampoline \
_push_pop_shmedia_regs _push_pop_shmedia_regs
LIB2FUNCS_EXTRA=$(srcdir)/config/sh/embed_bb.c
MULTILIB_OPTIONS= ml m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu MULTILIB_OPTIONS= ml m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
MULTILIB_DIRNAMES= ml nofpu compact nofpu/compact media64 nofpu/media64 MULTILIB_DIRNAMES= ml nofpu compact nofpu/compact media64 nofpu/media64
MULTILIB_MATCHES= MULTILIB_MATCHES=
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment