| Message ID | 20220831181443.3875972-1-adhemerval.zanella@linaro.org (mailing list archive) |
|---|---|
| State | Dropped |
| Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 008DA385802B for <patchwork@sourceware.org>; Wed, 31 Aug 2022 18:16:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 008DA385802B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661969771; bh=22Ku8qN2xIqALZITjECVtP7AjIqw14N6Aui2PkYsiXw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=FwofKevgPt0+Kj4U0p2pfDJNMnymVTs7sgjDPKxeV8D6ObIN6mnYv8rgxVX2s82bJ 6+lE/xioc5qmG6E64ETY9FbiVhKESqk8OVCyYBB5P//K3JxDbahS1p13KXO0mpDzls jWKc2Q5bzi026sh+5+wkjCN2AmRgkhxXi5ynlq7s= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 373A43851AA9 for <libc-alpha@sourceware.org>; Wed, 31 Aug 2022 18:14:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 373A43851AA9 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-11e7e0a63e2so25175357fac.4 for <libc-alpha@sourceware.org>; Wed, 31 Aug 2022 11:14:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=22Ku8qN2xIqALZITjECVtP7AjIqw14N6Aui2PkYsiXw=; b=NG/Lo6SvOh6veuqWxuP8Uzml19mjHaTil4ekCPph20i1RJomxkY9qrH1wRLqTF1yG5 MM9wDsGCRCITRKm1snqiAhWtEr9UR1zBRT7CLdxWV7o/FJY9+8rnKfYzmLZsCSL+JAiD 3o3QgdjAQH0BH8N/+0uRs6peZm/ZCKsdBlaOwQrNCoZEzt/5O8Nzy3pOVbe3G5vfga2n XmU5aMcFt5uLnkv23CETIgz+5YmZ40cbFr4Gc9Z1DX6GEaXwsBVFTVYqT4DXLd4RWkFQ 8mHWR+mk+p/+7T21ftAQBLkbN8Z7Vrhzsl+T0pfRAbi8xWGRry3tJmca3DNfRA5vCP8R tt6g== X-Gm-Message-State: ACgBeo04q2wQsTKg5Yy/1anDy9KYiVz/rNDmAZfK/wxxbwrGkh64rJXD 2SW+myVSrOE7igM6Egq5ZbFF95eUNmk4WA== X-Google-Smtp-Source: AA6agR4FqpBrZ50wzMpNsZvx/i6KA+r8JYXVy63O3FE/v9WY1HxgReIG3E1uAb3yysFJx/DW+3Pr+Q== X-Received: by 2002:a05:6870:f229:b0:114:25db:4000 with SMTP id t41-20020a056870f22900b0011425db4000mr2158139oao.246.1661969688493; Wed, 31 Aug 2022 11:14:48 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:745e:a396:a3e3:72c0:b7c7]) by smtp.gmail.com with ESMTPSA id k4-20020a056870958400b000fb2aa6eef2sm9912805oao.32.2022.08.31.11.14.47 for <libc-alpha@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 11:14:48 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH] math: x86: Remove extra '%' on FP_INIT_ROUNDMODE inline asm Date: Wed, 31 Aug 2022 15:14:43 -0300 Message-Id: <20220831181443.3875972-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Adhemerval Zanella <adhemerval.zanella@linaro.org> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
| Series |
math: x86: Remove extra '%' on FP_INIT_ROUNDMODE inline asm
|
|
Commit Message
Adhemerval Zanella Netto
Aug. 31, 2022, 6:14 p.m. UTC
Checked on x86_64-linux-gnu. --- sysdeps/x86/fpu/sfp-machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Aug 31, 2022 at 11:16 AM Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> wrote: > > Checked on x86_64-linux-gnu. > --- > sysdeps/x86/fpu/sfp-machine.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h > index 5892f4f5fe..1cacdb4ebd 100644 > --- a/sysdeps/x86/fpu/sfp-machine.h > +++ b/sysdeps/x86/fpu/sfp-machine.h > @@ -41,7 +41,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); > > # define FP_INIT_ROUNDMODE \ > do { \ > - __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ > + __asm__ __volatile__ ("vstmxcsr\t%0" : "=m" (_fcw)); \ > } while (0) > #else > # define _FP_W_TYPE_SIZE 32 > -- > 2.34.1 > The intention was to generate stmxcsr with SSE and vstmxcsr with AVX. I think we should define a special prefix, like AVX_INSN_PREFIX, which is 'v' if __AVX__ is defined and empty if __AVX__ isn't defined.
On Wed, 31 Aug 2022, Adhemerval Zanella via Libc-alpha wrote: > Checked on x86_64-linux-gnu. > --- > sysdeps/x86/fpu/sfp-machine.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h > index 5892f4f5fe..1cacdb4ebd 100644 > --- a/sysdeps/x86/fpu/sfp-machine.h > +++ b/sysdeps/x86/fpu/sfp-machine.h > @@ -41,7 +41,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); > > # define FP_INIT_ROUNDMODE \ > do { \ > - __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ > + __asm__ __volatile__ ("vstmxcsr\t%0" : "=m" (_fcw)); \ That's incorrect. %v means "'v' if AVX, empty string otherwise".
On 31/08/22 16:33, H.J. Lu wrote: > On Wed, Aug 31, 2022 at 11:16 AM Adhemerval Zanella via Libc-alpha > <libc-alpha@sourceware.org> wrote: >> >> Checked on x86_64-linux-gnu. >> --- >> sysdeps/x86/fpu/sfp-machine.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h >> index 5892f4f5fe..1cacdb4ebd 100644 >> --- a/sysdeps/x86/fpu/sfp-machine.h >> +++ b/sysdeps/x86/fpu/sfp-machine.h >> @@ -41,7 +41,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); >> >> # define FP_INIT_ROUNDMODE \ >> do { \ >> - __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ >> + __asm__ __volatile__ ("vstmxcsr\t%0" : "=m" (_fcw)); \ >> } while (0) >> #else >> # define _FP_W_TYPE_SIZE 32 >> -- >> 2.34.1 >> > > The intention was to generate stmxcsr with SSE and vstmxcsr with > AVX. I think we should define a special prefix, like AVX_INSN_PREFIX, > which is 'v' if __AVX__ is defined and empty if __AVX__ isn't defined. > Right, I was not aware of it. Is is documented on gcc inline assembly manual somewhere (I could not find it)? In any case I will follow your suggestion.
On Thu, Sep 1, 2022 at 6:01 AM Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> wrote: > > > > On 31/08/22 16:33, H.J. Lu wrote: > > On Wed, Aug 31, 2022 at 11:16 AM Adhemerval Zanella via Libc-alpha > > <libc-alpha@sourceware.org> wrote: > >> > >> Checked on x86_64-linux-gnu. > >> --- > >> sysdeps/x86/fpu/sfp-machine.h | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h > >> index 5892f4f5fe..1cacdb4ebd 100644 > >> --- a/sysdeps/x86/fpu/sfp-machine.h > >> +++ b/sysdeps/x86/fpu/sfp-machine.h > >> @@ -41,7 +41,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); > >> > >> # define FP_INIT_ROUNDMODE \ > >> do { \ > >> - __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ > >> + __asm__ __volatile__ ("vstmxcsr\t%0" : "=m" (_fcw)); \ > >> } while (0) > >> #else > >> # define _FP_W_TYPE_SIZE 32 > >> -- > >> 2.34.1 > >> > > > > The intention was to generate stmxcsr with SSE and vstmxcsr with > > AVX. I think we should define a special prefix, like AVX_INSN_PREFIX, > > which is 'v' if __AVX__ is defined and empty if __AVX__ isn't defined. > > > > Right, I was not aware of it. Is is documented on gcc inline assembly I need to take a look. > manual somewhere (I could not find it)? In any case I will follow your > suggestion. There is no need for it. %v is handled by compiler with an operand.
On 01/09/22 11:51, H.J. Lu wrote: > On Thu, Sep 1, 2022 at 6:01 AM Adhemerval Zanella Netto > <adhemerval.zanella@linaro.org> wrote: >> >> >> >> On 31/08/22 16:33, H.J. Lu wrote: >>> On Wed, Aug 31, 2022 at 11:16 AM Adhemerval Zanella via Libc-alpha >>> <libc-alpha@sourceware.org> wrote: >>>> >>>> Checked on x86_64-linux-gnu. >>>> --- >>>> sysdeps/x86/fpu/sfp-machine.h | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h >>>> index 5892f4f5fe..1cacdb4ebd 100644 >>>> --- a/sysdeps/x86/fpu/sfp-machine.h >>>> +++ b/sysdeps/x86/fpu/sfp-machine.h >>>> @@ -41,7 +41,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); >>>> >>>> # define FP_INIT_ROUNDMODE \ >>>> do { \ >>>> - __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ >>>> + __asm__ __volatile__ ("vstmxcsr\t%0" : "=m" (_fcw)); \ >>>> } while (0) >>>> #else >>>> # define _FP_W_TYPE_SIZE 32 >>>> -- >>>> 2.34.1 >>>> >>> >>> The intention was to generate stmxcsr with SSE and vstmxcsr with >>> AVX. I think we should define a special prefix, like AVX_INSN_PREFIX, >>> which is 'v' if __AVX__ is defined and empty if __AVX__ isn't defined. >>> >> >> Right, I was not aware of it. Is is documented on gcc inline assembly > > I need to take a look. Thanks. > >> manual somewhere (I could not find it)? In any case I will follow your >> suggestion. > > There is no need for it. %v is handled by compiler with an operand. Not by all compilers in fact, that's why I proposing the change.
On Thu, Sep 1, 2022 at 8:23 AM Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> wrote: > > > > On 01/09/22 11:51, H.J. Lu wrote: > > On Thu, Sep 1, 2022 at 6:01 AM Adhemerval Zanella Netto > > <adhemerval.zanella@linaro.org> wrote: > >> > >> > >> > >> On 31/08/22 16:33, H.J. Lu wrote: > >>> On Wed, Aug 31, 2022 at 11:16 AM Adhemerval Zanella via Libc-alpha > >>> <libc-alpha@sourceware.org> wrote: > >>>> > >>>> Checked on x86_64-linux-gnu. > >>>> --- > >>>> sysdeps/x86/fpu/sfp-machine.h | 2 +- > >>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>> > >>>> diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h > >>>> index 5892f4f5fe..1cacdb4ebd 100644 > >>>> --- a/sysdeps/x86/fpu/sfp-machine.h > >>>> +++ b/sysdeps/x86/fpu/sfp-machine.h > >>>> @@ -41,7 +41,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); > >>>> > >>>> # define FP_INIT_ROUNDMODE \ > >>>> do { \ > >>>> - __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ > >>>> + __asm__ __volatile__ ("vstmxcsr\t%0" : "=m" (_fcw)); \ > >>>> } while (0) > >>>> #else > >>>> # define _FP_W_TYPE_SIZE 32 > >>>> -- > >>>> 2.34.1 > >>>> > >>> > >>> The intention was to generate stmxcsr with SSE and vstmxcsr with > >>> AVX. I think we should define a special prefix, like AVX_INSN_PREFIX, > >>> which is 'v' if __AVX__ is defined and empty if __AVX__ isn't defined. > >>> > >> > >> Right, I was not aware of it. Is is documented on gcc inline assembly > > > > I need to take a look. > > Thanks. > > > > >> manual somewhere (I could not find it)? In any case I will follow your > >> suggestion. > > > > There is no need for it. %v is handled by compiler with an operand. > > Not by all compilers in fact, that's why I proposing the change. Then my scheme should work.
diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h index 5892f4f5fe..1cacdb4ebd 100644 --- a/sysdeps/x86/fpu/sfp-machine.h +++ b/sysdeps/x86/fpu/sfp-machine.h @@ -41,7 +41,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); # define FP_INIT_ROUNDMODE \ do { \ - __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \ + __asm__ __volatile__ ("vstmxcsr\t%0" : "=m" (_fcw)); \ } while (0) #else # define _FP_W_TYPE_SIZE 32