From d89ed652402e80d2e56289702968928aa95fb172 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 20 Jul 1998 15:47:31 -0700 Subject: [PATCH] alpha.h (CPP_SPEC): Tidy. * alpha.h (CPP_SPEC): Tidy. Hook to cpp_cpu and cpp_subtarget. (CPP_SUBTARGET_SPEC): Default to empty string. (CPP_AM_*, CPP_IM_*, CPP_CPU_*, CPP_CPU_SPEC): New. (EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): New. * alpha/elf.h (LD_SPEC): Use %(elf_dynamic_linker). * alpha/linux-elf.h (SUBTARGET_EXTRA_SPECS): New. (LIB_SPEC): Tidy. * alpha/linux.h (CPP_PREDEFINES): Tidy. * alpha/netbsd-elf.h (SUBTARGET_EXTRA_SPECS): New. * alpha/netbsd.h (CPP_PREDEFINES): Tidy. * alpha/osf.h (CPP_PREDEFINES): Remove bits subsumed by CPP_CPU_SPEC. * alpha/win-nt.h (CPP_PREDEFINES): Likewise. * alpha/vsf.h (CPP_PREDEFINES): Likewise. (CPP_SUBTARGET_SPEC): New. Do this instead of overriding CPP_SPEC. * alpha/vxworks.h: Likewise. From-SVN: r21310 --- gcc/ChangeLog | 18 ++++++ gcc/config/alpha/alpha.h | 104 +++++++++++++++++++++++++++++++--- gcc/config/alpha/elf.h | 2 +- gcc/config/alpha/linux-elf.h | 14 +++-- gcc/config/alpha/linux.h | 5 +- gcc/config/alpha/netbsd-elf.h | 6 +- gcc/config/alpha/netbsd.h | 4 +- gcc/config/alpha/osf.h | 4 +- gcc/config/alpha/vms.h | 15 ++--- gcc/config/alpha/vxworks.h | 14 ++--- gcc/config/alpha/win-nt.h | 6 +- 11 files changed, 143 insertions(+), 49 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80122bb77586..8bbd5ba090be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +Mon Jul 20 22:34:17 1998 Richard Henderson + + * alpha.h (CPP_SPEC): Tidy. Hook to cpp_cpu and cpp_subtarget. + (CPP_SUBTARGET_SPEC): Default to empty string. + (CPP_AM_*, CPP_IM_*, CPP_CPU_*, CPP_CPU_SPEC): New. + (EXTRA_SPECS, SUBTARGET_EXTRA_SPECS): New. + * alpha/elf.h (LD_SPEC): Use %(elf_dynamic_linker). + * alpha/linux-elf.h (SUBTARGET_EXTRA_SPECS): New. + (LIB_SPEC): Tidy. + * alpha/linux.h (CPP_PREDEFINES): Tidy. + * alpha/netbsd-elf.h (SUBTARGET_EXTRA_SPECS): New. + * alpha/netbsd.h (CPP_PREDEFINES): Tidy. + * alpha/osf.h (CPP_PREDEFINES): Remove bits subsumed by CPP_CPU_SPEC. + * alpha/win-nt.h (CPP_PREDEFINES): Likewise. + * alpha/vsf.h (CPP_PREDEFINES): Likewise. + (CPP_SUBTARGET_SPEC): New. Do this instead of overriding CPP_SPEC. + * alpha/vxworks.h: Likewise. + Mon Jul 20 22:51:57 1998 Ken Raeburn * mips.md (reload_outsi): Added missing REGNO call. diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 2bd93c3bb3bd..6e612afc5748 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -23,14 +23,18 @@ Boston, MA 02111-1307, USA. */ /* Write out the correct language type definition for the header files. Unless we have assembler language, write out the symbols for C. */ #define CPP_SPEC "\ -%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \ -%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ -%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \ -%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \ -%{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \ -%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C} \ -%{mieee:-D_IEEE_FP} \ -%{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT}" +%{!undef:\ +%{.S:-D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY }}\ +%{.cc|.cxx|.C:-D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus }\ +%{.m:-D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C }\ +%{!.S:%{!.cc:%{!.cxx:%{!.C:%{!.m:-D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C }}}}}}\ +%{mieee:-D_IEEE_FP }\ +%{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT }}\ +%(cpp_cpu) %(cpp_subtarget)" + +#ifndef CPP_SUBTARGET_SPEC +#define CPP_SUBTARGET_SPEC "" +#endif /* Set the spec to use for signed char. The default tests the above macro but DEC's compiler can't handle the conditional in a "constant" @@ -240,6 +244,88 @@ extern char *alpha_mlat_string; /* For -mmemory-latency= */ {"memory-latency=", &alpha_mlat_string}, \ } +/* Attempt to describe CPU characteristics to the preprocessor. */ + +/* Corresponding to amask... */ +#define CPP_AM_BWX_SPEC "-D__alpha_bwx__ -Acpu(bwx)" +#define CPP_AM_MAX_SPEC "-D__alpha_max__ -Acpu(max)" +#define CPP_AM_CIX_SPEC "-D__alpha_cix__ -Acpu(cix)" + +/* Corresponding to implver... */ +#define CPP_IM_EV4_SPEC "-D__alpha_ev4__ -Acpu(ev4)" +#define CPP_IM_EV5_SPEC "-D__alpha_ev5__ -Acpu(ev5)" +#define CPP_IM_EV6_SPEC "-D__alpha_ev6__ -Acpu(ev6)" + +/* Common combinations. */ +#define CPP_CPU_EV4_SPEC "%(cpp_im_ev4)" +#define CPP_CPU_EV5_SPEC "%(cpp_im_ev5)" +#define CPP_CPU_EV56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx)" +#define CPP_CPU_PCA56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx) %(cpp_am_max)" +#define CPP_CPU_EV6_SPEC "%(cpp_im_ev6) %(cpp_am_bwx) %(cpp_am_max) %(cpp_am_cix)" + +#ifndef CPP_CPU_DEFAULT_SPEC +# if TARGET_CPU_DEFAULT & MASK_CPU_EV6 +# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV6_SPEC +# else +# if TARGET_CPU_DEFAULT & MASK_CPU_EV5 +# if TARGET_CPU_DEFAULT & MASK_MAX +# define CPP_CPU_DEFAULT_SPEC CPP_CPU_PCA56_SPEC +# else +# if TARGET_CPU_DEFAULT & MASK_BWX +# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV56_SPEC +# else +# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV5_SPEC +# endif +# endif +# else +# define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV4_SPEC +# endif +# endif +#endif /* CPP_CPU_DEFAULT_SPEC */ + +#ifndef CPP_CPU_SPEC +#define CPP_CPU_SPEC "\ +%{!undef:-Acpu(alpha) -Amachine(alpha) -D__alpha -D__alpha__ \ +%{mcpu=ev4|mcpu=21064:%(cpp_cpu_ev4) }\ +%{mcpu=ev5|mcpu=21164:%(cpp_cpu_ev5) }\ +%{mcpu=ev56|mcpu=21164a:%(cpp_cpu_ev56) }\ +%{mcpu=pca56|mcpu=21164pc|mcpu=21164PC:%(cpp_cpu_pca56) }\ +%{mcpu=ev6|mcpu=21264:%(cpp_cpu_ev6) }\ +%{!mcpu*:%(cpp_cpu_default) }}" +#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. + + Each subgrouping contains a string constant, that defines the + specification name, and a string constant that used by the GNU CC driver + program. + + Do not define this macro if it does not need to do anything. */ + +#ifndef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS +#endif + +#define EXTRA_SPECS \ + { "cpp_am_bwx", CPP_AM_BWX_SPEC }, \ + { "cpp_am_max", CPP_AM_MAX_SPEC }, \ + { "cpp_am_cix", CPP_AM_CIX_SPEC }, \ + { "cpp_im_ev4", CPP_IM_EV4_SPEC }, \ + { "cpp_im_ev5", CPP_IM_EV5_SPEC }, \ + { "cpp_im_ev6", CPP_IM_EV6_SPEC }, \ + { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC }, \ + { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC }, \ + { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC }, \ + { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC }, \ + { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC }, \ + { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \ + { "cpp_cpu", CPP_CPU_SPEC }, \ + { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \ + SUBTARGET_EXTRA_SPECS + + /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -1209,7 +1295,7 @@ do { \ /* A C expression whose value is RTL representing the value of the return address for the frame COUNT steps up from the current frame. FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of - the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME} is defined. */ + the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME is defined. */ #define RETURN_ADDR_RTX alpha_return_addr extern struct rtx_def *alpha_return_addr (); diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h index d28847c44d93..4f4703c14ef0 100644 --- a/gcc/config/alpha/elf.h +++ b/gcc/config/alpha/elf.h @@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}}\ + %{!dynamic-linker:-dynamic-linker %(elf_dynamic_linker)}} \ %{static:-static}}" /* Output at beginning of assembler file. */ diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h index 40aa332d189d..90009f1c5d0c 100644 --- a/gcc/config/alpha/linux-elf.h +++ b/gcc/config/alpha/linux-elf.h @@ -22,13 +22,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ELF)"); +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ +{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, + #undef SUB_CPP_PREDEFINES -#define SUB_CPP_PREDEFINES "-D__ELF__" +#define SUB_CPP_PREDEFINES "-D__ELF__" #ifdef USE_GNULIBC_1 -#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" #else -#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" #endif #ifndef USE_GNULIBC_1 @@ -39,7 +43,5 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef USE_GNULIBC_1 #undef LIB_SPEC #define LIB_SPEC \ - "%{shared: -lc} \ - %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ - %{profile:-lc_p} %{!profile: -lc}}" +"%{shared:-lc}%{!shared:%{pthread:-lpthread }%{profile:-lc_p}%{!profile:-lc}} " #endif diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h index 00df8e590369..39c1f575ecee 100644 --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -23,9 +23,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS) #undef CPP_PREDEFINES -#define CPP_PREDEFINES "\ --D__alpha -D__alpha__ -D__linux__ -D__linux -D_LONGLONG -Dlinux -Dunix \ --Asystem(linux) -Acpu(alpha) -Amachine(alpha) " SUB_CPP_PREDEFINES +#define CPP_PREDEFINES \ +"-Dlinux -Dunix -Asystem(linux) -D_LONGLONG " SUB_CPP_PREDEFINES #undef LIB_SPEC #define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}" diff --git a/gcc/config/alpha/netbsd-elf.h b/gcc/config/alpha/netbsd-elf.h index 353e62f02cd3..17d7bb0e4ae1 100644 --- a/gcc/config/alpha/netbsd-elf.h +++ b/gcc/config/alpha/netbsd-elf.h @@ -24,4 +24,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef SUB_CPP_PREDEFINES #define SUB_CPP_PREDEFINES "-D__ELF__" -#define ELF_DYNAMIC_LINKER "/usr/libexec/ld.elf_so" +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ +{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, + +#define ELF_DYNAMIC_LINKER "/usr/libexec/ld.elf_so" diff --git a/gcc/config/alpha/netbsd.h b/gcc/config/alpha/netbsd.h index 56559f3145b7..054e9e063b46 100644 --- a/gcc/config/alpha/netbsd.h +++ b/gcc/config/alpha/netbsd.h @@ -22,9 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS) #undef CPP_PREDEFINES -#define CPP_PREDEFINES "\ --D__alpha -D__alpha__ -D__linux__ -D__linux -D_LONGLONG -Dnetbsd -Dunix \ --Asystem(linux) -Acpu(alpha) -Amachine(alpha) " SUB_CPP_PREDEFINES +#define CPP_PREDEFINES "-D_LONGLONG -Dnetbsd -Dunix " SUB_CPP_PREDEFINES #undef LIB_SPEC #define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}" diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h index 1e8e505d9789..956961f7cf3c 100644 --- a/gcc/config/alpha/osf.h +++ b/gcc/config/alpha/osf.h @@ -27,8 +27,8 @@ Boston, MA 02111-1307, USA. */ /* Names to predefine in the preprocessor for this target machine. */ #define CPP_PREDEFINES "\ --Dunix -D__osf__ -D__alpha -D__alpha__ -D_LONGLONG -DSYSTYPE_BSD \ --D_SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4) -Acpu(alpha) -Amachine(alpha)" +-Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD \ +-D_SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4)" /* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */ diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index e318f0bfde47..44cf5bf82dff 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -31,20 +31,13 @@ Boston, MA 02111-1307, USA. */ #undef CPP_PREDEFINES #define CPP_PREDEFINES \ -"-D__ALPHA -Dvms -DVMS -D__alpha__ -D__alpha -D__vms__ -D__VMS__\ - -Asystem(vms) -Acpu(alpha) -Amachine(alpha)" +"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem(vms)" -#undef CPP_SPEC -#define CPP_SPEC "\ +#undef CPP_SUBTARGET_SPEC +#define CPP_SUBTARGET_SPEC "\ %{mfloat-ieee:-D__IEEE_FLOAT} \ %{mfloat-vax:-D__G_FLOAT} \ -%{!mfloat-vax:-D__IEEE_FLOAT} \ -%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \ -%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ -%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \ -%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \ -%{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \ -%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C}" +%{!mfloat-vax:-D__IEEE_FLOAT}" /* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */ diff --git a/gcc/config/alpha/vxworks.h b/gcc/config/alpha/vxworks.h index 9d21ad9b0cc8..6dee4b3e7211 100644 --- a/gcc/config/alpha/vxworks.h +++ b/gcc/config/alpha/vxworks.h @@ -20,20 +20,16 @@ Boston, MA 02111-1307, USA. */ /* This file just exists to give specs for the Alpha running on VxWorks. */ -#undef CPP_SPEC -#define CPP_SPEC "\ +#undef CPP_SUBTARGET_SPEC +#define CPP_SUBTARGET_SPEC "\ %{mvxsim:-DCPU=SIMALPHADUNIX} \ -%{!mvxsim: %{!mcpu*:-DCPU=21064} \ - %{mcpu=21064:-DCPU=21064} \ - %{mcpu=21164:-DCPU=21164}} \ -%{posix: -D_POSIX_SOURCE} \ -%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \ -%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}}" +%{!mvxsim: %{!mcpu*|mcpu=21064:-DCPU=21064} %{mcpu=21164:-DCPU=21164}} \ +%{posix: -D_POSIX_SOURCE}" #undef CPP_PREDEFINES #define CPP_PREDEFINES "\ -D__vxworks -D__alpha_vxworks -Asystem(vxworks) \ --Asystem(embedded) -D_LONGLONG -Acpu(alpha) -Amachine(alpha)" +-Asystem(embedded) -D_LONGLONG" /* VxWorks does all the library stuff itself. */ diff --git a/gcc/config/alpha/win-nt.h b/gcc/config/alpha/win-nt.h index 1233a80a68f3..339ed4465a39 100644 --- a/gcc/config/alpha/win-nt.h +++ b/gcc/config/alpha/win-nt.h @@ -29,10 +29,8 @@ Boston, MA 02111-1307, USA. */ /* Names to predefine in the preprocessor for this target machine. */ #undef CPP_PREDEFINES -#define CPP_PREDEFINES "-DWIN32 -D_WIN32 -DWINNT -D__STDC__=0 -DALMOST_STDC\ - -D_M_ALPHA -D_ALPHA_ -D__alpha -D__alpha__\ - -D_LONGLONG -D__unaligned= -D__stdcall= \ - -Asystem(winnt) -Acpu(alpha) -Amachine(alpha)" +#define CPP_PREDEFINES "-DWIN32 -D_WIN32 -DWINNT -D__STDC__=0 -DALMOST_STDC \ +-D_M_ALPHA -D_ALPHA_ -D_LONGLONG -D__unaligned= -D__stdcall= -Asystem(winnt)" #undef ASM_SPEC #undef ASM_FINAL_SPEC -- 2.47.2