re PR target/25166 (FAIL: gcc.c-torture/execute/conversion.c compilation)

PR target/25166
	* pa/pa.c (pa_hpux_init_libfuncs): Add _U_Qfcnvxf_usgl_to_quad and
	_U_Qfcnvxf_udbl_to_quad to set of initialized libfuncs.
	* pa/quadlib.c (_U_Qfcnvxf_usgl_to_quad, _U_Qfcnvxf_udbl_to_quad): New
	functions.

From-SVN: r108039
This commit is contained in:
John David Anglin 2005-12-05 03:23:37 +00:00 committed by John David Anglin
parent 56540d20c2
commit 7db0cc7eb2
3 changed files with 34 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2005-12-04 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/25166
* pa/pa.c (pa_hpux_init_libfuncs): Add _U_Qfcnvxf_usgl_to_quad and
_U_Qfcnvxf_udbl_to_quad to set of initialized libfuncs.
* pa/quadlib.c (_U_Qfcnvxf_usgl_to_quad, _U_Qfcnvxf_udbl_to_quad): New
functions.
2005-12-04 Joseph S. Myers <joseph@codesourcery.com>
* c-typeck.c (null_pointer_constant_p): New function.

View file

@ -5350,6 +5350,8 @@ pa_hpux_init_libfuncs (void)
set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad");
set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad");
set_conv_libfunc (ufloat_optab, TFmode, SImode, "_U_Qfcnvxf_usgl_to_quad");
set_conv_libfunc (ufloat_optab, TFmode, DImode, "_U_Qfcnvxf_udbl_to_quad");
}
#endif

View file

@ -64,7 +64,9 @@ long double _U_Qfneg (long double);
int __U_Qfcnvfxt_quad_to_sgl (long double);
#endif
unsigned int _U_Qfcnvfxt_quad_to_usgl(long double);
long double _U_Qfcnvxf_usgl_to_quad (unsigned int);
unsigned long long _U_Qfcnvfxt_quad_to_udbl(long double);
long double _U_Qfcnvxf_udbl_to_quad (unsigned long long);
int
_U_Qfeq (long double a, long double b)
@ -186,27 +188,42 @@ __U_Qfcnvfxt_quad_to_sgl (long double a)
}
#endif
/* HP only has signed conversion in library, so need to synthesize an
unsigned version */
/* HP only has signed conversion in the C library, so need to synthesize
unsigned versions. */
unsigned int
_U_Qfcnvfxt_quad_to_usgl(long double a)
_U_Qfcnvfxt_quad_to_usgl (long double a)
{
extern long long _U_Qfcnvfxt_quad_to_dbl (long double a);
return (unsigned int) _U_Qfcnvfxt_quad_to_dbl (a);
}
/* HP only has signed conversion in library, so need to synthesize an
unsigned version */
long double
_U_Qfcnvxf_usgl_to_quad (unsigned int a)
{
extern long double _U_Qfcnvxf_dbl_to_quad (long long);
return _U_Qfcnvxf_dbl_to_quad ((long long) a);
}
typedef union {
long long unsigned int u[2];
unsigned long long u[2];
long double d[1];
} quad_type;
unsigned long long
_U_Qfcnvfxt_quad_to_udbl(long double a)
_U_Qfcnvfxt_quad_to_udbl (long double a)
{
extern quad_type _U_Qfcnvfxt_quad_to_quad (long double a);
quad_type u;
u = _U_Qfcnvfxt_quad_to_quad(a);
return u.u[1];
}
long double
_U_Qfcnvxf_udbl_to_quad (unsigned long long a)
{
extern long double _U_Qfcnvxf_quad_to_quad (quad_type a);
quad_type u;
u.u[0] = 0;
u.u[1] = a;
return _U_Qfcnvxf_quad_to_quad (u);
}