PERFORCE change 37913 for review
Serguei Tzukanov
tzukanov at FreeBSD.org
Thu Sep 11 05:32:47 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=37913
Change 37913 by tzukanov at tzukanov_antares on 2003/09/11 05:32:38
Partial update. Re-IFC will follow.
Affected files ...
.. //depot/projects/s390/Makefile.inc1#16 edit
.. //depot/projects/s390/contrib/gcc/config/s390/fixdfdi.h#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/freebsd.h#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/libgcc-glibc.ver#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/linux.h#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/s390-protos.h#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/s390.c#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/s390.h#2 edit
.. //depot/projects/s390/contrib/gcc/config/s390/s390.md#3 edit
.. //depot/projects/s390/contrib/gcc/config/s390/t-linux64#2 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/as/s390-freebsd/config.h#4 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/as/s390x-freebsd/config.h#4 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/ld/Makefile.s390#3 edit
.. //depot/projects/s390/gnu/usr.bin/binutils/ld/Makefile.s390x#3 edit
.. //depot/projects/s390/gnu/usr.bin/cc/cc_tools/Makefile#6 edit
.. //depot/projects/s390/sys/s390/include/_limits.h#1 add
.. //depot/projects/s390/sys/s390/include/cpu.h#2 edit
.. //depot/projects/s390/sys/s390/include/critical.h#2 edit
.. //depot/projects/s390/sys/s390/include/limits.h#3 edit
.. //depot/projects/s390/sys/s390/include/md_var.h#2 edit
.. //depot/projects/s390/sys/s390/include/param.h#2 edit
.. //depot/projects/s390/sys/s390/s390/autoconf.c#3 edit
.. //depot/projects/s390/sys/s390/s390/clock.c#4 edit
.. //depot/projects/s390/sys/s390/s390/critical.c#2 edit
.. //depot/projects/s390/sys/s390/s390/dat.h#4 edit
.. //depot/projects/s390/sys/s390/s390/db_disasm.c#2 edit
.. //depot/projects/s390/sys/s390/s390/db_hwatch.c#2 edit
.. //depot/projects/s390/sys/s390/s390/db_interface.c#2 edit
.. //depot/projects/s390/sys/s390/s390/db_trace.c#2 edit
.. //depot/projects/s390/sys/s390/s390/dump_machdep.c#2 edit
.. //depot/projects/s390/sys/s390/s390/ebcdic.c#2 edit
.. //depot/projects/s390/sys/s390/s390/ebcdic.h#2 edit
.. //depot/projects/s390/sys/s390/s390/elf_machdep.c#5 edit
.. //depot/projects/s390/sys/s390/s390/esa.h#4 edit
.. //depot/projects/s390/sys/s390/s390/exception.S#3 edit
.. //depot/projects/s390/sys/s390/s390/external.c#3 edit
.. //depot/projects/s390/sys/s390/s390/external.h#2 edit
.. //depot/projects/s390/sys/s390/s390/genassym.c#4 edit
.. //depot/projects/s390/sys/s390/s390/hhc.c#5 edit
.. //depot/projects/s390/sys/s390/s390/hmcsc.c#8 edit
.. //depot/projects/s390/sys/s390/s390/identcpu.c#5 edit
.. //depot/projects/s390/sys/s390/s390/in6_cksum.S#2 edit
.. //depot/projects/s390/sys/s390/s390/in_cksum.S#2 edit
.. //depot/projects/s390/sys/s390/s390/iucv.c#2 edit
.. //depot/projects/s390/sys/s390/s390/locore.S#4 edit
.. //depot/projects/s390/sys/s390/s390/machdep.c#9 edit
.. //depot/projects/s390/sys/s390/s390/mcheck.c#3 edit
.. //depot/projects/s390/sys/s390/s390/mcheck.h#3 edit
.. //depot/projects/s390/sys/s390/s390/mem.c#7 edit
.. //depot/projects/s390/sys/s390/s390/mp_machdep.c#2 edit
.. //depot/projects/s390/sys/s390/s390/per.h#2 edit
.. //depot/projects/s390/sys/s390/s390/pmap.c#14 edit
.. //depot/projects/s390/sys/s390/s390/service.c#2 edit
.. //depot/projects/s390/sys/s390/s390/service.h#3 edit
.. //depot/projects/s390/sys/s390/s390/skey.h#2 edit
.. //depot/projects/s390/sys/s390/s390/support.S#3 edit
.. //depot/projects/s390/sys/s390/s390/swtch.S#4 edit
.. //depot/projects/s390/sys/s390/s390/sys_machdep.c#3 edit
.. //depot/projects/s390/sys/s390/s390/trap.c#9 edit
.. //depot/projects/s390/sys/s390/s390/trap.h#2 edit
.. //depot/projects/s390/sys/s390/s390/vm_machdep.c#8 edit
Differences ...
==== //depot/projects/s390/Makefile.inc1#16 (text+ko) ====
==== //depot/projects/s390/contrib/gcc/config/s390/fixdfdi.h#2 (text+ko) ====
@@ -43,6 +43,7 @@
UDItype_x ll;
};
+UDItype_x __fixunsdfdi (double a1);
/* convert double to unsigned int */
UDItype_x
@@ -114,6 +115,8 @@
UDItype_x ll;
};
+DItype_x __fixdfdi (double a1);
+
/* convert double to int */
DItype_x
__fixdfdi (double a1)
@@ -184,6 +187,8 @@
USItype_x l;
};
+UDItype_x __fixunssfdi (float a1);
+
/* convert float to unsigned int */
UDItype_x
__fixunssfdi (float a1)
@@ -250,6 +255,8 @@
USItype_x l;
};
+DItype_x __fixsfdi (float a1);
+
/* convert double to int */
DItype_x
__fixsfdi (float a1)
==== //depot/projects/s390/contrib/gcc/config/s390/freebsd.h#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* Definitions for IBM ESA/390 and ESAME running FreeBSD.
+/* Definitions for FreeBSD for S/390.
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Hartmut Penner (hpenner at de.ibm.com) and
Ulrich Weigand (uweigand at de.ibm.com).
@@ -20,12 +20,16 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef _FREEBSD_H
+#define _FREEBSD_H
+
/* Target specific version string. */
+#ifdef DEFAULT_TARGET_64BIT
#undef TARGET_VERSION
-#ifdef DEFAULT_TARGET_64BIT
#define TARGET_VERSION fprintf (stderr, " (FreeBSD for zSeries)");
#else
+#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (FreeBSD for S/390)");
#endif
@@ -33,6 +37,7 @@
/* Target specific type definitions. */
/* ??? Do we really want long as size_t on 31-bit? */
+/* Answer is yes for FreeBSD. */
#undef SIZE_TYPE
#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
#undef PTRDIFF_TYPE
@@ -46,67 +51,54 @@
#undef DEFAULT_SIGNED_CHAR
#define DEFAULT_SIGNED_CHAR 1
-/* Target specific preprocessor settings. */
-
-#define NO_BUILTIN_SIZE_TYPE
-#define NO_BUILTIN_PTRDIFF_TYPE
-
-#define CPP_CPU31_SPEC \
- "-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
- -D__s390__"
-
-#define CPP_CPU64_SPEC \
- "-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
- -D__s390__ -D__s390x__ -D__LONG_MAX__=9223372036854775807L"
+/* Target specific assembler settings. */
#ifdef DEFAULT_TARGET_64BIT
-#define CPP_CPU_SPEC "%{m31:%(cpp_cpu31)} %{!m31:%(cpp_cpu64)}"
-#else
-#define CPP_CPU_SPEC "%{m64:%(cpp_cpu64)} %{!m64:%(cpp_cpu31)}"
-#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. */
-
#undef ASM_SPEC
-#ifdef DEFAULT_TARGET_64BIT
#define ASM_SPEC "%{m31:-m31 -Aesa}"
#else
+#undef ASM_SPEC
#define ASM_SPEC "%{m64:-m64 -Aesame}"
#endif
/* Target specific linker settings. */
-#define LINK_CPU31_SPEC "-m elf_s390"
+#ifdef DEFAULT_TARGET_64BIT
+#define MULTILIB_DEFAULTS { "m64" }
+#else
+#define MULTILIB_DEFAULTS { "m31" }
+#endif
-#define LINK_CPU64_SPEC "-m elf64_s390"
+#define LINK_ARCH31_SPEC \
+ "-m elf_s390 \
+ %{p:%nconsider using '-pg' instead of '-p' with gprof(1) } \
+ %{Wl,*:%*} \
+ %{v:-V} \
+ %{assert*} %{R*} %{rpath*} %{defsym*} \
+ %{shared:-Bshareable %{h*} %{soname*}} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /libexec/ld-elf.so.1}} \
+ %{static:-Bstatic}} \
+ %{symbolic:-Bsymbolic}"
-#define LINK_CPUCOMMON_SPEC "%{G*} %{relax:-relax} \
- %{p:%e`-p' not supported; use `-pg' and gprof(1)} \
- %{Wl,*:%*} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{symbolic:-Bsymbolic} \
- %{!shared: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
- %{static:-Bstatic}}"
+#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
-#ifdef DEFAULT_TARGET_64BIT
-#define LINK_SPEC "%{m31:%(link_cpu31)} %{!m31:%(link_cpu64)} %(link_cpucommon)"
+#define LINK_SPEC "%{m31:%(link_arch31)} %{!m31:%(link_arch64)}"
#else
-#define LINK_SPEC "%{m64:%(link_cpu64)} %{!m64:%(link_cpu31)} %(link_cpucommon)"
+#undef LINK_SPEC
+#define LINK_SPEC "%{m64:%(link_arch64)} %{!m64:%(link_arch31)}"
#endif
@@ -115,174 +107,93 @@
is an initializer with a subgrouping for each command option. */
#define EXTRA_SPECS \
- { "cpp_cpu31", CPP_CPU31_SPEC }, \
- { "cpp_cpu64", CPP_CPU64_SPEC }, \
- { "cpp_cpu", CPP_CPU_SPEC }, \
- { "link_cpu31", LINK_CPU31_SPEC }, \
- { "link_cpu64", LINK_CPU64_SPEC }, \
- { "link_cpucommon", LINK_CPUCOMMON_SPEC }, \
+ { "link_arch31", LINK_ARCH31_SPEC }, \
+ { "link_arch64", LINK_ARCH64_SPEC }, \
-
-/* Character to start a comment. */
+#undef ASM_COMMENT_START
#define ASM_COMMENT_START "#"
-#undef ASM_APP_ON
+#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"
-
-#undef ASM_APP_OFF
+#undef ASM_APP_OFF
#define ASM_APP_OFF "#NO_APP\n"
-/* Assembler pseudos to introduce constants of various size. */
-#define ASM_DOUBLE "\t.double"
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
-/* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
-#define LOCAL_LABEL_PREFIX "."
+#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
+ do { \
+ unsigned char *pc_ = (CONTEXT)->ra; \
+ long new_cfa_; \
+ int i_; \
+ \
+ typedef struct \
+ { \
+ unsigned long psw_mask; \
+ unsigned long psw_addr; \
+ unsigned long gprs[16]; \
+ unsigned int acrs[16]; \
+ unsigned int fpc; \
+ unsigned int __pad; \
+ double fprs[16]; \
+ } __attribute__ ((__aligned__ (8))) sigregs_; \
+ \
+ sigregs_ *regs_; \
+ \
+ /* svc $__NR_sigreturn or svc $__NR_rt_sigreturn */ \
+ if (pc_[0] != 0x0a || (pc_[1] != 119 && pc_[1] != 173)) \
+ break; \
+ \
+ /* New-style RT frame: \
+ retcode + alignment (8 bytes) \
+ siginfo (128 bytes) \
+ ucontext (contains sigregs) */ \
+ if ((CONTEXT)->ra == (CONTEXT)->cfa) \
+ { \
+ struct ucontext_ \
+ { \
+ unsigned long uc_flags; \
+ struct ucontext_ *uc_link; \
+ unsigned long uc_stack[3]; \
+ sigregs_ uc_mcontext; \
+ } *uc_ = (CONTEXT)->cfa + 8 + 128; \
+ \
+ regs_ = &uc_->uc_mcontext; \
+ } \
+ \
+ /* Old-style RT frame and all non-RT frames: \
+ old signal mask (8 bytes) \
+ pointer to sigregs */ \
+ else \
+ { \
+ regs_ = *(sigregs_ **)((CONTEXT)->cfa + 8); \
+ } \
+ \
+ new_cfa_ = regs_->gprs[15] + 16*sizeof(long) + 32; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->cfa_reg = 15; \
+ (FS)->cfa_offset = \
+ new_cfa_ - (long) (CONTEXT)->cfa + 16*sizeof(long) + 32; \
+ \
+ for (i_ = 0; i_ < 16; i_++) \
+ { \
+ (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_].loc.offset = \
+ (long)®s_->gprs[i_] - new_cfa_; \
+ } \
+ for (i_ = 0; i_ < 16; i_++) \
+ { \
+ (FS)->regs.reg[16+i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[16+i_].loc.offset = \
+ (long)®s_->fprs[i_] - new_cfa_; \
+ } \
+ \
+ /* Load return addr from PSW into dummy register 32. */ \
+ (FS)->regs.reg[32].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[32].loc.offset = (long)®s_->psw_addr - new_cfa_; \
+ (FS)->retaddr_column = 32; \
+ \
+ goto SUCCESS; \
+ } while (0)
-/* Prefix for internally generated assembler labels. */
-#define LPREFIX ".L"
-
-
-/* This is how to output the definition of a user-level label named NAME,
- such as the label on a static function or variable NAME. */
-#undef ASM_OUTPUT_LABEL
-#define ASM_OUTPUT_LABEL(FILE, NAME) \
- (assemble_name (FILE, NAME), fputs (":\n", FILE))
-
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
-
-/* internal macro to output long */
-#define _ASM_OUTPUT_LONG(FILE, VALUE) \
- fprintf (FILE, "\t.long\t0x%lX\n", VALUE);
-
-
-/* This is how to output an element of a case-vector that is absolute. */
-#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- fprintf (FILE, "%s%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
- LPREFIX, VALUE)
-
-/* This is how to output an element of a case-vector that is relative. */
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "%s%s%d-%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
- LPREFIX, VALUE, LPREFIX, REL)
-
-
-
-/* This is how to output an assembler line
- that says to advance the location counter
- to a multiple of 2**LOG bytes. */
-#undef ASM_OUTPUT_ALIGN
-#define ASM_OUTPUT_ALIGN(FILE, LOG) \
- if ((LOG)!=0) fprintf ((FILE), "\t.align\t%d\n", 1<<(LOG))
-
-/* This is how to output an assembler line
- that says to advance the location counter by SIZE bytes. */
-#undef ASM_OUTPUT_SKIP
-#define ASM_OUTPUT_SKIP(FILE, SIZE) \
- fprintf ((FILE), "\t.set\t.,.+%u\n", (SIZE))
-
-/* This is how to output assembler code to declare an
- uninitialized external linkage data object. */
-#undef ASM_OUTPUT_ALIGNED_BSS
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
- asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-
-/* Output before read-only data. */
-#define TEXT_SECTION_ASM_OP ".text"
-
-/* Output before writable (initialized) data. */
-#define DATA_SECTION_ASM_OP ".data"
-
-/* Output before writable (uninitialized) data. */
-#define BSS_SECTION_ASM_OP ".bss"
-
-/* This is how to output a command to make the user-level label named NAME
- defined for reference from other files. */
-#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
- (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
-
-/* Select section for constant in constant pool.
- We are in the right section.
- undef for 64 bit mode (linux64.h).
- */
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, X, ALIGN)
-
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-do { \
- if (TARGET_64BIT) \
- { \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tlarl 1,0f\n"); \
- fprintf (FILE, "\tagf %d,0(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 :2 ); \
- fprintf (FILE, "\tlarl 1,"); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "@GOTENT\n"); \
- fprintf (FILE, "\tlg 1,0(1)\n"); \
- fprintf (FILE, "\tbr 1\n"); \
- fprintf (FILE, "0:\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tlarl 1,0f\n"); \
- fprintf (FILE, "\tagf %d,0(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 :2 ); \
- fprintf (FILE, "\tjg "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, "0:\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- } \
- } \
- else \
- { \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tbras 1,0f\n"); \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_-.\n"); \
- fprintf (FILE, "\t.long "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "@GOT\n"); \
- fprintf (FILE, "\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, "0:\tal %d,8(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
- fprintf (FILE, "\tl 0,4(1)\n"); \
- fprintf (FILE, "\tal 1,0(1)\n"); \
- fprintf (FILE, "\talr 1,0\n"); \
- fprintf (FILE, "\tl 1,0(1)\n"); \
- fprintf (FILE, "\tbr 1\n"); \
- } else { \
- fprintf (FILE, "\tbras 1,0f\n"); \
- fprintf (FILE, "\t.long "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "-.\n"); \
- fprintf (FILE, "\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, "0:\tal %d,4(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
- fprintf (FILE, "\tal 1,0(1)\n"); \
- fprintf (FILE, "\tbr 1\n"); \
- } \
- } \
-} while (0)
+#endif
==== //depot/projects/s390/contrib/gcc/config/s390/libgcc-glibc.ver#2 (text+ko) ====
@@ -8,6 +8,25 @@
# because GLIBC_2.0 does not exist on this architecture, as the first
# ever glibc release on the platform was GLIBC_2.2.
+%ifndef __s390x__
+%inherit GCC_3.0 GLIBC_2.0
+GLIBC_2.0 {
+ __divdi3
+ __moddi3
+ __udivdi3
+ __umoddi3
+
+ __register_frame
+ __register_frame_table
+ __deregister_frame
+ __register_frame_info
+ __deregister_frame_info
+ __frame_state_for
+ __register_frame_info_table
+}
+%endif
+
+%ifdef __s390x__
%inherit GCC_3.0 GLIBC_2.2
GLIBC_2.2 {
__register_frame
@@ -18,4 +37,5 @@
__frame_state_for
__register_frame_info_table
}
+%endif
==== //depot/projects/s390/contrib/gcc/config/s390/linux.h#2 (text+ko) ====
@@ -50,37 +50,24 @@
/* Target specific preprocessor settings. */
-#define NO_BUILTIN_SIZE_TYPE
-#define NO_BUILTIN_PTRDIFF_TYPE
-
-#define CPP_PREDEFINES \
- "-Dunix -Asystem(unix) -D__gnu_linux__ -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"
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("linux"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("system=linux"); \
+ builtin_assert ("system=unix"); \
+ builtin_define ("__ELF__"); \
+ builtin_define ("__gnu_linux__"); \
+ if (flag_pic) \
+ { \
+ builtin_define ("__PIC__"); \
+ builtin_define ("__pic__"); \
+ } \
+ } \
+ while (0)
-#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
@@ -94,6 +81,12 @@
/* Target specific linker settings. */
+#ifdef DEFAULT_TARGET_64BIT
+#define MULTILIB_DEFAULTS { "m64" }
+#else
+#define MULTILIB_DEFAULTS { "m31" }
+#endif
+
#define LINK_ARCH31_SPEC \
"-m elf_s390 \
%{shared:-shared} \
@@ -126,183 +119,86 @@
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. */
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
-#define ASM_COMMENT_START "#"
-
-
-/* Assembler pseudos to introduce constants of various size. */
-
-#define ASM_DOUBLE "\t.double"
-
-/* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */
-#define LOCAL_LABEL_PREFIX "."
-
-/* Prefix for internally generated assembler labels. */
-#define LPREFIX ".L"
-
-
-/* This is how to output the definition of a user-level label named NAME,
- such as the label on a static function or variable NAME. */
-
-#undef ASM_OUTPUT_LABEL
-#define ASM_OUTPUT_LABEL(FILE, NAME) \
- (assemble_name (FILE, NAME), fputs (":\n", FILE))
-
-/* Store in OUTPUT a string (made with alloca) containing
- an assembler-name for a local static variable named NAME.
- LABELNO is an integer which is different for each call. */
-
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
- sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
-
- /* internal macro to output long */
-#define _ASM_OUTPUT_LONG(FILE, VALUE) \
- fprintf (FILE, "\t.long\t0x%lX\n", VALUE);
-
-
-/* This is how to output an element of a case-vector that is absolute. */
-
-#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- fprintf (FILE, "%s%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
- LPREFIX, VALUE)
-
-/* This is how to output an element of a case-vector that is relative. */
-
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "%s%s%d-%s%d\n", integer_asm_op (UNITS_PER_WORD, TRUE), \
- LPREFIX, VALUE, LPREFIX, REL)
-
-
-
-/* This is how to output an assembler line
- that says to advance the location counter
- to a multiple of 2**LOG bytes. */
-
-#undef ASM_OUTPUT_ALIGN
-#define ASM_OUTPUT_ALIGN(FILE, LOG) \
- if ((LOG)!=0) fprintf ((FILE), "\t.align\t%d\n", 1<<(LOG))
-
-/* This is how to output an assembler line
- that says to advance the location counter by SIZE bytes. */
-
-#undef ASM_OUTPUT_SKIP
-#define ASM_OUTPUT_SKIP(FILE, SIZE) \
- fprintf ((FILE), "\t.set\t.,.+%u\n", (SIZE))
-
-/* This is how to output assembler code to declare an
- uninitialized external linkage data object. */
-
-#undef ASM_OUTPUT_ALIGNED_BSS
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
- asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-
-/* Output before read-only data. */
-
-#define TEXT_SECTION_ASM_OP ".text"
-
-/* Output before writable (initialized) data. */
-
-#define DATA_SECTION_ASM_OP ".data"
-
-/* Output before writable (uninitialized) data. */
-
-#define BSS_SECTION_ASM_OP ".bss"
-
-/* This is how to output a command to make the user-level label named NAME
- defined for reference from other files. */
-
-#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
- (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
-
-/* Select section for constant in constant pool.
- We are in the right section.
- undef for 64 bit mode (linux64.h).
- */
-
-#undef SELECT_RTX_SECTION
-#define SELECT_RTX_SECTION(MODE, X, ALIGN)
-
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-do { \
- if (TARGET_64BIT) \
- { \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tlarl 1,0f\n"); \
- fprintf (FILE, "\tagf %d,0(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 :2 ); \
- fprintf (FILE, "\tlarl 1,"); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "@GOTENT\n"); \
- fprintf (FILE, "\tlg 1,0(1)\n"); \
- fprintf (FILE, "\tbr 1\n"); \
- fprintf (FILE, "0:\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tlarl 1,0f\n"); \
- fprintf (FILE, "\tagf %d,0(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 :2 ); \
- fprintf (FILE, "\tjg "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, "0:\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- } \
- } \
- else \
- { \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tbras 1,0f\n"); \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_-.\n"); \
- fprintf (FILE, "\t.long "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "@GOT\n"); \
- fprintf (FILE, "\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, "0:\tal %d,8(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
- fprintf (FILE, "\tl 0,4(1)\n"); \
- fprintf (FILE, "\tal 1,0(1)\n"); \
- fprintf (FILE, "\talr 1,0\n"); \
- fprintf (FILE, "\tl 1,0(1)\n"); \
- fprintf (FILE, "\tbr 1\n"); \
- } else { \
- fprintf (FILE, "\tbras 1,0f\n"); \
- fprintf (FILE, "\t.long "); \
- assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
- fprintf (FILE, "-.\n"); \
- fprintf (FILE, "\t.long "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, (DELTA)); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, "0:\tal %d,4(1)\n", \
- aggregate_value_p (TREE_TYPE \
- (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
- fprintf (FILE, "\tal 1,0(1)\n"); \
- fprintf (FILE, "\tbr 1\n"); \
- } \
- } \
-} while (0)
+#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
+ do { \
+ unsigned char *pc_ = (CONTEXT)->ra; \
+ long new_cfa_; \
+ int i_; \
+ \
+ typedef struct \
+ { \
+ unsigned long psw_mask; \
+ unsigned long psw_addr; \
+ unsigned long gprs[16]; \
+ unsigned int acrs[16]; \
+ unsigned int fpc; \
+ unsigned int __pad; \
+ double fprs[16]; \
+ } __attribute__ ((__aligned__ (8))) sigregs_; \
+ \
+ sigregs_ *regs_; \
+ \
+ /* svc $__NR_sigreturn or svc $__NR_rt_sigreturn */ \
+ if (pc_[0] != 0x0a || (pc_[1] != 119 && pc_[1] != 173)) \
+ break; \
+ \
+ /* New-style RT frame: \
+ retcode + alignment (8 bytes) \
+ siginfo (128 bytes) \
+ ucontext (contains sigregs) */ \
+ if ((CONTEXT)->ra == (CONTEXT)->cfa) \
+ { \
+ struct ucontext_ \
+ { \
+ unsigned long uc_flags; \
+ struct ucontext_ *uc_link; \
+ unsigned long uc_stack[3]; \
+ sigregs_ uc_mcontext; \
+ } *uc_ = (CONTEXT)->cfa + 8 + 128; \
+ \
+ regs_ = &uc_->uc_mcontext; \
+ } \
+ \
+ /* Old-style RT frame and all non-RT frames: \
+ old signal mask (8 bytes) \
+ pointer to sigregs */ \
+ else \
+ { \
+ regs_ = *(sigregs_ **)((CONTEXT)->cfa + 8); \
+ } \
+ \
+ new_cfa_ = regs_->gprs[15] + 16*sizeof(long) + 32; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->cfa_reg = 15; \
+ (FS)->cfa_offset = \
+ new_cfa_ - (long) (CONTEXT)->cfa + 16*sizeof(long) + 32; \
+ \
+ for (i_ = 0; i_ < 16; i_++) \
+ { \
+ (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_].loc.offset = \
+ (long)®s_->gprs[i_] - new_cfa_; \
+ } \
+ for (i_ = 0; i_ < 16; i_++) \
+ { \
+ (FS)->regs.reg[16+i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[16+i_].loc.offset = \
+ (long)®s_->fprs[i_] - new_cfa_; \
+ } \
+ \
+ /* Load return addr from PSW into dummy register 32. */ \
+ (FS)->regs.reg[32].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[32].loc.offset = (long)®s_->psw_addr - new_cfa_; \
+ (FS)->retaddr_column = 32; \
+ \
+ goto SUCCESS; \
+ } while (0)
#endif
==== //depot/projects/s390/contrib/gcc/config/s390/s390-protos.h#2 (text+ko) ====
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for IBM S/390.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Hartmut Penner (hpenner at de.ibm.com)
This file is part of GNU CC.
@@ -24,17 +24,16 @@
extern void optimization_options PARAMS ((int, int));
extern void override_options PARAMS ((void));
extern int s390_arg_frame_offset PARAMS ((void));
-extern void s390_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-extern void s390_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
extern void s390_emit_prologue PARAMS ((void));
extern void s390_emit_epilogue PARAMS ((void));
extern void s390_function_profiler PARAMS ((FILE *, int));
#ifdef RTX_CODE
+extern int s390_address_cost PARAMS ((rtx));
+extern int q_constraint PARAMS ((rtx));
extern int const0_operand PARAMS ((rtx, enum machine_mode));
extern int consttable_operand PARAMS ((rtx, enum machine_mode));
extern int larl_operand PARAMS ((rtx, enum machine_mode));
-extern int fp_operand PARAMS ((rtx, enum machine_mode));
extern int s_operand PARAMS ((rtx, enum machine_mode));
extern int s_imm_operand PARAMS ((rtx, enum machine_mode));
extern int bras_sym_operand PARAMS ((rtx, enum machine_mode));
@@ -44,12 +43,17 @@
extern int s390_extract_hi PARAMS ((rtx, enum machine_mode, int));
extern int s390_single_qi PARAMS ((rtx, enum machine_mode, int));
extern int s390_extract_qi PARAMS ((rtx, enum machine_mode, int));
+extern bool s390_split_ok_p PARAMS ((rtx, rtx, enum machine_mode, int));
+extern int tls_symbolic_operand PARAMS ((rtx));
extern int s390_match_ccmode PARAMS ((rtx, enum machine_mode));
+extern enum machine_mode s390_tm_ccmode PARAMS ((rtx, rtx, int));
extern enum machine_mode s390_select_ccmode PARAMS ((enum rtx_code, rtx, rtx));
extern int symbolic_reference_mentioned_p PARAMS ((rtx));
+extern int tls_symbolic_reference_mentioned_p PARAMS ((rtx));
+extern rtx s390_tls_get_offset PARAMS ((void));
extern int legitimate_la_operand_p PARAMS ((rtx));
-extern rtx legitimize_la_operand PARAMS ((rtx));
+extern int preferred_la_operand_p PARAMS ((rtx));
extern int legitimate_pic_operand_p PARAMS ((rtx));
extern int legitimate_constant_p PARAMS ((rtx));
extern int legitimate_reload_constant_p PARAMS ((rtx));
@@ -58,18 +62,25 @@
extern rtx legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
extern enum reg_class s390_preferred_reload_class PARAMS ((rtx, enum reg_class));
extern enum reg_class s390_secondary_input_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx));
+extern enum reg_class s390_secondary_output_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx));
extern int s390_plus_operand PARAMS ((rtx, enum machine_mode));
extern void s390_expand_plus_operand PARAMS ((rtx, rtx, rtx));
-extern void emit_pic_move PARAMS ((rtx *, enum machine_mode));
+extern void emit_symbolic_move PARAMS ((rtx *));
+extern void s390_load_address PARAMS ((rtx, rtx));
+extern void s390_expand_movstr PARAMS ((rtx, rtx, rtx));
+extern void s390_expand_clrstr PARAMS ((rtx, rtx));
+extern void s390_expand_cmpstr PARAMS ((rtx, rtx, rtx, rtx));
+extern rtx s390_return_addr_rtx PARAMS ((int, rtx));
extern void s390_output_symbolic_const PARAMS ((FILE *, rtx));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void s390_output_constant_pool PARAMS ((FILE *));
+extern void s390_output_constant_pool PARAMS ((rtx, rtx));
extern void s390_trampoline_template PARAMS ((FILE *));
extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
extern rtx s390_gen_rtx_const_DI PARAMS ((int, int));
extern rtx s390_simplify_dwarf_addr PARAMS ((rtx));
+extern void s390_machine_dependent_reorg PARAMS ((rtx));
#endif /* RTX_CODE */
#ifdef TREE_CODE
@@ -78,7 +89,7 @@
extern tree s390_build_va_list PARAMS ((void));
#ifdef RTX_CODE
extern rtx s390_function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
-extern void s390_va_start PARAMS ((int, tree, rtx));
+extern void s390_va_start PARAMS ((tree, rtx));
extern rtx s390_va_arg PARAMS ((tree, tree));
#endif /* RTX_CODE */
#endif /* TREE_CODE */
==== //depot/projects/s390/contrib/gcc/config/s390/s390.c#2 (text+ko) ====
@@ -1,5 +1,5 @@
/* Subroutines used for code generation on IBM S/390 and zSeries
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Hartmut Penner (hpenner at de.ibm.com) and
Ulrich Weigand (uweigand at de.ibm.com).
@@ -45,11 +45,22 @@
#include "target.h"
#include "target-def.h"
#include "debug.h"
+#include "langhooks.h"
+#include "optabs.h"
-
static bool s390_assemble_integer PARAMS ((rtx, unsigned int, int));
static int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int s390_adjust_priority PARAMS ((rtx, int));
+static void s390_select_rtx_section PARAMS ((enum machine_mode, rtx,
+ unsigned HOST_WIDE_INT));
+static void s390_encode_section_info PARAMS ((tree, int));
+static const char *s390_strip_name_encoding PARAMS ((const char *));
+static bool s390_cannot_force_const_mem PARAMS ((rtx));
+static void s390_init_builtins PARAMS ((void));
+static rtx s390_expand_builtin PARAMS ((tree, rtx, rtx,
+ enum machine_mode, int));
+static void s390_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree));
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
@@ -58,24 +69,43 @@
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER s390_assemble_integer
-#undef TARGET_ASM_FUNCTION_PROLOGUE
-#define TARGET_ASM_FUNCTION_PROLOGUE s390_function_prologue
-
-#undef TARGET_ASM_FUNCTION_EPILOGUE
-#define TARGET_ASM_FUNCTION_EPILOGUE s390_function_epilogue
-
#undef TARGET_ASM_OPEN_PAREN
#define TARGET_ASM_OPEN_PAREN ""
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list