From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id DC8663858C39 for ; Thu, 7 Oct 2021 04:05:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC8663858C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-io1-xd30.google.com with SMTP id p80so5215458iod.10 for ; Wed, 06 Oct 2021 21:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wtXGjqtIGtgIC8sQY2OQ+N7Dn7RLVuPsAubhUa/Pld4=; b=GR/ZzACLzrbswspdDhegynT0ASsXLDbjSuvR0UvVsVxvv3GQ6uMy3OaofLslK+vKVK V+3pltEDcMAQ25RqJ79E3Raz0+OBD+wsY2aMtILX6/OewJC2G2go3POCF5vdPSzFbi+y YJtuV8N27U7OOV12PIz0lJ3w/FZITFQy0r76A/3jAjfERMWuo7EaUcA+CNaxUh0d2IGF E5BqWH6KpAQH3IY543C6adDC4hfNarXs28JQEcV3UfZx7jcbBgsBt7qaX4OoBD9YZ1vC 5vRJ5b4p56+LC3EUJT+Gi3SLDtY2FG7cx/eqwdWIshUwQ1k10nWistmlvhtQ42HuquR7 zk7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wtXGjqtIGtgIC8sQY2OQ+N7Dn7RLVuPsAubhUa/Pld4=; b=nrfR1bQKKVeLBA5gMZnRXY0OF/AHHTTdpQLbZT6le1JQx1shLtDQfX8Fin7mERNTL6 pdIrst3+kCdIxU5Rm/CsZWxoEPM9jL3eS12rBJU7RZK98nU4QtIhGcuppHs/DrVzgn5w gkvAMhfo2Sm2AUTDEZMwH8PhchJ/JL4dtiXGWRzf3I2PqI677XqukZ1vHiFDEgVbvYqd yAyT4CeMGonuprF1fwzuDZMYVQKyGWufqA+Ur5OXzZ3oDWsBERx7Q4rPus5cqRp6pOQ9 DzgCQ8EQXUemi9HCnDEc++0oom4UJNxTrMO7QF0Aa4G2vnObB8dT70GFfEl607GYK2zE k7bg== X-Gm-Message-State: AOAM532B+pdH6CZvr5OdQy51qzy+3CN1tdTPOhrh8q+Qcw7WOcn2lPGO NfdY6fwh7izIAhMZrqNK7QETvJJw8hNsTiIU/V5dmA== X-Google-Smtp-Source: ABdhPJyTIGCu4grDE/m3zhAZGU+ppRmjnNAYCTJLNaGD7FiHA5C9K51yaY4mxqLIQcP7nKF/XcZm6RMnH+na0XjasgM= X-Received: by 2002:a02:19c8:: with SMTP id b191mr1244319jab.10.1633579556094; Wed, 06 Oct 2021 21:05:56 -0700 (PDT) MIME-Version: 1.0 References: <20211006202647.328777-1-philipp.tomsich@vrull.eu> <20211006202647.328777-4-philipp.tomsich@vrull.eu> In-Reply-To: <20211006202647.328777-4-philipp.tomsich@vrull.eu> From: Nelson Chu Date: Thu, 7 Oct 2021 12:05:46 +0800 Message-ID: Subject: Re: [PATCH v3 4/4] RISC-V: Support aliases for Zbs instructions To: Philipp Tomsich Cc: Binutils , Kito Cheng Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , X-List-Received-Date: Thu, 07 Oct 2021 04:05:59 -0000 LGTM. Do you have binutils write access? If so, then please commit the four rvb patches when you think it is time. Or let me know if you don't have, I can commit the patches. Anyway, Thanks for helping the rvb stuff, we do need these. Nelson On Thu, Oct 7, 2021 at 4:28 AM Philipp Tomsich wrote: > > Add aliases for the non-immediate mnemonics of b{set,clr,inv,ext} to > yencode the respective immediate insn b{set,clr,inv,ext}i when the > second source operand is an immediate. > > 2021-01-11 Philipp Tomsich > > gas/ > * testsuite/gas/riscv/b-ext.d: Add tests. > * testsuite/gas/riscv/b-ext.s: Likewise. > * testsuite/gas/riscv/b-ext-64.d: Likewise. > * testsuite/gas/riscv/b-ext-64.s: Likewise. > opcodes/ > * riscv-opc.c (riscv_opcodes): Add aliases for Zbs. > > Suggested-by: Jan Beulich > Signed-off-by: Philipp Tomsich > > --- > > (no changes since v2) > > Changes in v2: > - Add aliases for the b{set,clr,inv,ext} when called with an immediate > as a second source operand. > > gas/testsuite/gas/riscv/b-ext-64.d | 8 ++++++++ > gas/testsuite/gas/riscv/b-ext-64.s | 9 +++++++++ > gas/testsuite/gas/riscv/b-ext.d | 4 ++++ > gas/testsuite/gas/riscv/b-ext.s | 5 +++++ > opcodes/riscv-opc.c | 4 ++++ > 5 files changed, 30 insertions(+) > > diff --git a/gas/testsuite/gas/riscv/b-ext-64.d b/gas/testsuite/gas/riscv/b-ext-64.d > index 339fa20a367..9b6e6b7ab2a 100644 > --- a/gas/testsuite/gas/riscv/b-ext-64.d > +++ b/gas/testsuite/gas/riscv/b-ext-64.d > @@ -62,3 +62,11 @@ Disassembly of section .text: > [ ]+[0-9a-f]+:[ ]+28c59533[ ]+bset[ ]+a0,a1,a2 > [ ]+[0-9a-f]+:[ ]+68c59533[ ]+binv[ ]+a0,a1,a2 > [ ]+[0-9a-f]+:[ ]+48c5d533[ ]+bext[ ]+a0,a1,a2 > +[ ]+[0-9a-f]+:[ ]+49f59513[ ]+bclri[ ]+a0,a1,0x1f > +[ ]+[0-9a-f]+:[ ]+29f59513[ ]+bseti[ ]+a0,a1,0x1f > +[ ]+[0-9a-f]+:[ ]+69f59513[ ]+binvi[ ]+a0,a1,0x1f > +[ ]+[0-9a-f]+:[ ]+49f5d513[ ]+bexti[ ]+a0,a1,0x1f > +[ ]+[0-9a-f]+:[ ]+4bf59513[ ]+bclri[ ]+a0,a1,0x3f > +[ ]+[0-9a-f]+:[ ]+2bf59513[ ]+bseti[ ]+a0,a1,0x3f > +[ ]+[0-9a-f]+:[ ]+6bf59513[ ]+binvi[ ]+a0,a1,0x3f > +[ ]+[0-9a-f]+:[ ]+4bf5d513[ ]+bexti[ ]+a0,a1,0x3f > diff --git a/gas/testsuite/gas/riscv/b-ext-64.s b/gas/testsuite/gas/riscv/b-ext-64.s > index 8ceb2b4fd1c..57e501e9a41 100644 > --- a/gas/testsuite/gas/riscv/b-ext-64.s > +++ b/gas/testsuite/gas/riscv/b-ext-64.s > @@ -53,3 +53,12 @@ target: > bset a0, a1, a2 > binv a0, a1, a2 > bext a0, a1, a2 > + #aliases > + bclr a0, a1, 31 > + bset a0, a1, 31 > + binv a0, a1, 31 > + bext a0, a1, 31 > + bclr a0, a1, 63 > + bset a0, a1, 63 > + binv a0, a1, 63 > + bext a0, a1, 63 > diff --git a/gas/testsuite/gas/riscv/b-ext.d b/gas/testsuite/gas/riscv/b-ext.d > index 748c218fdd0..c1c5f918a84 100644 > --- a/gas/testsuite/gas/riscv/b-ext.d > +++ b/gas/testsuite/gas/riscv/b-ext.d > @@ -45,3 +45,7 @@ Disassembly of section .text: > [ ]+[0-9a-f]+:[ ]+28c59533[ ]+bset[ ]+a0,a1,a2 > [ ]+[0-9a-f]+:[ ]+68c59533[ ]+binv[ ]+a0,a1,a2 > [ ]+[0-9a-f]+:[ ]+48c5d533[ ]+bext[ ]+a0,a1,a2 > +[ ]+[0-9a-f]+:[ ]+49f59513[ ]+bclri[ ]+a0,a1,0x1f > +[ ]+[0-9a-f]+:[ ]+29f59513[ ]+bseti[ ]+a0,a1,0x1f > +[ ]+[0-9a-f]+:[ ]+69f59513[ ]+binvi[ ]+a0,a1,0x1f > +[ ]+[0-9a-f]+:[ ]+49f5d513[ ]+bexti[ ]+a0,a1,0x1f > diff --git a/gas/testsuite/gas/riscv/b-ext.s b/gas/testsuite/gas/riscv/b-ext.s > index a13a797f0dc..9de3fc32806 100644 > --- a/gas/testsuite/gas/riscv/b-ext.s > +++ b/gas/testsuite/gas/riscv/b-ext.s > @@ -36,3 +36,8 @@ target: > bset a0, a1, a2 > binv a0, a1, a2 > bext a0, a1, a2 > + #aliases > + bclr a0, a1, 31 > + bset a0, a1, 31 > + binv a0, a1, 31 > + bext a0, a1, 31 > diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c > index 1a4c9f0e4fe..b756bae64ab 100644 > --- a/opcodes/riscv-opc.c > +++ b/opcodes/riscv-opc.c > @@ -839,9 +839,13 @@ const struct riscv_opcode riscv_opcodes[] = > {"binvi", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BINVI, MASK_BINVI, match_opcode, 0 }, > {"bexti", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BEXTI, MASK_BEXTI, match_opcode, 0 }, > {"bclr", 0, INSN_CLASS_ZBS, "d,s,t", MATCH_BCLR, MASK_BCLR, match_opcode, 0 }, > +{"bclr", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BCLRI, MASK_BCLRI, match_opcode, INSN_ALIAS }, > {"bset", 0, INSN_CLASS_ZBS, "d,s,t", MATCH_BSET, MASK_BSET, match_opcode, 0 }, > +{"bset", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BSETI, MASK_BSETI, match_opcode, INSN_ALIAS }, > {"binv", 0, INSN_CLASS_ZBS, "d,s,t", MATCH_BINV, MASK_BINV, match_opcode, 0 }, > +{"binv", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BINVI, MASK_BINVI, match_opcode, INSN_ALIAS }, > {"bext", 0, INSN_CLASS_ZBS, "d,s,t", MATCH_BEXT, MASK_BEXT, match_opcode, 0 }, > +{"bext", 0, INSN_CLASS_ZBS, "d,s,>", MATCH_BEXTI, MASK_BEXTI, match_opcode, INSN_ALIAS }, > > /* Terminate the list. */ > {0, 0, INSN_CLASS_NONE, 0, 0, 0, 0, 0} > -- > 2.25.1 >