From patchwork Wed May 24 09:41:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5qKF5p2w?= X-Patchwork-Id: 98419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2718808vqo; Wed, 24 May 2023 02:47:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ZNFe+9eMJdVGyGx4dngnCsdMa8QFrE/U7rO3hG95XiwSbOhBCh0HMRPsjuVWD0W7Nc3gM X-Received: by 2002:a05:6402:10d9:b0:50d:9b59:4336 with SMTP id p25-20020a05640210d900b0050d9b594336mr1296714edu.37.1684921634004; Wed, 24 May 2023 02:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684921633; cv=none; d=google.com; s=arc-20160816; b=jpvnBAsZVo7lH3igoeUqr5lPF+qk6Q5W+bxve9GyixsFqyi+Srvo23OnjJKSNV3Kr7 wq+z66Z9ZXxZddbqfzQA1d85Lx4/aGWFjjBjZ/pTDlQ441nVhVGg4us1EcVV47IXlbFf Smo3p8e9jMVm/JJd1cLWzRW7fk2h1EVXCOmRiiJUKLhxfBKN/y4VGx+gooFx4pA/Jaqw 0vex71wt3fBeShDm+6cZYjYvDHhvtCI8/7v9/gka49fokgs2QQPwr1usJNSufy8mP4bE yo7DBrecpE6PYuD+3O3drgPRFahdd2VFnO/NxpSAwvvFBY0IQH2w4uXbdm/I7drj7P07 xZWg== 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 :references:mime-version:subject:message-id:date:cc:to:from :in-reply-to:dkim-signature:dmarc-filter:delivered-to; bh=JVWwweiufa/7XvHrODlVRkYTzpNjT8TNDFKy+qsSvQg=; b=tojWwIHR1Lc6i8EmX/baIqMTkIDKrOwfLfIbvm9fPkz6JMmkKCGin1xFacAv3SDnzr LNf3y1Ko52+31/pNRm03BT8wzD8uHzoXZ0+Jrpp0fwy3TPUVnE4Vhr1hlh344vEcKUB6 uto1HgbYoiAsAVh5Ro3YJK+tVAWlMxQC4rjKWIpybYCrBt93hnvwnKkj140QkLZecuu4 kK7ABK0X5ZpliJWO/T6uMg+C/PT/za/8hZZ9OpC9zaZFfSWTntzDr/yFw5dwdQFoVAWo aL0qxKJxryIcMTsJO88rciXeexLNVS5GkxeAxIBvDTsJCNxCNVXXF1hwgBuGZ+lLRHld jypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@oss.cipunited.com header.s=feishu2303200042 header.b=E9bC8tmd; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d1-20020a50ea81000000b005126ee9207esi6351433edo.17.2023.05.24.02.47.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 02:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@oss.cipunited.com header.s=feishu2303200042 header.b=E9bC8tmd; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 4C8AE38323F2 for ; Wed, 24 May 2023 09:43:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from t03.bc.larksuite.com (t03.bc.larksuite.com [209.127.231.32]) by sourceware.org (Postfix) with UTF8SMTPS id 2AE233855592 for ; Wed, 24 May 2023 09:41:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2AE233855592 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=feishu2303200042; d=oss.cipunited.com; t=1684921282; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=TS5b1AxnfgpM4aOXURfTfnUkUvv4H66apMkmYY0fmmE=; b=E9bC8tmdO7i5HRRoHYRUU0Nsh8mgBnHC6hzX+SJm0Mz+aOXP2ExrSaHDtQe3DNaTPmr8LL XAQTNifyIfpnKkIjwZ6l3aBNuRBO7XXF3fZ6Xes+b8bRhJo/5BwTP40wp3+1Lp2yNNnvDA hGn76CNlTOXxgMinoIPXuzyUWSqOJv8d5nPLIWhwsOlCSImM+udiu7yN4DOEQMCdAGfben ysQFM8O++6xraYG9XVQjgA10SJzIdSOCnx7Eye1v2fVu+zD9bBy6YUHLCrWCsPUfLxXW9B WkFL6nLGctRBBjfaco9dm8khetlIus+OrboTuk1BW7YvVREQ0jSUm/du0VV/xQ== In-Reply-To: From: "Jie Mei" X-Lms-Return-Path: To: Cc: "YunQiang Su" , "Maciej W . Rozycki" Date: Wed, 24 May 2023 17:41:21 +0800 Message-Id: <0ac6b0c13cfd5465a6ce38a5f04fc172e4ffb7da.1684918169.git.jie.mei@oss.cipunited.com> Subject: [PATCH v3 7/9] MIPS: Use ISA_HAS_9BIT_DISPLACEMENT for mips16e2 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1 References: X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_ADSP_NXDOMAIN, DKIM_INVALID, DKIM_SIGNED, GIT_PATCH_0, HTML_MESSAGE, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NO_DNS_FOR_FROM, SPF_HELO_NONE, SPF_NONE, 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-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?1766768387191031792?= X-GMAIL-MSGID: =?utf-8?q?1766768387191031792?= The MIPS16e2 ASE has PREF, LL and SC instructions, they use 9 bits immediate, like mips32r6. The MIPS32 PRE-R6 uses 16 bits immediate. gcc/ChangeLog: * config/mips/mips.h(ISA_HAS_9BIT_DISPLACEMENT): Add clause for ISA_HAS_MIPS16E2. (ISA_HAS_SYNC): Same as above. (ISA_HAS_LL_SC): Same as above. --- gcc/config/mips/mips.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index b6c100060da..f50b279af33 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -1247,7 +1247,8 @@ struct mips_cpu_info { && !TARGET_MIPS16) /* ISA has data prefetch, LL and SC with limited 9-bit displacement. */ -#define ISA_HAS_9BIT_DISPLACEMENT (mips_isa_rev >= 6) +#define ISA_HAS_9BIT_DISPLACEMENT (mips_isa_rev >= 6 \ + || ISA_HAS_MIPS16E2) /* ISA has data indexed prefetch instructions. This controls use of 'prefx', along with TARGET_HARD_FLOAT and TARGET_DOUBLE_FLOAT. @@ -1340,7 +1341,8 @@ struct mips_cpu_info { #define ISA_HAS_SYNCI (mips_isa_rev >= 2 && !TARGET_MIPS16) /* ISA includes sync. */ -#define ISA_HAS_SYNC ((mips_isa >= MIPS_ISA_MIPS2 || TARGET_MIPS3900) && !TARGET_MIPS16) +#define ISA_HAS_SYNC ((mips_isa >= MIPS_ISA_MIPS2 || TARGET_MIPS3900) \ + && (!TARGET_MIPS16 || ISA_HAS_MIPS16E2)) #define GENERATE_SYNC \ (target_flags_explicit & MASK_LLSC \ ? TARGET_LLSC && !TARGET_MIPS16 \ @@ -1349,7 +1351,8 @@ struct mips_cpu_info { /* ISA includes ll and sc. Note that this implies ISA_HAS_SYNC because the expanders use both ISA_HAS_SYNC and ISA_HAS_LL_SC instructions. */ -#define ISA_HAS_LL_SC (mips_isa >= MIPS_ISA_MIPS2 && !TARGET_MIPS5900 && !TARGET_MIPS16) +#define ISA_HAS_LL_SC (mips_isa >= MIPS_ISA_MIPS2 && !TARGET_MIPS5900 \ + && (!TARGET_MIPS16 || ISA_HAS_MIPS16E2)) #define GENERATE_LL_SC \ (target_flags_explicit & MASK_LLSC \ ? TARGET_LLSC && !TARGET_MIPS16 \