From patchwork Wed Jun 14 00:01:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: david@davidgf.es X-Patchwork-Id: 107631 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp899607vqr; Tue, 13 Jun 2023 17:03:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68L082iRPE/3rCtGpNgudtzpvA391GbVU1CP4MF5VSROBcNowOJJxQYii9igSk+LPTfc2y X-Received: by 2002:a17:907:9617:b0:974:1f03:fcd1 with SMTP id gb23-20020a170907961700b009741f03fcd1mr13410428ejc.3.1686701014265; Tue, 13 Jun 2023 17:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686701014; cv=none; d=google.com; s=arc-20160816; b=xE0Ezf5DTpA6AWHv88om82tc2JLNzmCwZ+xvTB3SWxjhvNg4hEM5ebnz8H4LIL8+IJ BLL6+JFhbpdFzd1P5qSuN7arqE5gpZYGNa1eOYJ/zJQig8z5PSmrPk7PjzCNUialysEY 4cIeWQrZccNJASkXJymzyCciJNcq417oB4nI5KF5AqRThJeq5Lu4zS0yIxE4C4bXEvKS pVwVB88WxBunP6P1B2PJJZf/6UCO1svhSpyyvE/3PPYSOYgqspyNoTH5V7fLBAU760op YiJAK28/7ihqTMR8y+c3AhbPMaip5kXb0q98rUGYlqJb8DLjeSXA+trYCcaXabDtRfeV em3Q== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=1Ku7Z/qnp8AOtndvRTkMXDZowwP0QIpA7RvHbTOA3jY=; b=0u6GMada3GVolpDisxjlKaLGTu6GluSDI0WzbsfGzzJ3c7jBQkNIClzmadGxVSEv2g 18scu17OzzyHzU3F6Uq5jeqHYvgo+xfkZXWmlx00hVhcLgywRsDHgS+1EojtrKCE8eiG WBryCelIZEXkhVjfKYRO35bYYMnwiGhvSe/DadnGg9QlqASz2SYR+tdyY81KAqeN5n8J cPmNmMoxVq1axiQYYfMfkn4wSEPaMhN+i2R43pipOKXNPx4UcimojHn+xaTM7VZAl8fu kXs1UI3Ox9CpxZYH4kuhJM8gXxI422XBNYC618wQZjTVSNVoWPBivaJcFG+uzpqOt4Cp bryg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@davidgf-es.20221208.gappssmtp.com header.s=20221208 header.b=tVX0yj7Y; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cb25-20020a170906a45900b00977cde1d9e2si3763791ejb.503.2023.06.13.17.03.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 17:03:34 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.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=pass header.i=@davidgf-es.20221208.gappssmtp.com header.s=20221208 header.b=tVX0yj7Y; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 96CEC3857704 for ; Wed, 14 Jun 2023 00:02:34 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 1D88D3858C52 for ; Wed, 14 Jun 2023 00:01:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D88D3858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=davidgf.es Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=davidgf.es Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f736e0c9b1so1349615e9.3 for ; Tue, 13 Jun 2023 17:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidgf-es.20221208.gappssmtp.com; s=20221208; t=1686700913; x=1689292913; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1Ku7Z/qnp8AOtndvRTkMXDZowwP0QIpA7RvHbTOA3jY=; b=tVX0yj7YaDy97AcA1qh6XWJ7Xf+7qaM82Zh5A3FaxDq3fnHgEOWINUvMkSHTCoT5j8 TfL4YETR9yluAbesQQ3OLislxxDIOmTjGl1mI5uWkQTxvhf3kySyCoxnAw7KeDWdhoDK F9WEfloRj+jV+cvHnx/9K36JwYDH2UnZfpPED2mboV6s656TbvT3ubSzotymy2yWTKYv uJFtcnsD5UhhA6Jawt3EufZ4OwY0FLhjw4v/rrzkfA/jBjmNlqVKW8dF7z3v7+IY1zlo fbQUQOl9/8FWrYkm8RaX4caAsHmb3myZZboSQHWLfnyr+RjPoTpiR9hezpPrF8fe3rE6 88aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686700913; x=1689292913; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Ku7Z/qnp8AOtndvRTkMXDZowwP0QIpA7RvHbTOA3jY=; b=W0UH3s9HqX56BaPGjnGy1VVYbjqPu+e9JbzKr7Oz3JhEizlMSr+IAOn01dEE5GQvWn GJfpdqzSNj/nJMkm/E7lgCt/oEcpWi9CY947IG2cz/fjob1i9fPFqb9MFh0mO9wXTQmf u1D9PS4kV+Ua1nAsFT9UMHX9t9hh17eisdEtcPgm64wgTPRp8O8FCVcPJopALs1bUjb8 irb9i2yOp9mRHnz8naABADO8NFcGVF58WLyNcgLl6GGlfrkSP8ri9SbgfbqwTwvr6HYo dsqXJoRV3Pj1wbEEReqL6bH0/VdDnbzHUF/WcGLlGqunXX0LqcmQhmiBI8B7qMRFyH+v Vm5A== X-Gm-Message-State: AC+VfDyaUVnamoeDBt9EXoEx9+0N81dKYi6nl6bnkwMeb9lcKSbHaaTg VfsHCvIEwwhs2CX0uQWnwocJTp/9Vigc6fs6dw== X-Received: by 2002:a5d:684a:0:b0:30f:befc:d864 with SMTP id o10-20020a5d684a000000b0030fbefcd864mr6514751wrw.62.1686700912814; Tue, 13 Jun 2023 17:01:52 -0700 (PDT) Received: from localhost.localdomain ([37.17.237.79]) by smtp.gmail.com with ESMTPSA id p17-20020a1c7411000000b003f7e4639aabsm15726702wmc.10.2023.06.13.17.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 17:01:52 -0700 (PDT) From: david@davidgf.es To: binutils@sourceware.org Cc: David Guillen Fandos Subject: [PATCH v2 2/3] Add rotation instructions to MIPS Allegrex CPU Date: Wed, 14 Jun 2023 02:01:47 +0200 Message-Id: <20230614000148.10989-3-david@davidgf.es> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230614000148.10989-1-david@davidgf.es> References: <20230614000148.10989-1-david@davidgf.es> MIME-Version: 1.0 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_SOFTFAIL, 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-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768634202497317990?= X-GMAIL-MSGID: =?utf-8?q?1768634202497317990?= From: David Guillen Fandos The Allegrex CPU supports bit rotation instructions as described in the MIPS32 release 2 CPU (even though it is a MIPS-2 based CPU). Signed-off-by: David Guillen Fandos --- gas/config/tc-mips.c | 2 +- opcodes/mips-opc.c | 14 +++++++------- gas/testsuite/gas/mips/mips.exp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 3c42d59e5b..d46a427503 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -526,7 +526,7 @@ static int mips_32bitmode = 0; #define CPU_HAS_DROR(CPU) ((CPU) == CPU_VR5400 || (CPU) == CPU_VR5500) /* True if CPU has a ror instruction. */ -#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU) +#define CPU_HAS_ROR(CPU) (CPU_HAS_DROR (CPU) || (CPU) == CPU_ALLEGREX) /* True if CPU is in the Octeon family. */ #define CPU_IS_OCTEON(CPU) ((CPU) == CPU_OCTEON || (CPU) == CPU_OCTEONP \ diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c index ec897029af..9375ba3318 100644 --- a/opcodes/mips-opc.c +++ b/opcodes/mips-opc.c @@ -1810,13 +1810,13 @@ const struct mips_opcode mips_builtin_opcodes[] = {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1, 0, 0 }, {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1, 0, 0 }, {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1, 0, 0 }, -{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_1|RD_2, 0, N5|I33, SMT, 0 }, -{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, WR_1|RD_2|RD_3, 0, N5|I33, SMT, 0 }, -{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33, SMT, 0 }, -{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33, SMT, 0 }, -{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33, SMT, 0 }, -{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33, SMT, 0 }, -{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, WR_1|RD_2|RD_3, 0, I33, SMT, 0 }, +{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_1|RD_2, 0, N5|I33|AL, SMT, 0 }, +{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, WR_1|RD_2|RD_3, 0, N5|I33|AL, SMT, 0 }, +{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|AL, SMT, 0 }, +{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|AL, SMT, 0 }, +{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|AL, SMT, 0 }, +{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|AL, SMT, 0 }, +{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, WR_1|RD_2|RD_3, 0, I33|AL, SMT, 0 }, {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_1|RD_2|FP_D, 0, I3_33, 0, 0 }, {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_1|RD_2|FP_S|FP_D, 0, I3_33, 0, 0 }, {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_1|RD_2|FP_S|FP_D, 0, I2, 0, SF }, diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index 6dbf2e3746..f4137c5640 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -517,7 +517,7 @@ mips_arch_create r3000 32 mips1 {} \ mips_arch_create r3900 32 mips1 { gpr_ilocks } \ { -march=r3900 -mtune=r3900 } { -mmips:3900 } \ { mipstx39-*-* mipstx39el-*-* } -mips_arch_create allegrex 32 mips2 { oddspreg singlefloat } \ +mips_arch_create allegrex 32 mips2 { oddspreg ror singlefloat } \ { -march=allegrex -mtune=allegrex } \ { -mmips:allegrex } mips_arch_create r4000 64 mips3 {} \