* Re: PA patch for conversion.c testsuite failure
@ 2002-07-16 12:20 John David Anglin
2002-07-16 12:29 ` Mark Mitchell
0 siblings, 1 reply; 3+ messages in thread
From: John David Anglin @ 2002-07-16 12:20 UTC (permalink / raw)
To: gcc-patches; +Cc: sje, mark
Re: <http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00795.html>.
2002-07-16 Steve Ellcey <sje@cup.hp.com>
* gcc/config/pa/long_double.h (FIXUNS_TRUNCTFDI2_LIBCALL): New define.
(fixunstfdi_libfunc): Change to use FIXUNS_TRUNCTFDI2_LIBCALL.
* gcc/config/pa/quadlib.c (_U_Qfcnvfxt_quad_to_udbl): New function.
OK for main.
Mark, I believe this is safe although it is not a regression. Is this
OK for 3.1?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 3+ messages in thread
* PA patch for conversion.c testsuite failure
@ 2002-07-16 10:45 Steve Ellcey
0 siblings, 0 replies; 3+ messages in thread
From: Steve Ellcey @ 2002-07-16 10:45 UTC (permalink / raw)
To: gcc-patches
Here is a patch to fix the PA failure on conversion.c. It uses a signed
floating pt quad to fixed pt quad conversion to implement a long double to
unsigned long long conversion. Tested on HP-UX 11.* PA32 and PA64. I
did not test on HP-UX 10.20 but I did verify that the libc function I am
using (_U_Qfcnvfxt_quad_to_quad) exists on 10.20.
Steve Ellcey
sje@cup.hp.com
2002-07-16 Steve Ellcey <sje@cup.hp.com>
* gcc/config/pa/long_double.h (FIXUNS_TRUNCTFDI2_LIBCALL): New define.
(fixunstfdi_libfunc): Change to use FIXUNS_TRUNCTFDI2_LIBCALL.
* gcc/config/pa/quadlib.c (_U_Qfcnvfxt_quad_to_udbl): New function.
*** gcc.orig/gcc/config/pa/long_double.h Tue Jul 16 10:19:38 2002
--- gcc/gcc/config/pa/long_double.h Tue Jul 16 10:20:07 2002
*************** Boston, MA 02111-1307, USA. */
*** 42,47 ****
--- 42,48 ----
#define FIX_TRUNCTFSI2_LIBCALL \
(TARGET_64BIT ? "__U_Qfcnvfxt_quad_to_sgl" : "_U_Qfcnvfxt_quad_to_sgl")
#define FIXUNS_TRUNCTFSI2_LIBCALL "_U_Qfcnvfxt_quad_to_usgl"
+ #define FIXUNS_TRUNCTFDI2_LIBCALL "_U_Qfcnvfxt_quad_to_udbl"
#define FIX_TRUNCTFDI2_LIBCALL "_U_Qfcnvfxt_quad_to_dbl"
#define EQTF2_LIBCALL "_U_Qfeq"
#define NETF2_LIBCALL "_U_Qfne"
*************** Boston, MA 02111-1307, USA. */
*** 80,86 ****
fixtfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFSI2_LIBCALL);\
fixtfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFDI2_LIBCALL);\
fixunstfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIXUNS_TRUNCTFSI2_LIBCALL);\
! fixunstfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFDI2_LIBCALL); \
eqtf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EQTF2_LIBCALL); \
netf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, NETF2_LIBCALL); \
gttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, GTTF2_LIBCALL); \
--- 81,87 ----
fixtfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFSI2_LIBCALL);\
fixtfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFDI2_LIBCALL);\
fixunstfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIXUNS_TRUNCTFSI2_LIBCALL);\
! fixunstfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIXUNS_TRUNCTFDI2_LIBCALL);\
eqtf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EQTF2_LIBCALL); \
netf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, NETF2_LIBCALL); \
gttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, GTTF2_LIBCALL); \
*** gcc.orig/gcc/config/pa/quadlib.c Tue Jul 16 10:19:43 2002
--- gcc/gcc/config/pa/quadlib.c Tue Jul 16 10:22:58 2002
*************** long double _U_Qfneg (long double);
*** 42,47 ****
--- 42,48 ----
int __U_Qfcnvfxt_quad_to_sgl (long double);
#endif
unsigned int _U_Qfcnvfxt_quad_to_usgl(long double);
+ unsigned long long _U_Qfcnvfxt_quad_to_udbl(long double);
int
_U_Qfeq (long double a, long double b)
*************** _U_Qfcnvfxt_quad_to_usgl(long double a)
*** 113,116 ****
--- 114,133 ----
{
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 */
+ typedef union {
+ long long unsigned int u[2];
+ long double d[1];
+ } quad_type;
+
+ unsigned long long
+ _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];
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-07-16 19:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16 12:20 PA patch for conversion.c testsuite failure John David Anglin
2002-07-16 12:29 ` Mark Mitchell
-- strict thread matches above, loose matches on Subject: below --
2002-07-16 10:45 Steve Ellcey
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).