re PR target/15383 (__float128 function name is used for long double)

2004-05-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/15383
	* config/ia64/ia64.c (ia64_expand_compare): Don't check
	TARGET_HPUX for TFmode compare. Abort if op0 is in TFmode and
	cmptf_libfunc isn't set.
	(ia64_init_libfuncs): Rename TFmode libfuncs using the HPUX
	conventions.
	(ia64_sysv4_init_libfuncs): New.

	* config/ia64/sysv4.h (TARGET_INIT_LIBFUNCS): New. Defined as
	ia64_sysv4_init_libfuncs.

From-SVN: r82047
This commit is contained in:
H.J. Lu 2004-05-20 02:15:45 +00:00 committed by H.J. Lu
parent a43b9dbe90
commit 6bc709c1c5
3 changed files with 66 additions and 23 deletions

View File

@ -1,3 +1,16 @@
2004-05-19 H.J. Lu <hongjiu.lu@intel.com>
PR target/15383
* config/ia64/ia64.c (ia64_expand_compare): Don't check
TARGET_HPUX for TFmode compare. Abort if op0 is in TFmode and
cmptf_libfunc isn't set.
(ia64_init_libfuncs): Rename TFmode libfuncs using the HPUX
conventions.
(ia64_sysv4_init_libfuncs): New.
* config/ia64/sysv4.h (TARGET_INIT_LIBFUNCS): New. Defined as
ia64_sysv4_init_libfuncs.
2004-05-20 Falk Hueffner <falk@debian.org>
PR other/15526

View File

@ -265,6 +265,8 @@ static void ia64_init_libfuncs (void)
ATTRIBUTE_UNUSED;
static void ia64_hpux_init_libfuncs (void)
ATTRIBUTE_UNUSED;
static void ia64_sysv4_init_libfuncs (void)
ATTRIBUTE_UNUSED;
static void ia64_vms_init_libfuncs (void)
ATTRIBUTE_UNUSED;
@ -1671,7 +1673,7 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode)
/* HPUX TFmode compare requires a library call to _U_Qfcmp, which takes a
magic number as its third argument, that indicates what to do.
The return value is an integer to be compared against zero. */
else if (TARGET_HPUX && GET_MODE (op0) == TFmode)
else if (GET_MODE (op0) == TFmode)
{
enum qfcmp_magic {
QCMP_INV = 1, /* Raise FP_INVALID on SNaN as a side effect. */
@ -1682,7 +1684,7 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode)
} magic;
enum rtx_code ncode;
rtx ret, insns;
if (GET_MODE (op1) != TFmode)
if (!cmptf_libfunc || GET_MODE (op1) != TFmode)
abort ();
switch (code)
{
@ -8743,7 +8745,9 @@ ia64_hpux_file_end (void)
}
/* Set SImode div/mod functions, init_integral_libfuncs only initializes
modes of word_mode and larger. */
modes of word_mode and larger. Rename the TFmode libfuncs using the
HPUX conventions. __divtf3 is used for XFmode. We need to keep it for
backward compatibility. */
static void
ia64_init_libfuncs (void)
@ -8752,35 +8756,13 @@ ia64_init_libfuncs (void)
set_optab_libfunc (udiv_optab, SImode, "__udivsi3");
set_optab_libfunc (smod_optab, SImode, "__modsi3");
set_optab_libfunc (umod_optab, SImode, "__umodsi3");
}
/* Rename all the TFmode libfuncs using the HPUX conventions. */
static void
ia64_hpux_init_libfuncs (void)
{
ia64_init_libfuncs ();
set_optab_libfunc (add_optab, TFmode, "_U_Qfadd");
set_optab_libfunc (sub_optab, TFmode, "_U_Qfsub");
set_optab_libfunc (smul_optab, TFmode, "_U_Qfmpy");
set_optab_libfunc (sdiv_optab, TFmode, "_U_Qfdiv");
set_optab_libfunc (smin_optab, TFmode, "_U_Qfmin");
set_optab_libfunc (smax_optab, TFmode, "_U_Qfmax");
set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs");
set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg");
/* ia64_expand_compare uses this. */
cmptf_libfunc = init_one_libfunc ("_U_Qfcmp");
/* These should never be used. */
set_optab_libfunc (eq_optab, TFmode, 0);
set_optab_libfunc (ne_optab, TFmode, 0);
set_optab_libfunc (gt_optab, TFmode, 0);
set_optab_libfunc (ge_optab, TFmode, 0);
set_optab_libfunc (lt_optab, TFmode, 0);
set_optab_libfunc (le_optab, TFmode, 0);
set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad");
set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad");
set_conv_libfunc (sext_optab, TFmode, XFmode, "_U_Qfcnvff_f80_to_quad");
@ -8797,6 +8779,29 @@ ia64_hpux_init_libfuncs (void)
set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad");
}
/* Rename all the TFmode libfuncs using the HPUX conventions. */
static void
ia64_hpux_init_libfuncs (void)
{
ia64_init_libfuncs ();
set_optab_libfunc (smin_optab, TFmode, "_U_Qfmin");
set_optab_libfunc (smax_optab, TFmode, "_U_Qfmax");
set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs");
/* ia64_expand_compare uses this. */
cmptf_libfunc = init_one_libfunc ("_U_Qfcmp");
/* These should never be used. */
set_optab_libfunc (eq_optab, TFmode, 0);
set_optab_libfunc (ne_optab, TFmode, 0);
set_optab_libfunc (gt_optab, TFmode, 0);
set_optab_libfunc (ge_optab, TFmode, 0);
set_optab_libfunc (lt_optab, TFmode, 0);
set_optab_libfunc (le_optab, TFmode, 0);
}
/* Rename the division and modulus functions in VMS. */
static void
@ -8811,6 +8816,28 @@ ia64_vms_init_libfuncs (void)
set_optab_libfunc (umod_optab, SImode, "OTS$REM_UI");
set_optab_libfunc (umod_optab, DImode, "OTS$REM_UL");
}
/* Rename the TFmode libfuncs available from soft-fp in glibc using
the HPUX conventions. */
static void
ia64_sysv4_init_libfuncs (void)
{
ia64_init_libfuncs ();
/* These functions are not part of the HPUX TFmode interface. We
use them instead of _U_Qfcmp, which doesn't work the way we
expect. */
set_optab_libfunc (eq_optab, TFmode, "_U_Qfeq");
set_optab_libfunc (ne_optab, TFmode, "_U_Qfne");
set_optab_libfunc (gt_optab, TFmode, "_U_Qfgt");
set_optab_libfunc (ge_optab, TFmode, "_U_Qfge");
set_optab_libfunc (lt_optab, TFmode, "_U_Qflt");
set_optab_libfunc (le_optab, TFmode, "_U_Qfle");
/* We leave out _U_Qfmin, _U_Qfmax and _U_Qfabs since soft-fp in
glibc doesn't have them. */
}
/* Switch to the section to which we should output X. The only thing
special we do here is to honor small data. */

View File

@ -1,5 +1,8 @@
/* Override definitions in elfos.h/svr4.h to be correct for IA64. */
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS ia64_sysv4_init_libfuncs
/* We want DWARF2 as specified by the IA64 ABI. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG