public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Noah Goldstein <goldstein.w.n@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] x86_64: Fix asm constraints in feraiseexcept (bug 30305)
Date: Mon, 3 Apr 2023 10:55:39 -0500	[thread overview]
Message-ID: <CAFUsyf+GEk7piNVu4GNtuvApftDkWEOZAA0Aw5HendPd7SFRyQ@mail.gmail.com> (raw)
In-Reply-To: <87bkk50y5n.fsf@oldenburg.str.redhat.com>

On Mon, Apr 3, 2023 at 10:43 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> The divss instruction clobbers its first argument, and the constraints
> need to reflect that.  Fortunately, with GCC 12, generated code does
> not actually change, so there is no externally visible bug.
>
> Tested on x86_64-linux-gnu.
>
> Suggested-by: Jakub Jelinek <jakub@redhat.com>
>
> ---
>  sysdeps/x86_64/fpu/fraiseexcpt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/x86_64/fpu/fraiseexcpt.c b/sysdeps/x86_64/fpu/fraiseexcpt.c
> index 924eed96a9..e7430a4158 100644
> --- a/sysdeps/x86_64/fpu/fraiseexcpt.c
> +++ b/sysdeps/x86_64/fpu/fraiseexcpt.c
> @@ -33,7 +33,7 @@ __feraiseexcept (int excepts)
>        /* One example of an invalid operation is 0.0 / 0.0.  */
>        float f = 0.0;
>
> -      __asm__ __volatile__ ("divss %0, %0 " : : "x" (f));
> +      __asm__ __volatile__ ("divss %0, %0 " : "+x" (f));
>        (void) &f;
>      }
>
> @@ -43,7 +43,7 @@ __feraiseexcept (int excepts)
>        float f = 1.0;
>        float g = 0.0;
>
> -      __asm__ __volatile__ ("divss %1, %0" : : "x" (f), "x" (g));
> +      __asm__ __volatile__ ("divss %1, %0" : "+x" (f) : "x" (g));
>        (void) &f;
>      }
>
>
> base-commit: ac2a14343e81098c196cef5d67b52e440c05c230
>

LGTM.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com

      reply	other threads:[~2023-04-03 15:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 15:43 Florian Weimer
2023-04-03 15:55 ` Noah Goldstein [this message]

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=CAFUsyf+GEk7piNVu4GNtuvApftDkWEOZAA0Aw5HendPd7SFRyQ@mail.gmail.com \
    --to=goldstein.w.n@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@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).