From patchwork Mon Feb 27 03:22:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxian Zhu X-Patchwork-Id: 61702 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2210029wrd; Sun, 26 Feb 2023 19:23:32 -0800 (PST) X-Google-Smtp-Source: AK7set/45DZLrHxgrZvaYK2ZzSUIZbAKMpqvFbAAnF+rbDEPaIpfkmykN49d9aFJjfk9sqekUXKm X-Received: by 2002:a17:907:c24b:b0:8f0:143d:d67a with SMTP id tj11-20020a170907c24b00b008f0143dd67amr14847984ejc.63.1677468212238; Sun, 26 Feb 2023 19:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677468212; cv=none; d=google.com; s=arc-20160816; b=gGSbPDSxFqye2l9iJsbHPVEgexAl6akSUVp5myB9po4693Pio2fPQUxFCFaFMpPoJx SpzAc23daB5DqjqnUSxfaRPiKC2dksTPAHBURTkroCjDWwZputt0WXpV22Da/ISxUUK3 28lZBx9pZDAXehK0DtbpdQuGWX+9EzgVv9t8PJvDnlkBtZ8rhCW4AbNp/PxwmlG2hB/b KFBuLBEy/s4o8OL0OjqfGWLzJ+l0bJhDuSGXkkGv1ml/ASwS1K/Ik5k5w+ALEJGC9fIZ h9Hrvbb5RmX9kzt+Xf2B+hIhie4qyZtaqJ2SWnTQl6Hm+4zyIWsAaL0nR9zFsUvfeCTk P6cQ== 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 :mime-version:from:message-id:subject:cc:date:to:dkim-signature :dmarc-filter:delivered-to; bh=wqXyRlckxaRrFv6XZhHBestKUlE1DH5KuXVoAB+nWXs=; b=xigkqacqWvnthhvX3EidljFbAlA6md55j3SEVDLpPKxNqVTr/pvjcRhyx2icJyJMvL 83KNPjhojLDk8BHrLMr9zTA34SFGH4DYOKENAefPciPdcfb0qkvbevjuDc2Jvd22FF6x 8Pee4suNfNWvCxUt/BAFTSF0Y77zxVOf9uNxrNqFKiq28zV4WF/t7qT+dC+ee4upjfxs tF03OZNMJVLM6lAAiBldPSVO5HupGdc/v/Iyy6F1tlKLTkix7M3Io8ky/8ogop/Ds4mM i9BuH27QyashEIOvyUSSEVzK5bfw2xkw67sfL3r/z5XJYEBjRNvB6E0lJsugRtWdx92G BJww== 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=hsXOlnLS; 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 oq8-20020a170906cc8800b008d360c1f74csi7550603ejb.772.2023.02.26.19.23.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 19:23:32 -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=hsXOlnLS; 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 66AB63851ABE for ; Mon, 27 Feb 2023 03:23:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from s01.bc.larksuite.com (s01.bc.larksuite.com [209.127.230.13]) by sourceware.org (Postfix) with UTF8SMTPS id 8FF063858D1E for ; Mon, 27 Feb 2023 03:23:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8FF063858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oss.cipunited.com Authentication-Results: sourceware.org; spf=pass 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=1677468176; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=cWbExolzO0JPEM6VRwDiJM2zHbL8C39byFEgtoNYwOA=; b=hsXOlnLS4iqkSwLj795VRpdu/8PAQrZB3XKcuklJsN+uQWBvcAE+nkwvrYgPnwL9zUSyE0 mIgTcfuY6QabZT2jz3oNkc38rzNMHdQ+cgU4DPfeqGKMVrOsCdbkFN+zqH+u6st0rpO08C a6YrkpVC+mf9dbnSJlBIDtrS3FERlXLvWElZDx1I4YMkBNcPMryF7K+96NT78XokPoQSkV CD+mcRessq+Aulp/Jitc3ZTW4jOiCoXn/9D0cKztVX1V/QFtc0BhrNQitVSc5GglZ+Jm0h C6pPk2fEBrF2Jt+XgXXPtUSkiIjODgJrFBNbmyrUE6s5bH/+CJxzGDInPjIc1A== To: Date: Mon, 27 Feb 2023 11:22:45 +0800 X-Lms-Return-Path: Cc: , "Junxian Zhu" Subject: [PATCH] MIPS: Add buildtime option to set msa default Message-Id: <20230227032223.176203-1-zhujunxian@oss.cipunited.com> From: "Junxian Zhu" Mime-Version: 1.0 X-Mailer: git-send-email 2.39.2 X-Original-From: "Junxian Zhu" X-Spam-Status: No, score=-13.0 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?1758952907650654259?= X-GMAIL-MSGID: =?utf-8?q?1758952907650654259?= 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..e3fcb63de0c 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-mmsa} 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