aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/ia64
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-09-09 03:35:31 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-09-09 03:35:31 +0000
commit9649812aae971f307ade9756b14a1c961fbc8905 (patch)
tree08059530952c2e25ede239ac8522a8acb81e71ee /gcc/config/ia64
parent11bf0eb0c73c713a4093fb456839c7dee7b8a722 (diff)
downloadgcc-9649812aae971f307ade9756b14a1c961fbc8905.zip
gcc-9649812aae971f307ade9756b14a1c961fbc8905.tar.gz
gcc-9649812aae971f307ade9756b14a1c961fbc8905.tar.bz2
langhooks-def.h (lhd_register_builtin_type): New function.
* langhooks-def.h (lhd_register_builtin_type): New function. (LANG_HOOKS_REGISTER_BUILTIN_TYPE): New macro. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Update. * langhooks.h (lang_hooks_for_types): Add register_builtin_type. * langhooks.c (lhd_register_builtin_type): New function. * c-common.h (c_register_builtin_type): Declare. * c-common.c (c_register_builtin_type): New function. * c-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to c_register_builtin_type. * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Remove __fpreg, __float80, and __float128 macros. * config/ia64/ia64.c (ia64_init_builtins): Create __fpreg, __float80, and __float128 types. * cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to c_register_builtin_type. * gcc.dg/ia64-types1.c: New test. * gcc.dg/ia64-types2.c: Likewise. From-SVN: r71227
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r--gcc/config/ia64/hpux.h6
-rw-r--r--gcc/config/ia64/ia64.c42
2 files changed, 42 insertions, 6 deletions
diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h
index 160ac45..b2b854b 100644
--- a/gcc/config/ia64/hpux.h
+++ b/gcc/config/ia64/hpux.h
@@ -26,9 +26,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
/* Target OS builtins. */
-/* -D__fpreg=long double is needed to compensate for
- the lack of __fpreg which is a primitive type in
- HP C but does not exist in GNU C. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_assert("system=hpux"); \
@@ -39,9 +36,6 @@ do { \
builtin_define("__IA64__"); \
builtin_define("_LONGLONG"); \
builtin_define("_UINT128_T"); \
- builtin_define("__fpreg=long double"); \
- builtin_define("__float80=long double"); \
- builtin_define("__float128=long double"); \
if (c_dialect_cxx () || !flag_iso) \
{ \
builtin_define("_HPUX_SOURCE"); \
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 4561345..a6e5ff6 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -7694,6 +7694,48 @@ ia64_init_builtins (void)
tree void_ftype_pdi
= build_function_type_list (void_type_node, pdi_type_node, NULL_TREE);
+ tree fpreg_type;
+
+ /* The __fpreg type. */
+ fpreg_type = make_node (REAL_TYPE);
+ /* ??? Once the IA64 back end supports both 80-bit and 128-bit
+ floating types, this type should have XFmode, not TFmode.
+ TYPE_PRECISION should be 80 bits, not 128. And, the back end
+ should know to load/save __fpreg variables using the ldf.fill and
+ stf.spill instructions. */
+ TYPE_PRECISION (fpreg_type) = 128;
+ layout_type (fpreg_type);
+ (*lang_hooks.types.register_builtin_type) (fpreg_type, "__fpreg");
+
+ /* The __float80 type. */
+ if (INTEL_EXTENDED_IEEE_FORMAT)
+ /* The __float80 type is a synonym for "long double". */
+ (*lang_hooks.types.register_builtin_type) (long_double_type_node,
+ "__float80");
+ else
+ {
+ tree float80_type = make_node (REAL_TYPE);
+ /* ??? Once the IA64 back end supports both 80-bit and 128-bit
+ floating types, this type should have XFmode, not TFmode.
+ TYPE_PRECISION should be 80 bits, not 128. */
+ TYPE_PRECISION (float80_type) = 128;
+ layout_type (float80_type);
+ (*lang_hooks.types.register_builtin_type) (float80_type, "__float80");
+ }
+
+ /* The __float128 type. */
+ if (INTEL_EXTENDED_IEEE_FORMAT)
+ {
+ tree float128_type = make_node (REAL_TYPE);
+ TYPE_PRECISION (float128_type) = 128;
+ layout_type (float128_type);
+ (*lang_hooks.types.register_builtin_type) (float128_type, "__float128");
+ }
+ else
+ /* This is a synonym for "long double". */
+ (*lang_hooks.types.register_builtin_type) (long_double_type_node,
+ "__float128");
+
#define def_builtin(name, type, code) \
builtin_function ((name), (type), (code), BUILT_IN_MD, NULL, NULL_TREE)