From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 4D0073858D33 for ; Thu, 2 Mar 2023 10:34:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D0073858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 342AC1FB; Thu, 2 Mar 2023 02:35:07 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.99.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 612E93F67D; Thu, 2 Mar 2023 02:34:23 -0800 (PST) From: Richard Sandiford To: "Junxian Zhu" Mail-Followup-To: "Junxian Zhu" ,, , richard.sandiford@arm.com Cc: , Subject: Re: [PATCH v2] MIPS: Add buildtime option to set msa default References: <20230228092332.222487-1-zhujunxian@oss.cipunited.com> Date: Thu, 02 Mar 2023 10:34:22 +0000 In-Reply-To: <20230228092332.222487-1-zhujunxian@oss.cipunited.com> (Junxian Zhu's message of "Tue, 28 Feb 2023 17:24:34 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-34.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP 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: "Junxian Zhu" writes: > From: Junxian Zhu > > Add buildtime option to decide whether will compiler build with `-mmsa` option default. > > gcc/ChangeLog: > * config.gcc: add -with-{no-}msa build option. > * config/mips/mips.h: Likewise. > * doc/install.texi: Likewise. Thanks, pushed to trunk. I think it's equivalent to adding an extra mips*-*-* stanza and so suitable for stage 4. Richard > > Signed-off-by: Junxian Zhu > --- > gcc/config.gcc | 19 +++++++++++++++++-- > gcc/config/mips/mips.h | 3 ++- > gcc/doc/install.texi | 8 ++++++++ > 3 files changed, 27 insertions(+), 3 deletions(-) > > diff --git a/gcc/config.gcc b/gcc/config.gcc > index c070e6ecd2e..da3a6d3ba1f 100644 > --- a/gcc/config.gcc > +++ b/gcc/config.gcc > @@ -4709,7 +4709,7 @@ case "${target}" in > ;; > > mips*-*-*) > - supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci lxc1-sxc1 madd4 compact-branches" > + supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci lxc1-sxc1 madd4 compact-branches msa" > > case ${with_float} in > "" | soft | hard) > @@ -4871,6 +4871,21 @@ case "${target}" in > exit 1 > ;; > esac > + > + case ${with_msa} in > + yes) > + with_msa=msa > + ;; > + no) > + with_msa=no-msa > + ;; > + "") > + ;; > + *) > + echo "Unknown msa type used in --with-msa" 1>&2 > + exit 1 > + ;; > + esac > ;; > > loongarch*-*-*) > @@ -5815,7 +5830,7 @@ case ${target} in > esac > > t= > -all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls lxc1-sxc1 madd4 isa_spec compact-branches" > +all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls lxc1-sxc1 madd4 isa_spec compact-branches msa" > for option in $all_defaults > do > eval "val=\$with_"`echo $option | sed s/-/_/g` > diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h > index fbb4372864f..13bc193b752 100644 > --- a/gcc/config/mips/mips.h > +++ b/gcc/config/mips/mips.h > @@ -916,7 +916,8 @@ struct mips_cpu_info { > {"synci", "%{!msynci:%{!mno-synci:-m%(VALUE)}}" }, \ > {"lxc1-sxc1", "%{!mlxc1-sxc1:%{!mno-lxc1-sxc1:-m%(VALUE)}}" }, \ > {"madd4", "%{!mmadd4:%{!mno-madd4:-m%(VALUE)}}" }, \ > - {"compact-branches", "%{!mcompact-branches=*:-mcompact-branches=%(VALUE)}" } \ > + {"compact-branches", "%{!mcompact-branches=*:-mcompact-branches=%(VALUE)}" }, \ > + {"msa", "%{!mmsa:%{!mno-msa:-m%(VALUE)}}" } \ > > /* A spec that infers the: > -mnan=2008 setting from a -mips argument, > diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi > index 8ef5c1414da..718f48fbaeb 100644 > --- a/gcc/doc/install.texi > +++ b/gcc/doc/install.texi > @@ -1653,6 +1653,14 @@ unfused is normally expected). Disabling these instructions is the > only way to ensure compatible code is generated; this will incur > a performance penalty. > > +@item --with-msa > +On MIPS targets, make @option{-mmsa} the default when no > +@option{-mno-msa} option is passed. > + > +@item --without-msa > +On MIPS targets, make @option{-mno-msa} the default when no > +@option{-mmsa} option is passed. This is the default. > + > @item --with-mips-plt > On MIPS targets, make use of copy relocations and PLTs. > These features are extensions to the traditional