From patchwork Fri Jun 7 18:39:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 17690 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-fa0-f71.google.com (mail-fa0-f71.google.com [209.85.161.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7E0652395F for ; Fri, 7 Jun 2013 18:39:12 +0000 (UTC) Received: by mail-fa0-f71.google.com with SMTP id s1sf4445071fas.2 for ; Fri, 07 Jun 2013 11:39:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:message-id :date:from:user-agent:mime-version:to:cc:subject:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=6pJVCbNreVrqoLlLkn3wosZxyBo06L713Qh1x097vo4=; b=WxgcziMEAVwGFv+3Vxc6qlKpueIjf9ujrpLPI/nRrWHXIZ3NCa7yqe+w7Oy0RjLDpa twF7f/MrOf3koK6hxAEsCvMINjoOykq6C92uW5iICl43/u7nECfMjVBasKoHPCEksMLQ owGwOlR1nSU7tYnIPEa2xL4iykKgyLo8KZrIUxH66Kj/5IaBmLkBXWmwCLZhYnsSkI7o nVzT0BM+8XlkFz7iC00jlIEcLsrQFqObPBsbaX7PzAppr8X8yf97dKytWSpgTevmf0/h lNWm0beBkeUNqh1QUVA2gft0Ud5KI1IHL17rt+XcZd4MPy/EHYNFTpeHcsoZ3RVu7icg pqQA== X-Received: by 10.180.21.173 with SMTP id w13mr1616729wie.4.1370630351060; Fri, 07 Jun 2013 11:39:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.73.242 with SMTP id o18ls309572wiv.41.gmail; Fri, 07 Jun 2013 11:39:10 -0700 (PDT) X-Received: by 10.180.72.227 with SMTP id g3mr2255290wiv.1.1370630350927; Fri, 07 Jun 2013 11:39:10 -0700 (PDT) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [2607:f8b0:400c:c01::22e]) by mx.google.com with ESMTPS id a1si10054454wiy.7.2013.06.07.11.39.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Jun 2013 11:39:10 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22e; Received: by mail-ve0-f174.google.com with SMTP id oz10so3247788veb.19 for ; Fri, 07 Jun 2013 11:39:09 -0700 (PDT) X-Received: by 10.52.53.36 with SMTP id y4mr19981931vdo.51.1370630349847; Fri, 07 Jun 2013 11:39:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp125592vcb; Fri, 7 Jun 2013 11:39:09 -0700 (PDT) X-Received: by 10.180.198.44 with SMTP id iz12mr2538263wic.44.1370630348926; Fri, 07 Jun 2013 11:39:08 -0700 (PDT) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [2a00:1450:400c:c00::232]) by mx.google.com with ESMTPS id bo5si16675wjb.25.2013.06.07.11.39.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Jun 2013 11:39:08 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::232 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=2a00:1450:400c:c00::232; Received: by mail-wg0-f50.google.com with SMTP id k13so3413226wgh.5 for ; Fri, 07 Jun 2013 11:39:08 -0700 (PDT) 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 19:39:05 +0100 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. X-Gm-Message-State: ALoCoQluylANNhdGJBxA6ELpLaPnkT5/VwX0RNKBB6jJ/3iBv5geyZ9chvRl8zHznxxjAeqzdRqa X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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