aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-03-06 19:51:52 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2000-03-06 19:51:52 +0100
commit4710d3eb4bb35cc3d3792bad8452c4863634dfdc (patch)
tree251c088773457d9c51cd7f6ce790406d85595dd8 /gcc/config
parent6149cebb5271f69e7e12bb5bf874fb7f5a149084 (diff)
downloadgcc-4710d3eb4bb35cc3d3792bad8452c4863634dfdc.zip
gcc-4710d3eb4bb35cc3d3792bad8452c4863634dfdc.tar.gz
gcc-4710d3eb4bb35cc3d3792bad8452c4863634dfdc.tar.bz2
real.h (MAX_LONG_DOUBLE_TYPE_SIZE): Define to LONG_DOUBLE_TYPE_SIZE if not defined.
* real.h (MAX_LONG_DOUBLE_TYPE_SIZE): Define to LONG_DOUBLE_TYPE_SIZE if not defined. Use MAX_LONG_DOUBLE_TYPE_SIZE instead of LONG_DOUBLE_TYPE_SIZE in preprocessor if clauses. * real.c: Likewise. * gengenrtl.c: Likewise. * print-rtl.c: Likewise. * rtl.c: Likewise. * config/sparc/sol2-sld-64.h (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128. * config/sparc/sol2.h (TARGET_DEFAULT): Likewise. * config/sparc/sp64-elf.h (TARGET_DEFAULT): Likewise. * config/sparc/linux64 (TARGET_DEFAULT): Likewise. (SUBTARGET_SWITCHES): Define. (CPP_ARCH32_SPEC): Define __LONG_DOUBLE_128__ if compiling with -mlong-double-128. (LONG_DOUBLE_TYPE_SIZE): Define depending on target_flags. (MAX_LONG_DOUBLE_TYPE_SIZE): Define. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define depending on CPP macros. (CC1_SPEC): Include -mlong-double-{64,128} as needed. * config/sparc/linux.h (SUBTARGET_SWITCHES): Define. (CPP_SUBTARGET_SPEC): Define __LONG_DOUBLE_128__ if compiling with -mlong-double-128. (LONG_DOUBLE_TYPE_SIZE): Define depending on target_flags. (MAX_LONG_DOUBLE_TYPE_SIZE): Define. (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Define depending on CPP macros. * config/sparc/sparc.h (MASK_LONG_DOUBLE_128, TARGET_LONG_DOUBLE_128): Define. * config/sparc/linux-aout.h (LONG_DOUBLE_TYPE_SIZE): Remove. * config/sparc/sparc.c (sparc_override_options): Disallow 64bit long double on TARGET_ARCH64. From-SVN: r32367
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/sparc/linux-aout.h7
-rw-r--r--gcc/config/sparc/linux.h27
-rw-r--r--gcc/config/sparc/linux64.h36
-rw-r--r--gcc/config/sparc/sol2-sld-64.h2
-rw-r--r--gcc/config/sparc/sol2.h2
-rw-r--r--gcc/config/sparc/sp64-elf.h2
-rw-r--r--gcc/config/sparc/sparc.c7
-rw-r--r--gcc/config/sparc/sparc.h4
8 files changed, 67 insertions, 20 deletions
diff --git a/gcc/config/sparc/linux-aout.h b/gcc/config/sparc/linux-aout.h
index d7c2303..74ddd92 100644
--- a/gcc/config/sparc/linux-aout.h
+++ b/gcc/config/sparc/linux-aout.h
@@ -101,13 +101,6 @@ Boston, MA 02111-1307, USA. */
#undef ASM_SPEC
#define ASM_SPEC \
"%{V} %{v:%{!V:-V}} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s %{fpic:-K PIC} %{fPIC:-K PIC}"
-
-#if 0
-/* Define for support of TFmode long double and REAL_ARITHMETIC.
- Sparc ABI says that long double is 4 words. GNU/Linux does not support
- long double yet. */
-#define LONG_DOUBLE_TYPE_SIZE 128
-#endif
/* No weird SPARC variants on Linux */
#undef TARGET_LIVE_G0
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index fba4a9d..630ca9c 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -87,6 +87,11 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (sparc GNU/Linux with ELF)");
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+{"long-double-64", -MASK_LONG_DOUBLE_128, "Use 64 bit long doubles" }, \
+{"long-double-128", MASK_LONG_DOUBLE_128, "Use 128 bit long doubles" },
+
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
@@ -107,10 +112,12 @@ Boston, MA 02111-1307, USA. */
#undef CPP_SUBTARGET_SPEC
#ifdef USE_GNULIBC_1
#define CPP_SUBTARGET_SPEC \
-"%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
+"%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} \
+%{mlong-double-128:-D__LONG_DOUBLE_128__}"
#else
#define CPP_SUBTARGET_SPEC \
-"%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+"%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} \
+%{pthread:-D_REENTRANT} %{mlong-double-128:-D__LONG_DOUBLE_128__}"
#endif
#undef LIB_SPEC
@@ -231,11 +238,19 @@ do { \
sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
-#if 0
/* Define for support of TFmode long double and REAL_ARITHMETIC.
- Sparc ABI says that long double is 4 words. GNU/Linux does not support
- long double yet. */
-#define LONG_DOUBLE_TYPE_SIZE 128
+ Sparc ABI says that long double is 4 words. */
+#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
+
+/* Constant which presents upper bound of the above value. */
+#define MAX_LONG_DOUBLE_TYPE_SIZE 128
+
+/* Define this to set long double type size to use in libgcc2.c, which can
+ not depend on target_flags. */
+#ifdef __LONG_DOUBLE_128__
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
+#else
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
#endif
/* No weird SPARC variants on Linux */
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 4426017..8d4672f 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -41,7 +41,7 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
- + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU)
+ + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_LONG_DOUBLE_128)
#endif
/* Output at beginning of assembler file. */
@@ -56,6 +56,15 @@ Boston, MA 02111-1307, USA. */
#undef ASM_CPU_DEFAULT_SPEC
#define ASM_CPU_DEFAULT_SPEC "-Av9a"
+#ifdef SPARC_BI_ARCH
+
+#undef CPP_ARCH32_SPEC
+#define CPP_ARCH32_SPEC "%{mlong-double-128:-D__LONG_DOUBLE_128__} \
+-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)"
+
+#endif
+
/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
@@ -134,6 +143,11 @@ Boston, MA 02111-1307, USA. */
#undef SPARC_DEFAULT_CMODEL
#define SPARC_DEFAULT_CMODEL CM_MEDLOW
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+{"long-double-64", -MASK_LONG_DOUBLE_128, "Use 64 bit long doubles" }, \
+{"long-double-128", MASK_LONG_DOUBLE_128, "Use 128 bit long doubles" },
+
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
@@ -142,8 +156,22 @@ Boston, MA 02111-1307, USA. */
#undef MAX_WCHAR_TYPE_SIZE
+/* Define for support of TFmode long double and REAL_ARITHMETIC.
+ Sparc ABI says that long double is 4 words. */
#undef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE 128
+#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
+
+/* Constant which presents upper bound of the above value. */
+#undef MAX_LONG_DOUBLE_TYPE_SIZE
+#define MAX_LONG_DOUBLE_TYPE_SIZE 128
+
+/* Define this to set long double type size to use in libgcc2.c, which can
+ not depend on target_flags. */
+#if defined(__arch64__) || defined(__LONG_DOUBLE_128__)
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
+#else
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
+#endif
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -D_LONGLONG -D__sparc__ -Dlinux -Asystem(unix) -Asystem(posix)"
@@ -227,7 +255,7 @@ Boston, MA 02111-1307, USA. */
%{mcypress:-mcpu=cypress} \
%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
-%{m64:-mptr64 -mstack-bias \
+%{m64:-mptr64 -mstack-bias -mlong-double-128 \
%{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=ultrasparc}}}}}}} \
%{!mno-vis:%{!mcpu=v9:-mvis}}} \
%{!m64:%{g*:%{!gs*:%{!gd*:%{!gx*:%{!gc*:-gstabs+}}}}}} \
@@ -238,7 +266,7 @@ Boston, MA 02111-1307, USA. */
%{mcypress:-mcpu=cypress} \
%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
-%{m32:-mptr32 -mno-stack-bias \
+%{m32:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
%{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=cypress}}}}}}} \
%{g*:%{!gs*:%{!gd*:%{!gx*:%{!gc*:-gstabs+}}}}}} \
%{!m32:%{!mcpu*:-mcpu=ultrasparc}} \
diff --git a/gcc/config/sparc/sol2-sld-64.h b/gcc/config/sparc/sol2-sld-64.h
index 275a89f..cc441d5 100644
--- a/gcc/config/sparc/sol2-sld-64.h
+++ b/gcc/config/sparc/sol2-sld-64.h
@@ -24,7 +24,7 @@
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ + \
- MASK_STACK_BIAS + MASK_EPILOGUE + MASK_FPU)
+ MASK_STACK_BIAS + MASK_EPILOGUE + MASK_FPU + MASK_LONG_DOUBLE_128)
#endif
/* The default code model. */
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index f15807f..000fbc6 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -213,7 +213,7 @@ Boston, MA 02111-1307, USA. */
/* Solaris allows 64 bit out and global registers in 32 bit mode.
sparc_override_options will disable V8+ if not generating V9 code. */
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_EPILOGUE + MASK_FPU + MASK_V8PLUS)
+#define TARGET_DEFAULT (MASK_EPILOGUE + MASK_FPU + MASK_V8PLUS + MASK_LONG_DOUBLE_128)
#if TARGET_ARCH32
/* Override MACHINE_STATE_{SAVE,RESTORE} because we have special
diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h
index 49bd01a..b699147 100644
--- a/gcc/config/sparc/sp64-elf.h
+++ b/gcc/config/sparc/sp64-elf.h
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_V9 + MASK_PTR64 + MASK_64BIT + MASK_HARD_QUAD \
- + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_STACK_BIAS)
+ + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_STACK_BIAS + MASK_LONG_DOUBLE_128)
#undef SPARC_DEFAULT_CMODEL
#define SPARC_DEFAULT_CMODEL CM_EMBMEDANY
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index d6dbb97..0b9cd18 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -250,6 +250,13 @@ sparc_override_options ()
target_flags &= ~MASK_PTR64;
}
+ /* We force all 64bit archs to use 128 bit long double */
+ if (TARGET_64BIT && ! TARGET_LONG_DOUBLE_128)
+ {
+ error ("-mlong-double-64 not allowed with -m64");
+ target_flags |= MASK_LONG_DOUBLE_128;
+ }
+
/* Code model selection. */
sparc_cmodel = SPARC_DEFAULT_CMODEL;
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index b720bf8..a099796 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -555,6 +555,10 @@ extern int target_flags;
#define MASK_FASTER_STRUCTS 0x4000000
#define TARGET_FASTER_STRUCTS (target_flags & MASK_FASTER_STRUCTS)
+/* Use IEEE quad long double. */
+#define MASK_LONG_DOUBLE_128 0x8000000
+#define TARGET_LONG_DOUBLE_128 (target_flags & MASK_LONG_DOUBLE_128)
+
/* TARGET_HARD_MUL: Use hardware multiply instructions but not %y.
TARGET_HARD_MUL32: Use hardware multiply instructions with rd %y
to get high 32 bits. False in V8+ or V9 because multiply stores