From patchwork Tue Feb 28 04:33:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxian Zhu X-Patchwork-Id: 62259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2807435wrd; Mon, 27 Feb 2023 20:34:03 -0800 (PST) X-Google-Smtp-Source: AK7set9TDA0TN1Oxk1cpTiHJckTZT5ZlHf6/5nZ00yiHoTWOdaahPEnX1y35ss51bwJvWRuSmc2H X-Received: by 2002:aa7:d550:0:b0:4ad:66b:84a6 with SMTP id u16-20020aa7d550000000b004ad066b84a6mr1923491edr.13.1677558843799; Mon, 27 Feb 2023 20:34:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677558843; cv=none; d=google.com; s=arc-20160816; b=vWZ4MsdMUpvXrW6V7eUwFHwEFOj4VEp4vbJAypE1ojdga4o7wnYYODb7TL1YoZv4TT FUCVbBvWGMviz0rpYtLZ1m2aUhyHFuUUI827NdZ040R5eclfR0hbL/wg41/TBUtLhOAl 5WB7jrfGGlqgPNAdfvNiairoEAyFnaDfxiOkrv2cPVE2i0hhp4UrLmbsRK64QyuX5wez Sk/Ly4SXtupuIp5+h8i+LmA/von5G6Y4YaWnJbZWzKqe2MQlmDVPwxqDQ9xElzJElRoL 0CsmwY/Ys+bQIdZCxQhI1zlnz7lrSH7DGpLNyaVfOS8yumwmSeKiafoj0FC7HfXpcB6t k3OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding:to :from:message-id:date:subject:cc:mime-version:dkim-signature :dmarc-filter:delivered-to; bh=XF8eNHR+EaSEHt23+1MHyYMBjgEgEvMtVMpBathlexg=; b=I5rsf5CBiRk58orFQ2P/el74+7te36GowbRzgmRqxO8+lDBy9QYG3Bs/bx5gXqoG9u TQZRYxhFYsN5ZP1g6i0644BFeDNs7cOjMIOyDlqQ/t13kPF4dvWGccu7Th6xi9EPnIOz msZjJCp1hk6p42n8Zs/aidmMPP9mYQ9TeT49DXQvez3boPio0oa8sVCaAqPw5ndRjN0u sm0K/oc4qUFUeg7UJ7rx+ZYm0GrvE4EvwpfaVo3zlI1469Z7lFhOuZxcP/a1+5/hBFEl /Lf+zDnhqRICVyOE5OKjxTBI9tSTWqZGnApKPZUwTh2ozz2jZJ2+KFCMfw5wuzdrDFFe jzOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@oss-cipunited-com.20200927.dkim.feishu.cn header.s=s1 header.b=okoSarkK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r14-20020aa7c14e000000b004acb81aae7dsi592009edp.186.2023.02.27.20.34.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 20:34:03 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@oss-cipunited-com.20200927.dkim.feishu.cn header.s=s1 header.b=okoSarkK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 50D6E3857C51 for ; Tue, 28 Feb 2023 04:33:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from s02.bc.larksuite.com (s02.bc.larksuite.com [209.127.230.20]) by sourceware.org (Postfix) with UTF8SMTPS id D82603858D39 for ; Tue, 28 Feb 2023 04:33:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D82603858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oss.cipunited.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=oss.cipunited.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=oss-cipunited-com.20200927.dkim.feishu.cn; t=1677558804; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=V6885+rKScKX1l9jziqn4n/Y3SdzfoBrxja8hNfARFA=; b=okoSarkKBDzSfAzc4KINnBQ7oPa36N0n1Si29enu7b0Noe3KwDL1rVKXsuNtScLWFuIIlj 5wcAbXmrxgNjirOsyeiNDloaAyXeN0dkzKMM8UvB0R2gwrqRdTf0Wj+kcpvV8yA7cEZlXT /uUiglmDdQPqYv3RBhbHNzB0N29eVAhOvktJlS2C27iEYo2A4urMbOBmPAhNIA7e/OuSQX BR50VTt9EhV/ktFsz7Svp1MmfduMK15uC/1Mdf7hUDn+MIkyD6XTa9MHQI9o8/yuYb1M4N ijCBcJ5llPz991zXAPGw3qIhubPmfvbrOyxSu4JYlvt8kG1i/XJf0EJApq8mrA== X-Lms-Return-Path: X-Mailer: git-send-email 2.39.2 Mime-Version: 1.0 Cc: , "Junxian Zhu" Subject: [PATCH] MIPS: Add buildtime option to set msa default Date: Tue, 28 Feb 2023 12:33:13 +0800 Message-Id: <20230228043250.212566-1-zhujunxian@oss.cipunited.com> From: "Junxian Zhu" To: X-Original-From: "Junxian Zhu" X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, HTML_MESSAGE, HTML_NONELEMENT_30_40, SPF_HELO_NONE, SPF_PASS, 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 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759047942155311787?= X-GMAIL-MSGID: =?utf-8?q?1759047942155311787?= 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. 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