linux64.h: Delete file.

* config/s390/linux64.h: Delete file.
	* config/s390/s390x.h: New file.
	* config.gcc (s390x-*-linux*): Use s390x.h instead of linux64.h
	as target header file.
	* config/s390/linux.h (TARGET_VERSION): Define depending on
	DEFAULT_TARGET_64BIT.
	(CPP_SPEC, ASM_SPEC, LINK_SPEC): Likewise.
	(SIZE_TYPE, PTRDIFF_TYPE): Likewise.
	(NO_BUILTIN_SIZE_TYPE, NO_BUILTIN_PTRDIFF_TYPE): Define.
	(CPP_ARCH31_SPEC, CPP_ARCH64_SPEC): New defines.
	(LINK_ARCH31_SPEC, LINK_ARCH64_SPEC): New defines.
	(EXTRA_SPEC): New define.
	* config/s390/s390.h (TARGET_VERSION): Define depending on
	DEFAULT_TARGET_64BIT.
	(MASK_RETURN_ADDR): Add run-time check for TARGET_64BIT.

From-SVN: r49552
This commit is contained in:
Ulrich Weigand 2002-02-06 20:55:37 +00:00 committed by Ulrich Weigand
parent 5ce89b2ef0
commit 58d10f89c4
6 changed files with 155 additions and 107 deletions

View File

@ -1,3 +1,21 @@
2002-02-06 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/linux64.h: Delete file.
* config/s390/s390x.h: New file.
* config.gcc (s390x-*-linux*): Use s390x.h instead of linux64.h
as target header file.
* config/s390/linux.h (TARGET_VERSION): Define depending on
DEFAULT_TARGET_64BIT.
(CPP_SPEC, ASM_SPEC, LINK_SPEC): Likewise.
(SIZE_TYPE, PTRDIFF_TYPE): Likewise.
(NO_BUILTIN_SIZE_TYPE, NO_BUILTIN_PTRDIFF_TYPE): Define.
(CPP_ARCH31_SPEC, CPP_ARCH64_SPEC): New defines.
(LINK_ARCH31_SPEC, LINK_ARCH64_SPEC): New defines.
(EXTRA_SPEC): New define.
* config/s390/s390.h (TARGET_VERSION): Define depending on
DEFAULT_TARGET_64BIT.
(MASK_RETURN_ADDR): Add run-time check for TARGET_64BIT.
2002-02-06 Jason Merrill <jason@redhat.com>
* c-decl.c (finish_function): Warn about a non-void function with

View File

@ -2870,7 +2870,7 @@ s390-*-linux*)
fi
;;
s390x-*-linux*)
tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h s390/linux64.h"
tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h"
tm_p_file=s390/s390-protos.h
md_file=s390/s390.md
out_file=s390/s390.c

View File

@ -1,5 +1,5 @@
/* Definitions for Linux for S/390.
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Hartmut Penner (hpenner@de.ibm.com) and
Ulrich Weigand (uweigand@de.ibm.com).
@ -23,52 +23,115 @@ Boston, MA 02111-1307, USA. */
#ifndef _LINUX_H
#define _LINUX_H
#undef SIZE_TYPE /* use default */
/* Target specific version string. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (Linux for S/390)");
/* Names to predefine in the preprocessor for this target machine. */
#define CPP_PREDEFINES "-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390__ -Asystem(unix) -Dunix -D__ELF__"
/*
* Caller save not (always) working in gcc-2.95.2
*/
#undef CC1_SPEC
#define CC1_SPEC "-fno-caller-saves"
#define CC1PLUS_SPEC "-fno-caller-saves"
#undef LINK_SPEC
#ifdef CROSS_COMPILE
#define LINK_SPEC "-m elf_s390 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1 \
-rpath-link=/usr/local/s390-ibm-linux/lib}} \
%{static:-static}}}"
#ifdef DEFAULT_TARGET_64BIT
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (Linux for zSeries)");
#else
#define LINK_SPEC "-m elf_s390 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
%{static:-static}}}"
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (Linux for S/390)");
#endif
/* Need to define this. Otherwise define to BITS_PER_WORD in cexp.c.
But BITS_PER_WORD depends on target flags, which are not defined in
cexpc.c. */
/* Target specific type definitions. */
/* ??? Do we really want long as size_t on 31-bit? */
#undef SIZE_TYPE
#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "long unsigned int")
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
/* Target specific preprocessor settings. */
#define NO_BUILTIN_SIZE_TYPE
#define NO_BUILTIN_PTRDIFF_TYPE
#define CPP_PREDEFINES \
"-Dunix -Asystem(unix) -Dlinux -Asystem(linux) -D__ELF__ \
-Acpu(s390) -Amachine(s390) -D__s390__"
#define CPP_ARCH31_SPEC \
"-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=int"
#define CPP_ARCH64_SPEC \
"-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
-D__s390x__ -D__LONG_MAX__=9223372036854775807L"
#ifdef DEFAULT_TARGET_64BIT
#undef CPP_SPEC
#define CPP_SPEC "%{m31:%(cpp_arch31)} %{!m31:%(cpp_arch64)}"
#else
#undef CPP_SPEC
#define CPP_SPEC "%{m64:%(cpp_arch64)} %{!m64:%(cpp_arch31)}"
#endif
/* Target specific compiler settings. */
/* ??? -fcaller-saves sometimes doesn't work. Fix this! */
#undef CC1_SPEC
#define CC1_SPEC "-fno-caller-saves"
#undef CC1PLUS_SPEC
#define CC1PLUS_SPEC "-fno-caller-saves"
/* Target specific assembler settings. */
#ifdef DEFAULT_TARGET_64BIT
#undef ASM_SPEC
#define ASM_SPEC "%{m31:-m31 -Aesa}"
#else
#undef ASM_SPEC
#define ASM_SPEC "%{m64:-m64 -Aesame}"
#endif
/* Target specific linker settings. */
#define LINK_ARCH31_SPEC \
"-m elf_s390 \
%{shared:-shared} \
%{!shared: \
%{static:-static} \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
#define LINK_ARCH64_SPEC \
"-m elf64_s390 \
%{shared:-shared} \
%{!shared: \
%{static:-static} \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}}}"
#ifdef DEFAULT_TARGET_64BIT
#undef LINK_SPEC
#define LINK_SPEC "%{m31:%(link_arch31)} %{!m31:%(link_arch64)}"
#else
#undef LINK_SPEC
#define LINK_SPEC "%{m64:%(link_arch64)} %{!m64:%(link_arch31)}"
#endif
/* This macro defines names of additional specifications to put in the specs
that can be used in various specifications like CC1_SPEC. Its definition
is an initializer with a subgrouping for each command option. */
#define EXTRA_SPECS \
{ "cpp_arch31", CPP_ARCH31_SPEC }, \
{ "cpp_arch64", CPP_ARCH64_SPEC }, \
{ "link_arch31", LINK_ARCH31_SPEC }, \
{ "link_arch64", LINK_ARCH64_SPEC }, \
/* Character to start a comment. */
#define ASM_COMMENT_START "#"

View File

@ -1,65 +0,0 @@
/* Definitions for Linux for s/390 zSeries
Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Hartmut Penner (hpenner@de.ibm.com) and
Ulrich Weigand (uweigand@de.ibm.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. */
#ifndef _LINUX64_H
#define _LINUX64_H
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
#undef TARGET_DEFAULT
#define TARGET_DEFAULT 0x13
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (Linux for S/390 zSeries 64 bit)");
/* Names to predefine in the preprocessor for this target machine. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390__ -D__s390x__ \
-Asystem(unix) -Dunix -D__ELF__ \
-D__LONG_MAX__=9223372036854775807L"
#undef LINK_SPEC
#ifdef CROSS_COMPILE
#define LINK_SPEC "-m elf64_s390 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld64.so.1 \
-rpath-link=/usr/local/s390x-ibm-linux/lib}} \
%{static:-static}}}"
#else
#define LINK_SPEC "-m elf64_s390 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}} \
%{static:-static}}}"
#endif
#undef MASK_RETURN_ADDR
#undef SELECT_SECTION
#endif

View File

@ -22,8 +22,6 @@ Boston, MA 02111-1307, USA. */
#ifndef _S390_H
#define _S390_H
#define TARGET_VERSION fprintf (stderr, " (S/390)");
extern int flag_pic;
/* Run-time compilation parameters selecting different hardware subsets. */
@ -33,14 +31,21 @@ extern int target_flags;
/* Target macros checked at runtime of compiler. */
#define TARGET_HARD_FLOAT (target_flags & 1)
#define TARGET_SOFT_FLOAT (!(target_flags & 1))
#define TARGET_BACKCHAIN (target_flags & 2)
#define TARGET_SMALL_EXEC (target_flags & 4)
#define TARGET_DEBUG_ARG (target_flags & 8)
#define TARGET_64BIT (target_flags & 16)
#define TARGET_MVCLE (target_flags & 32)
#ifdef DEFAULT_TARGET_64BIT
#define TARGET_DEFAULT 0x13
#define TARGET_VERSION fprintf (stderr, " (zSeries)");
#else
#define TARGET_DEFAULT 0x3
#define TARGET_SOFT_FLOAT (!(target_flags & 1))
#define TARGET_VERSION fprintf (stderr, " (S/390)");
#endif
/* Macro to define tables used to set the flags. This is a list in braces
of pairs in braces, each pair being { "NAME", VALUE }
@ -640,7 +645,7 @@ extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; /* smalled class cont
/* We have 31 bit mode. */
#define MASK_RETURN_ADDR (GEN_INT (0x7fffffff))
#define MASK_RETURN_ADDR (TARGET_64BIT ? GEN_INT (-1) : GEN_INT (0x7fffffff))
/* The offset from the incoming value of %sp to the top of the stack frame
for the current function. */

27
gcc/config/s390/s390x.h Normal file
View File

@ -0,0 +1,27 @@
/* Definitions of target machine for IBM zSeries 64-bit
Copyright (C) 2002 Free Software Foundation, Inc.
Contributed by Hartmut Penner (hpenner@de.ibm.com) and
Ulrich Weigand (uweigand@de.ibm.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. */
#ifndef _S390X_H
#define _S390X_H
#define DEFAULT_TARGET_64BIT
#endif