From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id 071373857353 for ; Wed, 10 May 2023 06:43:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 071373857353 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f00d41df22so39124448e87.1 for ; Tue, 09 May 2023 23:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683700983; x=1686292983; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Gqx/sEwQSUFV5mMyMcDiya/BHGEKDIPTWj0m20Azfbk=; b=B6Gt0W06MxEJUVTmbl8bKO1O12nP3bd0kWt42J+dxQAPzjy8hFQrJyAHHFBHz2K3U+ 63QeZxx3Kd5jN83sMLPnwcYJck1e+FMyjU3XU2Muz69TWvKWFrnshkSCJKv+A3zxSJFc C9CkOpAL3hXOW15bLXmJZ4SkAjRl5WxEG7+slNP9AD6QodaPp3horfuEE9aHUbwf1k+H S5WRyn3wqsSbeXnECf4c91lSwxmswJ2Z3huxGLmFHTct3U4JZiwQ0jNF4xkRq0R4XlGZ unjc8o2fyc2Rf+N06+vkzihi7Wd8hwyb9tbsW8m56zTibOFVzjHK5LwTmypB3gMhhAeh H4uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683700983; x=1686292983; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gqx/sEwQSUFV5mMyMcDiya/BHGEKDIPTWj0m20Azfbk=; b=leoOkQOHFuhECsfEe0yvb+D4BcuUR26p2LH90J3Qtov0Vo8Lx1t2z17GMOlE8areb9 TNGsaRFT52sUnDQAPxcQsTEUZ75zen47e7FWL66vD87xr0P5pQYstg9DCwoo4EBMnVBV wViAgITOMxzSMSRS1A1Bcp5YoakbK5SUXYwuwZh9KTpATYBycB8zVDQo+wos47muoyHC /2+UvUeRJvrKOOa/efK49sslOQR6wPFQH81WEX/DBtNdD/9mtYlYUlfja8eQ0WpRp2ER df0cmOJ9hGW1uR6stHZL4kqk929xQlkKhkB1n6KQyivCzqY1qJIccIM+/POr+RaMlBJM 0yiA== X-Gm-Message-State: AC+VfDz8YeqH27vgviknAv/Qu1iSD34JxznZdubV1CxZYNIZrudA68Rw mND344ePNqa/uoK7ynaMBtr+OjNE32mY0rXdOnUOvm04 X-Google-Smtp-Source: ACHHUZ7SJHJDw+KPTNQAzNWOBXTkoxEhMj5Ht0+OpNSYGe7omX+P28Xf1IHQ56v8JVOMxaaeUWLgbBU6MV54X/ebzQs= X-Received: by 2002:a2e:9f57:0:b0:2a8:ea9e:29b6 with SMTP id v23-20020a2e9f57000000b002a8ea9e29b6mr1460950ljk.11.1683700983297; Tue, 09 May 2023 23:43:03 -0700 (PDT) MIME-Version: 1.0 References: <20221215062137.3128845-1-hongtao.liu@intel.com> <20221215062137.3128845-2-hongtao.liu@intel.com> In-Reply-To: From: Richard Biener Date: Wed, 10 May 2023 08:41:16 +0200 Message-ID: Subject: Re: [PATCH V2 2/2] [x86] x86: Add a new option -mdaz-ftz to enable FTZ and DAZ flags in MXCSR. To: Hongtao Liu Cc: Uros Bizjak , "H.J. Lu" , gcc-patches@gcc.gnu.org, Jakub Jelinek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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 List-Id: On Wed, May 10, 2023 at 3:41=E2=80=AFAM Hongtao Liu wr= ote: > > On Thu, May 4, 2023 at 5:49=E2=80=AFPM Richard Biener > wrote: > > > > On Thu, May 4, 2023 at 7:37=E2=80=AFAM Hongtao Liu via Gcc-patches > > wrote: > > > > > > On Thu, May 4, 2023 at 1:35=E2=80=AFPM Hongtao Liu wrote: > > > > > > > > On Thu, Dec 22, 2022 at 4:04=E2=80=AFPM Uros Bizjak wrote: > > > > > > > > > > On Thu, Dec 22, 2022 at 5:40 AM Hongtao Liu = wrote: > > > > > > > > > > > > On Thu, Dec 22, 2022 at 6:46 AM Jakub Jelinek wrote: > > > > > > > > > > > > > > On Wed, Dec 21, 2022 at 02:43:43PM -0800, H.J. Lu wrote: > > > > > > > > > > > > > > Target RejectNegative > > > > > > > > > > > > > > Set 80387 floating-point precision to 80-bit. > > > > > > > > > > > > > > > > > > > > > > > > > > > > +mdaz-ftz > > > > > > > > > > > > > > +Target > > > > > > > > > > > > > > > > > > > > > > > > > > s/Target/Driver/ > > > > > > > > > > > > Change to Driver and Got error like:cc1: error: com= mand-line option > > > > > > > > > > > > =E2=80=98-mdaz-ftz=E2=80=99 is valid for the driver= but not for C. > > > > > > > > > > > Hi Jakub: > > > > > > > > > > > I didn't find a good solution to handle this error = after changing > > > > > > > > > > > *Target* to *Driver*, Could you give some hints how t= o solve this > > > > > > > > > > > problem? > > > > > > > > > > > Or is it ok for you to mark this as *Target*(there wo= n't be any save > > > > > > > > > > > and restore in cfun since there's no variable defined= here.) > > > > > > > > > > > > > > > > > > > > Since all -m* options are passed to cc1, -mdaz-ftz can'= t be marked > > > > > > > > > > as Driver. We need to give it a different name to mark= it as Driver. > > > > > > > > > > > > > > > > > > It is ok like that. > > > > > > > > > > > > > > > > > > Jakub > > > > > > > > > > > > > > > > > > > > > > > > > The GCC driver handles -mno-XXX automatically for -mXXX. U= se > > > > > > > > a different name needs to handle the negation. Or we can = do something > > > > > > > > like this to check for CL_DRIVER before passing it to cc1. > > > > > > > > > > > > > > I meant I'm ok with -m{,no-}daz-ftz option being Target rathe= r than Driver. > > > > > > > > > > > > > Thanks. > > > > > > Uros, Is the patch for you? > > > > > > > > > > The original patch is then OK. > > > > Some users found the -mdaz-ftz option to be very useful, and want i= t > > > > to be backport to GCC12 and GCC11. > > > > But the patch is not a bugfix one, so i'd like to ask options from > > > s/options/opinions/g > > > > other maintainers, if the patch is suitable for backport? > > > > > > > > The backport patches include both this one and [1] which apply > > > > -mdaz-ftz to all other x86 targets. > > > > > > > > [1] https://gcc.gnu.org/pipermail/gcc-patches/2023-January/610053.h= tml > > > > Please make sure to not backport the -ffast-math linker spec change tho= ugh. > > Also note the 12 branch is currently frozen. > You're meaning don't backport -shared part since it will cause > different behavior between different backends. ? > I'm trying to backport the daz-ftz part, it won't change the existed > behavior for fast-math or shared. > %{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{= !mno-daz-ftz:crtfastmath.o%s}} The quoted patch shows -shared in context and you didn't post a backport version to look at. But yes, we shouldn't change -shared behavior on a branch, even less so make it inconsistent between targets. Richard. > > > > I'll defer to x86 maintainers on the -mdaz-ftz flag itself. > > > > Richard. > > > > > > > > > > > > Thanks, > > > > > Uros. > > > > > > > > > > > > > > > > -- > > > > BR, > > > > Hongtao > > > > > > > > > > > > -- > > > BR, > > > Hongtao > > > > -- > BR, > Hongtao