From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8039 invoked by alias); 7 Jun 2013 20:09:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 8028 invoked by uid 89); 7 Jun 2013 20:09:53 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 07 Jun 2013 20:09:51 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id r57K9lOQ002857; Fri, 7 Jun 2013 22:09:47 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id r57K9kiX009408; Fri, 7 Jun 2013 22:09:46 +0200 (CEST) Date: Fri, 07 Jun 2013 20:24:00 -0000 Message-Id: <201306072009.r57K9kiX009408@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: will.newton@linaro.org CC: gdb-patches@sourceware.org, patches@linaro.org In-reply-to: <51B228C9.2030105@linaro.org> (message from Will Newton on Fri, 07 Jun 2013 19:39:05 +0100) Subject: Re: [PATCH] gdb/doublest.c: Avoid calling ldfrexp if long double is double. References: <51B228C9.2030105@linaro.org> X-SW-Source: 2013-06/txt/msg00180.txt.bz2 > Date: Fri, 07 Jun 2013 19:39:05 +0100 > From: Will Newton > > There's no need to call ldfrexp if long double is the same size > as double, the standard frexp will be faster and more accurate. > This fixes a failure in ldbl_308.exp on ARM, where long double > is the same size as double. > > gdb/ChangeLog: > > 2013-06-07 Will Newton > > * doublest.c (convert_doublest_to_floatformat): If long > double is the same size as double call frexp instead of > ldfrexp. > --- > gdb/doublest.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Hmm, sounds like the real bug is in ldfrexp. Not sure if that is fixable though. How many systems are still out there that have a long double type, but don't have frexpl(3)? Hmm, according to there might still be a few. But that means we just have to include another gnulib module ;). > diff --git a/gdb/doublest.c b/gdb/doublest.c > index 9ddc7a6..4bc0bd6 100644 > --- a/gdb/doublest.c > +++ b/gdb/doublest.c > @@ -466,7 +466,10 @@ convert_doublest_to_floatformat (CONST struct floatformat *fmt, > } > > #ifdef HAVE_LONG_DOUBLE > - mant = ldfrexp (dfrom, &exponent); > + if (sizeof (long double) > sizeof (double)) > + mant = ldfrexp (dfrom, &exponent); > + else > + mant = frexp (dfrom, &exponent); > #else > mant = frexp (dfrom, &exponent); > #endif > -- > 1.8.1.4 > >