* Always support float128 on ia64 (PR target/77586)
@ 2016-10-04 16:47 Joseph Myers
2016-10-10 22:40 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2016-10-04 16:47 UTC (permalink / raw)
To: gcc-patches; +Cc: nickc, wilson, douglas.b.rupp, tgingold
Bug 77586, and previously
<https://gcc.gnu.org/ml/gcc-bugs/2016-08/msg03233.html>, reports
ia64-elf failing to build because of float128_type_node being NULL,
but being used by the back end for __float128.
The global float128_type_node is only available conditionally, if
target hooks indicate TFmode is not only available as a scalar mode
and of the right format, but also supported in libgcc. The back-end
support, however, expects the type always to be available for
__float128 even if the libgcc support is missing.
Although a target-specific node could be restored in the case where
libgcc support is missing, it seems better to address the missing
libgcc support. Thus, this patch enables TFmode soft-fp in libgcc
globally for all ia64 targets. Support for XFmode in libgcc (that is,
for libgcc2.c XFmode functions, not soft-fp) is also enabled for all
ia64 targets so that ia64 no longer needs to define the
TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P hook.
I've confirmed that ia64-elf builds cc1 with this patch and it passes
-fself-test. I have not otherwise tested the patch. It's plausible
that ia64-elf and ia64-freebsd might work as-is, but ia64-vms probably
needs further changes, by someone familiar with VMS shared libraries,
to implement an equivalent of ia64/t-softfp-compat in that case
(avoiding conflicts between __divtf3 from soft-fp and the old alias
for __divxf3).
gcc:
2016-10-04 Joseph Myers <joseph@codesourcery.com>
PR target/77586
* config/ia64/ia64.c (ia64_libgcc_floating_mode_supported_p)
(TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Remove.
* config/ia64/elf.h (IA64_NO_LIBGCC_TFMODE): Likewise.
* config/ia64/freebsd.h (IA64_NO_LIBGCC_TFMODE): Likewise.
* config/ia64/vms.h (IA64_NO_LIBGCC_XFMODE)
(IA64_NO_LIBGCC_TFMODE): Likewise.
libgcc:
2016-10-04 Joseph Myers <joseph@codesourcery.com>
PR target/77586
* config.host (ia64*-*-elf*, ia64*-*-freebsd*, ia64-hp-*vms*): Use
soft-fp.
Index: gcc/config/ia64/elf.h
===================================================================
--- gcc/config/ia64/elf.h (revision 240740)
+++ gcc/config/ia64/elf.h (working copy)
@@ -65,6 +65,4 @@
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
crti.o%s crtbegin.o%s"
-#define IA64_NO_LIBGCC_TFMODE
-
/* End of elf.h */
Index: gcc/config/ia64/freebsd.h
===================================================================
--- gcc/config/ia64/freebsd.h (revision 240740)
+++ gcc/config/ia64/freebsd.h (working copy)
@@ -50,5 +50,3 @@
#define TARGET_ELF 1
#define JMP_BUF_SIZE 76
-
-#define IA64_NO_LIBGCC_TFMODE
Index: gcc/config/ia64/ia64.c
===================================================================
--- gcc/config/ia64/ia64.c (revision 240740)
+++ gcc/config/ia64/ia64.c (working copy)
@@ -311,7 +311,6 @@
static tree ia64_gimplify_va_arg (tree, tree, gimple_seq *, gimple_seq *);
static bool ia64_scalar_mode_supported_p (machine_mode mode);
static bool ia64_vector_mode_supported_p (machine_mode mode);
-static bool ia64_libgcc_floating_mode_supported_p (machine_mode mode);
static bool ia64_legitimate_constant_p (machine_mode, rtx);
static bool ia64_legitimate_address_p (machine_mode, rtx, bool);
static bool ia64_cannot_force_const_mem (machine_mode, rtx);
@@ -595,10 +594,6 @@
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P ia64_vector_mode_supported_p
-#undef TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P
-#define TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P \
- ia64_libgcc_floating_mode_supported_p
-
#undef TARGET_LEGITIMATE_CONSTANT_P
#define TARGET_LEGITIMATE_CONSTANT_P ia64_legitimate_constant_p
#undef TARGET_LEGITIMATE_ADDRESS_P
@@ -11008,36 +11003,6 @@
}
}
-/* Implement TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P. */
-
-static bool
-ia64_libgcc_floating_mode_supported_p (machine_mode mode)
-{
- switch (mode)
- {
- case SFmode:
- case DFmode:
- return true;
-
- case XFmode:
-#ifdef IA64_NO_LIBGCC_XFMODE
- return false;
-#else
- return true;
-#endif
-
- case TFmode:
-#ifdef IA64_NO_LIBGCC_TFMODE
- return false;
-#else
- return true;
-#endif
-
- default:
- return false;
- }
-}
-
/* Implement the FUNCTION_PROFILER macro. */
void
Index: gcc/config/ia64/vms.h
===================================================================
--- gcc/config/ia64/vms.h (revision 240740)
+++ gcc/config/ia64/vms.h (working copy)
@@ -154,6 +154,3 @@
/* Default values for _CRTL_VER and _VMS_VER. */
#define VMS_DEFAULT_CRTL_VER 80300000
#define VMS_DEFAULT_VMS_VER 80300000
-
-#define IA64_NO_LIBGCC_XFMODE
-#define IA64_NO_LIBGCC_TFMODE
Index: libgcc/config.host
===================================================================
--- libgcc/config.host (revision 240740)
+++ libgcc/config.host (working copy)
@@ -746,11 +746,11 @@
;;
ia64*-*-elf*)
extra_parts="$extra_parts crtbeginS.o crtendS.o crtfastmath.o"
- tmake_file="ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm"
+ tmake_file="ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat"
;;
ia64*-*-freebsd*)
extra_parts="$extra_parts crtfastmath.o"
- tmake_file="$tmake_file ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm"
+ tmake_file="$tmake_file ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat"
;;
ia64*-*-linux*)
# Don't use crtbeginT.o from *-*-linux* default.
@@ -765,7 +765,7 @@
tmake_file="ia64/t-ia64 ia64/t-ia64-elf ia64/t-hpux t-slibgcc ia64/t-slibgcc-hpux t-slibgcc-hpux"
;;
ia64-hp-*vms*)
- tmake_file="$tmake_file ia64/t-ia64 ia64/t-eh-ia64 ia64/t-vms t-slibgcc-vms"
+ tmake_file="$tmake_file ia64/t-ia64 ia64/t-eh-ia64 ia64/t-vms t-slibgcc-vms t-softfp-tf ia64/t-softfp t-softfp"
extra_parts="$extra_parts crtinitS.o"
md_unwind_header=ia64/vms-unwind.h
;;
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Always support float128 on ia64 (PR target/77586)
2016-10-04 16:47 Always support float128 on ia64 (PR target/77586) Joseph Myers
@ 2016-10-10 22:40 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2016-10-10 22:40 UTC (permalink / raw)
To: Joseph Myers, gcc-patches; +Cc: nickc, wilson, douglas.b.rupp, tgingold
On 10/04/2016 10:46 AM, Joseph Myers wrote:
> Bug 77586, and previously
> <https://gcc.gnu.org/ml/gcc-bugs/2016-08/msg03233.html>, reports
> ia64-elf failing to build because of float128_type_node being NULL,
> but being used by the back end for __float128.
>
> The global float128_type_node is only available conditionally, if
> target hooks indicate TFmode is not only available as a scalar mode
> and of the right format, but also supported in libgcc. The back-end
> support, however, expects the type always to be available for
> __float128 even if the libgcc support is missing.
>
> Although a target-specific node could be restored in the case where
> libgcc support is missing, it seems better to address the missing
> libgcc support. Thus, this patch enables TFmode soft-fp in libgcc
> globally for all ia64 targets. Support for XFmode in libgcc (that is,
> for libgcc2.c XFmode functions, not soft-fp) is also enabled for all
> ia64 targets so that ia64 no longer needs to define the
> TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P hook.
>
> I've confirmed that ia64-elf builds cc1 with this patch and it passes
> -fself-test. I have not otherwise tested the patch. It's plausible
> that ia64-elf and ia64-freebsd might work as-is, but ia64-vms probably
> needs further changes, by someone familiar with VMS shared libraries,
> to implement an equivalent of ia64/t-softfp-compat in that case
> (avoiding conflicts between __divtf3 from soft-fp and the old alias
> for __divxf3).
>
> gcc:
> 2016-10-04 Joseph Myers <joseph@codesourcery.com>
>
> PR target/77586
> * config/ia64/ia64.c (ia64_libgcc_floating_mode_supported_p)
> (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Remove.
> * config/ia64/elf.h (IA64_NO_LIBGCC_TFMODE): Likewise.
> * config/ia64/freebsd.h (IA64_NO_LIBGCC_TFMODE): Likewise.
> * config/ia64/vms.h (IA64_NO_LIBGCC_XFMODE)
> (IA64_NO_LIBGCC_TFMODE): Likewise.
>
> libgcc:
> 2016-10-04 Joseph Myers <joseph@codesourcery.com>
>
> PR target/77586
> * config.host (ia64*-*-elf*, ia64*-*-freebsd*, ia64-hp-*vms*): Use
> soft-fp.
Given it's a clear step forward and the inability to test the least
common platform (vms), I'm OK with this patch.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-10 22:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 16:47 Always support float128 on ia64 (PR target/77586) Joseph Myers
2016-10-10 22:40 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).