From 6c52fa55a62076066e792d5d1dc7811fbfe162e3 Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 14 May 2001 15:36:17 +0000 Subject: [PATCH] * i386.h (TARGET_64BIT): Define to constant if !TARGET_BI_ARCH (CPP_CPU??_SIZE_TYPE): New. (CPP_CPU??_SPEC, CPP_CPUCOMMON_SPEC): Break out from... (CPP_CPU_SPEC): ... here; support choosing of CPU. (EXTRA_SPECS): Add cpp_cpu??, cpp_cpu??sizet, cpp_cpucommon. (MAX_LONG_TYPE_SIZE, MAX_BITS_PER_WORD): Define to 32 for 32bit-only compiler. * i386.c (override_options): Add sorry about not suported modes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42070 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 11 +++++++++ gcc/config/i386/i386.c | 3 +++ gcc/config/i386/i386.h | 62 ++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 69 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f1b34c..edc4849 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +Mon May 14 17:34:48 CEST 2001 Jan Hubicka + + * i386.h (TARGET_64BIT): Define to constant if !TARGET_BI_ARCH + (CPP_CPU??_SIZE_TYPE): New. + (CPP_CPU??_SPEC, CPP_CPUCOMMON_SPEC): Break out from... + (CPP_CPU_SPEC): ... here; support choosing of CPU. + (EXTRA_SPECS): Add cpp_cpu??, cpp_cpu??sizet, cpp_cpucommon. + (MAX_LONG_TYPE_SIZE, MAX_BITS_PER_WORD): Define to 32 for 32bit-only + compiler. + * i386.c (override_options): Add sorry about not suported modes. + Mon May 14 08:56:47 2001 Jeffrey A Law (law@cygnus.com) * config/pa/som.h (NM_FLAGS): Remove. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a18e890..33b00b1 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -694,6 +694,9 @@ override_options () ix86_cmodel_string, TARGET_64BIT ? "64" : "32"); if (ix86_cmodel == CM_LARGE) sorry ("Code model `large' not supported yet."); + if ((TARGET_64BIT != 0) != ((target_flags & MASK_64BIT) != 0)) + sorry ("%i-bit mode not compiled in.", + (target_flags & MASK_64BIT) ? 64 : 32); if (ix86_arch_string != 0) { diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 0c0a7cd..27ac641 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -181,7 +181,15 @@ extern int target_flags; #define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG) /* 64bit Sledgehammer mode */ +#ifdef TARGET_BI_ARCH #define TARGET_64BIT (target_flags & MASK_64BIT) +#else +#ifdef TARGET_64BIT_DEFAULT +#define TARGET_64BIT 1 +#else +#define TARGET_64BIT 0 +#endif +#endif #define TARGET_386 (ix86_cpu == PROCESSOR_I386) #define TARGET_486 (ix86_cpu == PROCESSOR_I486) @@ -462,10 +470,24 @@ extern int ix86_arch; #endif #endif /* CPP_CPU_DEFAULT_SPEC */ -#ifndef CPP_CPU_SPEC -#define CPP_CPU_SPEC "\ --Acpu=i386 -Amachine=i386 \ -%{!ansi:%{!std=c*:%{!std=i*:-Di386}}} -D__i386 -D__i386__ \ +#ifdef NO_BUILTIN_SIZE_TYPE +#define CPP_CPU32_SIZE_TYPE_SPEC \ + " -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int" +#define CPP_CPU64_SIZE_TYPE_SPEC \ + " -D__SIZE_TYPE__=unsigned\\ long\\ int -D__PTRDIFF_TYPE__=long\\ int" +#else +#define CPP_CPU32_SIZE_TYPE_SPEC "" +#define CPP_CPU64_SIZE_TYPE_SPEC "" +#endif + +#define CPP_CPU32_SPEC \ + "-Acpu=i386 -Amachine=i386 %{!ansi:%{!std=c*:%{!std=i*:-Di386}}} -D__i386 \ +-D__i386__ %(cpp_cpu32sizet)" + +#define CPP_CPU64_SPEC \ + "-Acpu=x86_64 -Amachine=x86_64 -D__x86_64 -D__x86_64__ %(cpp_cpu64sizet)" + +#define CPP_CPUCOMMON_SPEC "\ %{march=i386:%{!mcpu*:-D__tune_i386__ }}\ %{march=i486:-D__i486 -D__i486__ %{!mcpu*:-D__tune_i486__ }}\ %{march=pentium|march=i586:-D__i586 -D__i586__ -D__pentium -D__pentium__ \ @@ -475,7 +497,7 @@ extern int ix86_arch; %{!mcpu*:-D__tune_i686__ -D__tune_pentiumpro__ }}\ %{march=k6:-D__k6 -D__k6__ %{!mcpu*:-D__tune_k6__ }}\ %{march=athlon:-D__athlon -D__athlon__ %{!mcpu*:-D__tune_athlon__ }}\ -%{mpentium4=pentium4:-D__pentium4 -D__pentium4__ %{!mcpu*:-D__tune_pentium4__ }}\ +%{march=pentium4:-D__pentium4 -D__pentium4__ %{!mcpu*:-D__tune_pentium4__ }}\ %{m386|mcpu=i386:-D__tune_i386__ }\ %{m486|mcpu=i486:-D__tune_i486__ }\ %{mpentium|mcpu=pentium|mcpu=i586:-D__tune_i586__ -D__tune_pentium__ }\ @@ -484,6 +506,21 @@ extern int ix86_arch; %{mcpu=athlon:-D__tune_athlon__ }\ %{mcpu=pentium4:-D__tune_pentium4__ }\ %{!march*:%{!mcpu*:%{!m386:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}}}" + +#ifndef CPP_CPU_SPEC +#ifdef TARGET_BI_ARCH +#ifdef TARGET_64BIT_DEFAULT +#define CPP_CPU_SPEC "%{m32:%(cpp_cpu32)}%{!m32:%(cpp_cpu64)} %(cpp_cpucommon)" +#else +#define CPP_CPU_SPEC "%{m64:%(cpp_cpu64)}%{!m64:%(cpp_cpu32)} %(cpp_cpucommon)" +#endif +#else +#ifdef TARGET_64BIT_DEFAULT +#define CPP_CPU_SPEC "%(cpp_cpu64) %(cpp_cpucommon)" +#else +#define CPP_CPU_SPEC "%(cpp_cpu32) %(cpp_cpucommon)" +#endif +#endif #endif #ifndef CC1_SPEC @@ -507,6 +544,11 @@ extern int ix86_arch; #define EXTRA_SPECS \ { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \ { "cpp_cpu", CPP_CPU_SPEC }, \ + { "cpp_cpu32", CPP_CPU32_SPEC }, \ + { "cpp_cpu64", CPP_CPU64_SPEC }, \ + { "cpp_cpu32sizet", CPP_CPU32_SIZE_TYPE_SPEC }, \ + { "cpp_cpu64sizet", CPP_CPU64_SIZE_TYPE_SPEC }, \ + { "cpp_cpucommon", CPP_CPUCOMMON_SPEC }, \ { "cc1_cpu", CC1_CPU_SPEC }, \ SUBTARGET_EXTRA_SPECS @@ -535,10 +577,17 @@ extern int ix86_arch; #define FLOAT_TYPE_SIZE 32 #define LONG_TYPE_SIZE BITS_PER_WORD #define MAX_WCHAR_TYPE_SIZE 32 -#define MAX_LONG_TYPE_SIZE 64 #define DOUBLE_TYPE_SIZE 64 #define LONG_LONG_TYPE_SIZE 64 +#if defined (TARGET_BI_ARCH) || defined (TARGET_64BIT_DEFAULT) +#define MAX_BITS_PER_WORD 64 +#define MAX_LONG_TYPE_SIZE 64 +#else +#define MAX_BITS_PER_WORD 32 +#define MAX_LONG_TYPE_SIZE 32 +#endif + /* Define if you don't want extended real, but do want to use the software floating point emulator for REAL_ARITHMETIC and decimal <-> binary conversion. */ @@ -566,7 +615,6 @@ extern int ix86_arch; if using 16-bit ints on a 80386, this would still be 32. But on a machine with 16-bit registers, this would be 16. */ #define BITS_PER_WORD (TARGET_64BIT ? 64 : 32) -#define MAX_BITS_PER_WORD 64 /* Width of a word, in units (bytes). */ #define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4) -- 2.7.4