From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34473 invoked by alias); 18 May 2017 23:58:41 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 34455 invoked by uid 89); 18 May 2017 23:58:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=Allen, spots, acts, inspecting X-HELO: mail-wr0-f178.google.com Received: from mail-wr0-f178.google.com (HELO mail-wr0-f178.google.com) (209.85.128.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 May 2017 23:58:40 +0000 Received: by mail-wr0-f178.google.com with SMTP id z52so6045757wrc.2 for ; Thu, 18 May 2017 16:58:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=OJmkdmHkswdeWZEXt6kkQy+x7grHFV0KXnCBusH8hAc=; b=pFze4867vjf1R3e135lGy0RKkcDxBjd3VVtc/MGGJxfzYQx4g+N8YA9Nd1COMs+tlo 5GJCWQhCApvZNi+K4qY23XjG4Pw1/qEjdxaqxyU3T5Q+sTzX18UTyU5uPVemi7s60O8p lNC5id5Q828/dlPM7Q6PV+qiRLk1Bry0LEMDZDZ5oAw00hqlPnKNBXf4yLTwQyxs9FhD 2/+7qKAyV67dF8S4MX66puiJ0rtkBcK6oeYQ1qAuoX/22c+qTuhPGicP51PaP1vccw/y LZxlKolbKiDiDCSfVkZzSf7zb3F+i215bYRa5YSdFvbtwshXlhMz+mCvmGoshMfMgQ5r x7mw== X-Gm-Message-State: AODbwcA4zhNInP2kPPsMD7yLlNIIG4TpK+MYQlMfT84io6hdApHmC6Yu zqGXUU1sao3GSX/CHXpNgVtTX3kkoAw8VPc= X-Received: by 10.223.136.75 with SMTP id e11mr908463wre.14.1495151921142; Thu, 18 May 2017 16:58:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.175.35 with HTTP; Thu, 18 May 2017 16:58:40 -0700 (PDT) In-Reply-To: References: <10ded3d6-37d2-9b85-48f6-501254eaf7fe@LGSInnovations.com> From: Richard Allen Date: Thu, 18 May 2017 23:58:00 -0000 Message-ID: Subject: Re: [PATCH] Avoid extra float->double conversion To: newlib@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00335.txt.bz2 > And just wondering, did you check all of the "f" functions? I did finally go through the rest of the "f" functions. The remaining float->double conversions are needed to support matherr(). mathfp has extra float->double conversions that should be fixed later, as part of fixing up mathfp. Is there anything to do before merging this patch? On Fri, Apr 21, 2017 at 8:30 AM, Richard Allen wrote: >> And just wondering, did you check all of the "f" functions? (I'd guess so >> since your 0/0 patch edits multiple files, but better to know for sure.) >> It would not be at all surprising if others (or even all) of the f forms had >> the same flaw. > > Several of the "f" functions do similar things, mostly compares, but a few > arithmetic operations. This patch lets my particular project remove rint() at > link time. There will be a few more patches for those. There's also a few spots > where some operations are duplicated in if/elses, not sure if I'll go > after those. > Eventually, I'd like to get mathfp back up and running, but that's going to be a > much larger effort. > >> This is better than the first one, with the catch on the constants. Have you >> checked what was linked to be certain that no other double things are still >> there? (Perhaps easier than inspecting the source.) > > The only float->double and double->float conversions remaining > are in the error handling when moving to/from exc.retval, exc.arg1, and > exc.arg2. > >> To be the most gung-ho, isnan() should be isnanf() throughout--saves a >> conversion and might avoid a double function being linked. (It seems odd >> that it does have isfinitef(), but not isnanf().) > > In C99, isnan() became template-ey, and acts like a macro. newlib > implements it with __builtin_isnan(), which GCC inlines. Calling > isnanf() results in a function call, so I didn't change those. > > -Richard