From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106956 invoked by alias); 21 Apr 2017 13:30:46 -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 106786 invoked by uid 89); 21 Apr 2017 13:30:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=H*r:sk:newlib@, spots, became X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Apr 2017 13:30:37 +0000 Received: by mail-wr0-f177.google.com with SMTP id z109so54887518wrb.1 for ; Fri, 21 Apr 2017 06:30:33 -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=fjsaEXtNjTY84rfgMWCMZ7iZ8nGInlAB6HomhLmQa3o=; b=lSWChYlWmlBWI76YaPK4aIC0MOdmP2yGoynxbVzuui5ERKEDzgQf74HaoVEaazQfjQ lFdZBSym3fD7ihwf9e9tJNIQcbajL7ONoBnAYX03v7hCdfMj+6OsbQyzIskDjPcQLVl+ QbcMxVrVpJh0kdbCJCuQnYOBVLIK2TJZvR8pPR4ftYq96JPuno8DOt7wfp2aHRSLZKMl Gi3Ecm772XGJabAwAH+qR6WxkbJN5m2h2/mekRV7mg2h/8ROTaNf3tjyzRRZ6bu83R01 QzU7793yNKZw30VU9fOnIf+etI8e7gn1+2OJkSrJF16KPOkDTvZF5hNpz5CsZLCQNkTb kutg== X-Gm-Message-State: AN3rC/4DvZYdXU0oBTG0j/R8QqBZnJRtdxBEC4ooUUa7zIHGkoIT0ZkU 6U1PCk+pUnSbF8JHkjNpsbGBqNOkugA5 X-Received: by 10.223.177.217 with SMTP id r25mr12722702wra.104.1492781431765; Fri, 21 Apr 2017 06:30:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.175.35 with HTTP; Fri, 21 Apr 2017 06:30:31 -0700 (PDT) In-Reply-To: <10ded3d6-37d2-9b85-48f6-501254eaf7fe@LGSInnovations.com> References: <10ded3d6-37d2-9b85-48f6-501254eaf7fe@LGSInnovations.com> From: Richard Allen Date: Fri, 21 Apr 2017 13:30: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/msg00314.txt.bz2 > 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