public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stefan.arnold@aim-messtechnik.de" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug math/29326] New: Usage of double in sqrtf
Date: Thu, 07 Jul 2022 07:58:27 +0000	[thread overview]
Message-ID: <bug-29326-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29326

            Bug ID: 29326
           Summary: Usage of double in sqrtf
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: stefan.arnold@aim-messtechnik.de
  Target Milestone: ---

The function "__ieee754_sqrtf" in sysdeps/ieee754/flt-32/e_sqrtf.c has an
imlicit double conversion in lines 76 and 78. As this is quite useless and
costly especially on microcontrollers i suggest adding an "f" suffix to the
numbers.

--- a/sysdeps/ieee754/flt-32/e_sqrtf.c
+++ b/sysdeps/ieee754/flt-32/e_sqrtf.c
@@ -73,9 +73,9 @@ __ieee754_sqrtf(float x)
     /* use floating add to find out rounding direction */
        if(ix!=0) {
            z = 0x1p0 - 0x1.4484cp-100; /* trigger inexact flag.  */
-           if (z >= 0x1p0) {
+           if (z >= 0x1p0f) {
                z = 0x1p0 + 0x1.4484cp-100;
-               if (z > 0x1p0)
+               if (z > 0x1p0f)
                    q += 2;
                else
                    q += (q&1);
--

-- 
You are receiving this mail because:
You are on the CC list for the bug.

                 reply	other threads:[~2022-07-07  7:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29326-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).