Commit b655555e by Jason Thorpe Committed by Jason Thorpe

* config.gcc (sh5-*-netbsd*, sh5l*-*-netbsd*)

(sh64-*-netbsd*, sh64l*-*-netbsd*): New targets.
* config/sh/netbsd-elf.h (TARGET_VERSION_ENDIAN)
(TARGET_VERSION_CPU): Define according to the
default target.
(TARGET_VERSION): Use TARGET_VERSION_ENDIAN and
TARGET_VERSION_CPU.
(TARGET_OS_CPP_BUILTINS): Use NETBSD_OS_CPP_BUILTINS_LP64
if TARGET_SHMEDIA64.
(LINK_DEFAULT_CPU_EMUL): Define according to the
default target.
(SUBTARGET_LINK_EMUL_SUFFIX): Define.
(SUBTARGET_LINK_SPEC): Define.
(LINK_SPEC): Use SH_LINK_SPEC.
(ASM_SPEC): Remove.
(TARGET_DEFAULT): Use TARGET_CPU_DEFAULT.
(FUNCTION_PROFILER): Add cases for TARGET_SHMEDIA32
and TARGET_SHMEDIA64 which abort, for now.
* config/sh/t-netbsd-sh5: New file.
* config/sh/t-netbsd-sh5-32: New file.
* config/sh/t-netbsd-sh5-64: New file.

From-SVN: r54230
parent 6d8fd7bb
2002-06-04 Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (sh5-*-netbsd*, sh5l*-*-netbsd*)
(sh64-*-netbsd*, sh64l*-*-netbsd*): New targets.
* config/sh/netbsd-elf.h (TARGET_VERSION_ENDIAN)
(TARGET_VERSION_CPU): Define according to the
default target.
(TARGET_VERSION): Use TARGET_VERSION_ENDIAN and
TARGET_VERSION_CPU.
(TARGET_OS_CPP_BUILTINS): Use NETBSD_OS_CPP_BUILTINS_LP64
if TARGET_SHMEDIA64.
(LINK_DEFAULT_CPU_EMUL): Define according to the
default target.
(SUBTARGET_LINK_EMUL_SUFFIX): Define.
(SUBTARGET_LINK_SPEC): Define.
(LINK_SPEC): Use SH_LINK_SPEC.
(ASM_SPEC): Remove.
(TARGET_DEFAULT): Use TARGET_CPU_DEFAULT.
(FUNCTION_PROFILER): Add cases for TARGET_SHMEDIA32
and TARGET_SHMEDIA64 which abort, for now.
* config/sh/t-netbsd-sh5: New file.
* config/sh/t-netbsd-sh5-32: New file.
* config/sh/t-netbsd-sh5-64: New file.
2002-06-03 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de> 2002-06-03 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Richard Henderson <rth@redhat.com> Richard Henderson <rth@redhat.com>
......
...@@ -2248,7 +2248,8 @@ sh-*-linux*) ...@@ -2248,7 +2248,8 @@ sh-*-linux*)
fi fi
float_format=sh float_format=sh
;; ;;
sh-*-netbsdelf* | shl*-*-netbsdelf*) sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
sh64-*-netbsd* | sh64l*-*-netbsd*)
tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h netbsd.h netbsd-elf.h sh/netbsd-elf.h" tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h netbsd.h netbsd-elf.h sh/netbsd-elf.h"
tmake_file="${tmake_file} sh/t-sh sh/t-elf" tmake_file="${tmake_file} sh/t-sh sh/t-elf"
case $machine in case $machine in
...@@ -2260,7 +2261,23 @@ sh-*-netbsdelf* | shl*-*-netbsdelf*) ...@@ -2260,7 +2261,23 @@ sh-*-netbsdelf* | shl*-*-netbsdelf*)
tmake_file="${tmake_file} sh/t-be" tmake_file="${tmake_file} sh/t-be"
;; ;;
esac esac
tmake_file="${tmake_file} sh/t-netbsd" case $machine in
sh5*-*)
# SHmedia, 32-bit ABI
target_cpu_default="SH5_BIT|SH4_BIT|SH3E_BIT"
tmake_file="${tmake_file} sh/t-netbsd-sh5 sh/t-netbsd-sh5-32"
;;
sh64*-*)
# SHmedia, 64-bit ABI
target_cpu_default="SH5_BIT|SH4_BIT"
tmake_file="${tmake_file} sh/t-netbsd-sh5 sh/t-netbsd-sh5-64"
;;
*)
# SH3, software floating point
target_cpu_default="SH1_BIT|SH2_BIT|SH3_BIT"
tmake_file="${tmake_file} sh/t-netbsd"
;;
esac
float_format=sh float_format=sh
;; ;;
sh-*-*) sh-*-*)
......
...@@ -20,69 +20,111 @@ the Free Software Foundation, 59 Temple Place - Suite 330, ...@@ -20,69 +20,111 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
/* Run-time Target Specification. */ /* Run-time Target Specification. */
#undef TARGET_VERSION
#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT #if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT
#define TARGET_VERSION fputs (" (NetBSD/shle ELF)", stderr); #define TARGET_VERSION_ENDIAN "le"
#else #else
#define TARGET_VERSION fputs (" (NetBSD/sh ELF)", stderr); #define TARGET_VERSION_ENDIAN ""
#endif #endif
#if TARGET_CPU_DEFAULT & SH5_BIT
#if TARGET_CPU_DEFAULT & SH3E_BIT
#define TARGET_VERSION_CPU "sh5"
#else
#define TARGET_VERSION_CPU "sh64"
#endif /* SH3E_BIT */
#else
#define TARGET_VERSION_CPU "sh"
#endif /* SH5_BIT */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (NetBSD/%s%s ELF)", \
TARGET_VERSION_CPU, TARGET_VERSION_ENDIAN)
#define TARGET_OS_CPP_BUILTINS() \ #define TARGET_OS_CPP_BUILTINS() \
do \ do \
{ \ { \
NETBSD_OS_CPP_BUILTINS_ELF(); \ NETBSD_OS_CPP_BUILTINS_ELF(); \
if (TARGET_SHMEDIA64) \
NETBSD_OS_CPP_BUILTINS_LP64(); \
builtin_define ("__NO_LEADING_UNDERSCORES__"); \ builtin_define ("__NO_LEADING_UNDERSCORES__"); \
} \ } \
while (0) while (0)
/* Provide a LINK_SPEC appropriate for a NetBSD/sh ELF target. /* Provide a LINK_SPEC appropriate for a NetBSD/sh ELF target.
This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for We use the SH_LINK_SPEC from sh/sh.h, and define the appropriate
the SH target. */ SUBTARGET_LINK_SPEC that pulls in what we need from a generic
NetBSD ELF LINK_SPEC. */
#undef LINK_SPEC /* LINK_EMUL_PREFIX from sh/elf.h */
#define LINK_SPEC \
"%{assert*} %{R*} \ #undef LINK_DEFAULT_CPU_EMUL
%{mb:-m shelf_nbsd} \ #if TARGET_CPU_DEFAULT & SH5_BIT
%{ml:-m shlelf_nbsd} \ #if TARGET_CPU_DEFAULT & SH3E_BIT
%{mrelax:-relax} \ #define LINK_DEFAULT_CPU_EMUL "32"
%{shared:-shared} \ #else
%{!shared: \ #define LINK_DEFAULT_CPU_EMUL "64"
-dc -dp \ #endif /* SH3E_BIT */
%{!nostdlib: \ #else
%{!r*: \ #define LINK_DEFAULT_CPU_EMUL ""
%{!e*:-e __start}}} \ #endif /* SH5_BIT */
%{!static: \
%{rdynamic:-export-dynamic} \ #undef SUBTARGET_LINK_EMUL_SUFFIX
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \ #define SUBTARGET_LINK_EMUL_SUFFIX "_nbsd"
#undef SUBTARGET_LINK_SPEC
#define SUBTARGET_LINK_SPEC \
"%{assert*} %{R*} \
%{shared:-shared} \
%{!shared: \
-dc -dp \
%{!nostdlib: \
%{!r*: \
%{!e*:-e __start}}} \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
%{static:-static}}" %{static:-static}}"
#undef LINK_SPEC
#define LINK_SPEC SH_LINK_SPEC
/* Provide a CPP_SPEC appropriate for NetBSD. */ /* Provide a CPP_SPEC appropriate for NetBSD. */
#undef SUBTARGET_CPP_SPEC #undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC #define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
/* Restore the ASM_SPEC from sh/sh.h; sh/elf.h clobbers it. */
#undef ASM_SPEC
#define ASM_SPEC "%(subtarget_asm_endian_spec) %{mrelax:-relax}"
#undef TARGET_DEFAULT #undef TARGET_DEFAULT
#define TARGET_DEFAULT \ #define TARGET_DEFAULT \
(SH1_BIT|SH2_BIT|SH3_BIT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT) (TARGET_CPU_DEFAULT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT)
#undef FUNCTION_PROFILER #undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(STREAM,LABELNO) \ #define FUNCTION_PROFILER(STREAM,LABELNO) \
do \ do \
{ \ { \
fprintf((STREAM), "\tmov.l\t%cLP%d,r1\n", \ if (TARGET_SHMEDIA32) \
LOCAL_LABEL_PREFIX, (LABELNO)); \ { \
fprintf((STREAM), "\tmova\t%cLP%dr,r0\n", \ /* FIXME */ \
LOCAL_LABEL_PREFIX, (LABELNO)); \ abort (); \
fprintf((STREAM), "\tjmp\t@r1\n"); \ } \
fprintf((STREAM), "\tnop\n"); \ else if (TARGET_SHMEDIA64) \
fprintf((STREAM), "\t.align\t2\n"); \ { \
fprintf((STREAM), "%cLP%d:\t.long\t__mcount\n", \ /* FIXME */ \
LOCAL_LABEL_PREFIX, (LABELNO)); \ abort (); \
fprintf((STREAM), "%cLP%dr:\n", LOCAL_LABEL_PREFIX, (LABELNO)); \ } \
else \
{ \
fprintf((STREAM), "\tmov.l\t%cLP%d,r1\n", \
LOCAL_LABEL_PREFIX, (LABELNO)); \
fprintf((STREAM), "\tmova\t%cLP%dr,r0\n", \
LOCAL_LABEL_PREFIX, (LABELNO)); \
fprintf((STREAM), "\tjmp\t@r1\n"); \
fprintf((STREAM), "\tnop\n"); \
fprintf((STREAM), "\t.align\t2\n"); \
fprintf((STREAM), "%cLP%d:\t.long\t__mcount\n", \
LOCAL_LABEL_PREFIX, (LABELNO)); \
fprintf((STREAM), "%cLP%dr:\n", LOCAL_LABEL_PREFIX, (LABELNO)); \
} \
} \ } \
while (0) while (0)
TARGET_LIBGCC2_CFLAGS = -fpic
LIB1ASMFUNCS = \
_sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
_shcompact_call_trampoline _shcompact_return_trampoline \
_shcompact_incoming_args _ic_invalidate _nested_trampoline \
_push_pop_shmedia_regs
LIB2FUNCS_EXTRA=
EXTRA_MULTILIB_PARTS=
# NetBSD's C library includes a fast software FP library that
# has support for setting/setting the rounding mode, exception
# mask, etc. Therefore, we don't want to include software FP
# in libgcc.
FPBIT =
DPBIT =
MULTILIB_OPTIONS += m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
MULTILIB_DIRNAMES=
MULTILIB_MATCHES =
MULTILIB_OPTIONS += m5-64media-nofpu/m5-compact/m5-compact-nofpu/m5-32media/m5-32media-nofpu
MULTILIB_DIRNAMES=
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