From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21094 invoked by alias); 7 Jun 2013 18:39:52 -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 21083 invoked by uid 89); 7 Jun 2013 18:39:52 -0000 X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=unavailable version=3.3.1 Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com) (209.85.212.171) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 07 Jun 2013 18:39:51 +0000 Received: by mail-wi0-f171.google.com with SMTP id hm9so1621684wib.16 for ; Fri, 07 Jun 2013 11:39:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=6pJVCbNreVrqoLlLkn3wosZxyBo06L713Qh1x097vo4=; b=fyJ+AR9YQy5kY0+oumfayxu1Q/mUBb2iFEekljjHwFuKL1G+PrErE3OxE6BLNmGrYM BzDCvhfwe0O8bZWW4yBaXooaTYKBLAVocnMCrbboDxV4pf9lofMi1ERRl9H5UejVspwm xonMi7h5x4sOqU18fOhOinmSqlOvvCoKsHaFYmULJFjEpMDzn0kTz3jIcTFyOeeFWMMe XX8U6n3gesVTIWVrnwkD/31FE0P1gux4NGdG8I45DHJ004a+ZcFf7CzyvV7J2k4+AUNw xILvGbF5X8gw57DyukkcrE/j4xjQjFZuYsBZ+2J3YBn3hN5WAVp+eFbPfDhB+yvfU9p2 vbsw== X-Received: by 10.194.123.69 with SMTP id ly5mr36499510wjb.29.1370630348105; Fri, 07 Jun 2013 11:39:08 -0700 (PDT) Received: from localhost.localdomain (cpc11-seac20-2-0-cust84.7-2.cable.virginmedia.com. [81.108.156.85]) by mx.google.com with ESMTPSA id b19sm18177522wik.10.2013.06.07.11.39.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Jun 2013 11:39:07 -0700 (PDT) Message-ID: <51B228C9.2030105@linaro.org> Date: Fri, 07 Jun 2013 18:40:00 -0000 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH] gdb/doublest.c: Avoid calling ldfrexp if long double is double. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmQvQRoTRXTnflRAn8HeJuD3V8pV+PCZHHaVQeBlr4mRBtrgEcUvyzQto+UoCmOMhErmdj/ X-SW-Source: 2013-06/txt/msg00172.txt.bz2 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(-) 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20302 invoked by alias); 7 Jun 2013 18:39:15 -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 20293 invoked by uid 89); 7 Jun 2013 18:39:14 -0000 X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-wg0-f54.google.com (HELO mail-wg0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 07 Jun 2013 18:39:10 +0000 Received: by mail-wg0-f54.google.com with SMTP id j13so3355117wgh.33 for ; Fri, 07 Jun 2013 11:39:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=6pJVCbNreVrqoLlLkn3wosZxyBo06L713Qh1x097vo4=; b=d3WV+dGi/ROeHOuA8BRvwXnrUDUUAvlhCtk5EVeIwYuM+Cppl/hoWfFA07JWDy47nj F4L7n3ddvy9/ddXmK1SCgJlR3MKg2BB29X654FVnQMmgBck7R4umu0r5hpbDJkpZ0P1U i39OCUNhviODGqDNsUhfrmHxcwkfzrF+/5xMmQ85NjlUfMUZ4a1AdOL7N97q7vfrJYPq iaY6KtXnSFMNgAUrFNO7NAEPRGC7dnk/6dAn5mkrxX0ZUUh0Rzu+4X2OSrRpVi06VibQ YcLox9OfRx0pMdvvTbdBzvKNWlTCxGGJ3vgGaOxMlLvUvOcEZCwBY5dRxAeNAHbqUxYl Ue+w== X-Received: by 10.194.123.69 with SMTP id ly5mr36499510wjb.29.1370630348105; Fri, 07 Jun 2013 11:39:08 -0700 (PDT) Received: from localhost.localdomain (cpc11-seac20-2-0-cust84.7-2.cable.virginmedia.com. [81.108.156.85]) by mx.google.com with ESMTPSA id b19sm18177522wik.10.2013.06.07.11.39.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Jun 2013 11:39:07 -0700 (PDT) Message-ID: <51B228C9.2030105@linaro.org> Date: Fri, 07 Jun 2013 18:39:00 -0000 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH] gdb/doublest.c: Avoid calling ldfrexp if long double is double. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQn1aa8tACRlFt3apzpyCYXg7H6Lp/1htIj/uliA9myGmrlO4BoZCzR2Jpf4hNeJxlFIiiXV X-SW-Source: 2013-06/txt/msg00171.txt.bz2 Message-ID: <20130607183900.nSx9i-3WpMKUMH3j_bpi1qSKUvZ4HJvcssZATPQ7YH8@z> 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(-) 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