From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by sourceware.org (Postfix) with ESMTPS id 95CB13858C20 for ; Tue, 29 Nov 2022 08:10:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 95CB13858C20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-142612a5454so16123007fac.2 for ; Tue, 29 Nov 2022 00:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gShqpQ+TK+Qh3qK1Lrr1QpT6dPukz6FLiUA6FHtxG2c=; b=I+OyQwKPuJRLwdDEPKJ8EgvhF/Awvb7HBiByPkioIq94Acwp6Efdm/dbQsZTiCpxB0 BTkar+IlMcGyPGh60rZatQzt0wdqHnXS2JkcL6ZGgqDs2lw9eK9JVi5Ej5poWlXeXm7Z 8AJ9KSUzai8AsSMlYwXTCabt8Dhd7J5pcS2uuAoQ5rhDY2IZHG+0dbwgvjRitffo/XkH 6U2ifq7F3fOb/ubUgKEAH7Amx1kh86/kQzU8AKiSg/08u6/59Vs0pNar9Z84fNstbKiK +b+Ib4hXR/oWArXrbtrPhbW7Eo2xyXaAt2V2Vf8mTrjvjWvjdt0dNN1qjaKrbHa58bb1 Wk9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gShqpQ+TK+Qh3qK1Lrr1QpT6dPukz6FLiUA6FHtxG2c=; b=6lfPdoszUFqL0qjIiJQuXKGCpoNvACyVRjuxi44V1j6p3x25pVQgqp/uKuLZ7RO6xx s/A+BmxgMGnHIoQMGyY9z07f1JXqEmI//EfhqTVtm+nuw98Up4XCy/thEQZtsfYBj/ul IxviPb8ehqsWAj3NztCicAebFwPLNkTtEWog/6gON+jrZXRtGZ9YsVlrsd3V/ntITree WAYdcZ5wsGYpFG0aGnyYlJdat8MRm7MVGo4j7RAVXHXDiLNVlJCqwdB09kCL/Zf5XdA0 FuKjXLCErZ6eABMTxrqqS3gdiurI56NzKGi3LFBNynIbPa0O+VYuRFPDwhVE9keGE/Du tmXA== X-Gm-Message-State: ANoB5pkkCzBZgVy32TVw5ZmML3KwCXYEFUX2RkAg5sbj8y5OnaDNA5Ll 5n3lUhfvpFGyNeZKIkPgkJGVa+sGirBXaemTir6zJw== X-Google-Smtp-Source: AA0mqf6ZCX+EreZ8wIONqITWNSactdfXXx+fTLKftfTySJXy7E3zmQuzCxodE6QO258xxEKJrFwefGrb8KP4+R9Yr5U= X-Received: by 2002:a05:6870:808c:b0:142:b3c0:5099 with SMTP id q12-20020a056870808c00b00142b3c05099mr21583363oab.107.1669709422742; Tue, 29 Nov 2022 00:10:22 -0800 (PST) MIME-Version: 1.0 References: <7311ed3d2429000e18877d7af594890da170a7a3.1667651354.git.research_trasio@irq.a4lg.com> In-Reply-To: <7311ed3d2429000e18877d7af594890da170a7a3.1667651354.git.research_trasio@irq.a4lg.com> From: Nelson Chu Date: Tue, 29 Nov 2022 16:10:11 +0800 Message-ID: Subject: Re: [PATCH 06/12] RISC-V: Reorganize/enhance {sign,zero}-extension instructions To: Tsukasa OI Cc: Kito Cheng , Palmer Dabbelt , binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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 List-Id: This is not what I expected... What I expect is that we just have a .s file for those instructions, and then just use ".option arch" to generate the mapping symbols to let dis-assembler dumps the right things. Although you may think that rv32 and rv64 in the same file looks weird, but according to the purpose of the .option arch, this should be allowed, so... From my side, you are not tidying the test cases, defining lots of symbols by -defsym and macros by *.inc file make things more complicated. What I worry is that except you, it's too complicated for others to add test cases, so your new rules aren't convenient, it not only increases the difficulty for everyone to develop, but also increases the cost of maintenance... So again, I disagree and suggest not to add these kinds of support. Nelson On Sat, Nov 5, 2022 at 8:30 PM Tsukasa OI wrote: > > This commit: > > - Clarifies the roles of {sign,zero}-extension instruction tests, > - Shortens ".s" file using macro, > - Enhances the tests with 'Zba' and 'Zbb' extensions and > - Makes some tidying (e.g. making matching patterns stricter). > > gas/ChangeLog: > > * testsuite/gas/riscv/ext-insn.s: Reorganize based on ext.s. > * testsuite/gas/riscv/ext-insn-32-noalias.d: Based on ext-32.d. > Make matching pattern stricter. > * testsuite/gas/riscv/ext-insn-64-noalias.d: Based on ext-64.d. > Make matching pattern stricter. > * testsuite/gas/riscv/ext-insn-32-noarch.d: New failure test. > * testsuite/gas/riscv/ext-insn-32-noarch.l: Likewise. > * testsuite/gas/riscv/ext-insn-64-noarch.d: New test to make sure > that NOARCH=1 does not make errors since all opcodes are valid. > * testsuite/gas/riscv/ext-insn-zba-32-noalias.d: Test with 'Zba'. > * testsuite/gas/riscv/ext-insn-zba-64-noalias.d: Likewise. > * testsuite/gas/riscv/ext-insn-zbb-32-noalias.d: Test with 'Zbb'. > * testsuite/gas/riscv/ext-insn-zbb-64-noalias.d: Likewise. > * testsuite/gas/riscv/ext.s: Removed. > * testsuite/gas/riscv/ext-32.d: Removed. > * testsuite/gas/riscv/ext-64.d: Removed. > --- > gas/testsuite/gas/riscv/ext-32.d | 39 -------------- > gas/testsuite/gas/riscv/ext-64.d | 51 ------------------- > gas/testsuite/gas/riscv/ext-insn-32-noalias.d | 39 ++++++++++++++ > gas/testsuite/gas/riscv/ext-insn-32-noarch.d | 3 ++ > gas/testsuite/gas/riscv/ext-insn-32-noarch.l | 9 ++++ > gas/testsuite/gas/riscv/ext-insn-64-noalias.d | 51 +++++++++++++++++++ > gas/testsuite/gas/riscv/ext-insn-64-noarch.d | 5 ++ > .../gas/riscv/ext-insn-zba-32-noalias.d | 39 ++++++++++++++ > .../gas/riscv/ext-insn-zba-64-noalias.d | 47 +++++++++++++++++ > .../gas/riscv/ext-insn-zbb-32-noalias.d | 27 ++++++++++ > .../gas/riscv/ext-insn-zbb-64-noalias.d | 39 ++++++++++++++ > gas/testsuite/gas/riscv/ext-insn.s | 23 +++++++++ > gas/testsuite/gas/riscv/ext.s | 38 -------------- > 13 files changed, 282 insertions(+), 128 deletions(-) > delete mode 100644 gas/testsuite/gas/riscv/ext-32.d > delete mode 100644 gas/testsuite/gas/riscv/ext-64.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-32-noalias.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-32-noarch.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-32-noarch.l > create mode 100644 gas/testsuite/gas/riscv/ext-insn-64-noalias.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-64-noarch.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d > create mode 100644 gas/testsuite/gas/riscv/ext-insn.s > delete mode 100644 gas/testsuite/gas/riscv/ext.s > > diff --git a/gas/testsuite/gas/riscv/ext-32.d b/gas/testsuite/gas/riscv/ext-32.d > deleted file mode 100644 > index 97daa31d0e9..00000000000 > --- a/gas/testsuite/gas/riscv/ext-32.d > +++ /dev/null > @@ -1,39 +0,0 @@ > -#as: -march=rv32i > -#source: ext.s > -#objdump: -d > - > -.*:[ ]+file format .* > - > - > -Disassembly of section .text: > - > -0+000 : > -[ ]+0:[ ]+0ff57513[ ]+zext.b[ ]+a0,a0 > -[ ]+4:[ ]+01051513[ ]+sll[ ]+a0,a0,0x10 > -[ ]+8:[ ]+01055513[ ]+srl[ ]+a0,a0,0x10 > -[ ]+c:[ ]+01851513[ ]+sll[ ]+a0,a0,0x18 > -[ ]+10:[ ]+41855513[ ]+sra[ ]+a0,a0,0x18 > -[ ]+14:[ ]+01051513[ ]+sll[ ]+a0,a0,0x10 > -[ ]+18:[ ]+41055513[ ]+sra[ ]+a0,a0,0x10 > -[ ]+1c:[ ]+0ff67593[ ]+zext.b[ ]+a1,a2 > -[ ]+20:[ ]+01061593[ ]+sll[ ]+a1,a2,0x10 > -[ ]+24:[ ]+0105d593[ ]+srl[ ]+a1,a1,0x10 > -[ ]+28:[ ]+01861593[ ]+sll[ ]+a1,a2,0x18 > -[ ]+2c:[ ]+4185d593[ ]+sra[ ]+a1,a1,0x18 > -[ ]+30:[ ]+01061593[ ]+sll[ ]+a1,a2,0x10 > -[ ]+34:[ ]+4105d593[ ]+sra[ ]+a1,a1,0x10 > -[ ]+38:[ ]+0ff57513[ ]+zext.b[ ]+a0,a0 > -[ ]+3c:[ ]+0542[ ]+sll[ ]+a0,a0,0x10 > -[ ]+3e:[ ]+8141[ ]+srl[ ]+a0,a0,0x10 > -[ ]+40:[ ]+0562[ ]+sll[ ]+a0,a0,0x18 > -[ ]+42:[ ]+8561[ ]+sra[ ]+a0,a0,0x18 > -[ ]+44:[ ]+0542[ ]+sll[ ]+a0,a0,0x10 > -[ ]+46:[ ]+8541[ ]+sra[ ]+a0,a0,0x10 > -[ ]+48:[ ]+0ff67593[ ]+zext.b[ ]+a1,a2 > -[ ]+4c:[ ]+01061593[ ]+sll[ ]+a1,a2,0x10 > -[ ]+50:[ ]+81c1[ ]+srl[ ]+a1,a1,0x10 > -[ ]+52:[ ]+01861593[ ]+sll[ ]+a1,a2,0x18 > -[ ]+56:[ ]+85e1[ ]+sra[ ]+a1,a1,0x18 > -[ ]+58:[ ]+01061593[ ]+sll[ ]+a1,a2,0x10 > -[ ]+5c:[ ]+85c1[ ]+sra[ ]+a1,a1,0x10 > -#... > diff --git a/gas/testsuite/gas/riscv/ext-64.d b/gas/testsuite/gas/riscv/ext-64.d > deleted file mode 100644 > index 1fe339c4af4..00000000000 > --- a/gas/testsuite/gas/riscv/ext-64.d > +++ /dev/null > @@ -1,51 +0,0 @@ > -#as: -march=rv64i -defsym __64_bit__=1 > -#source: ext.s > -#objdump: -d > - > -.*:[ ]+file format .* > - > - > -Disassembly of section .text: > - > -0+000 : > -[ ]+0:[ ]+0ff57513[ ]+zext.b[ ]+a0,a0 > -[ ]+4:[ ]+03051513[ ]+sll[ ]+a0,a0,0x30 > -[ ]+8:[ ]+03055513[ ]+srl[ ]+a0,a0,0x30 > -[ ]+c:[ ]+03851513[ ]+sll[ ]+a0,a0,0x38 > -[ ]+10:[ ]+43855513[ ]+sra[ ]+a0,a0,0x38 > -[ ]+14:[ ]+03051513[ ]+sll[ ]+a0,a0,0x30 > -[ ]+18:[ ]+43055513[ ]+sra[ ]+a0,a0,0x30 > -[ ]+1c:[ ]+0ff67593[ ]+zext.b[ ]+a1,a2 > -[ ]+20:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 > -[ ]+24:[ ]+0305d593[ ]+srl[ ]+a1,a1,0x30 > -[ ]+28:[ ]+03861593[ ]+sll[ ]+a1,a2,0x38 > -[ ]+2c:[ ]+4385d593[ ]+sra[ ]+a1,a1,0x38 > -[ ]+30:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 > -[ ]+34:[ ]+4305d593[ ]+sra[ ]+a1,a1,0x30 > -[ ]+38:[ ]+02051513[ ]+sll[ ]+a0,a0,0x20 > -[ ]+3c:[ ]+02055513[ ]+srl[ ]+a0,a0,0x20 > -[ ]+40:[ ]+0005051b[ ]+sext.w[ ]+a0,a0 > -[ ]+44:[ ]+02061593[ ]+sll[ ]+a1,a2,0x20 > -[ ]+48:[ ]+0205d593[ ]+srl[ ]+a1,a1,0x20 > -[ ]+4c:[ ]+0006059b[ ]+sext.w[ ]+a1,a2 > -[ ]+50:[ ]+0ff57513[ ]+zext.b[ ]+a0,a0 > -[ ]+54:[ ]+1542[ ]+sll[ ]+a0,a0,0x30 > -[ ]+56:[ ]+9141[ ]+srl[ ]+a0,a0,0x30 > -[ ]+58:[ ]+1562[ ]+sll[ ]+a0,a0,0x38 > -[ ]+5a:[ ]+9561[ ]+sra[ ]+a0,a0,0x38 > -[ ]+5c:[ ]+1542[ ]+sll[ ]+a0,a0,0x30 > -[ ]+5e:[ ]+9541[ ]+sra[ ]+a0,a0,0x30 > -[ ]+60:[ ]+0ff67593[ ]+zext.b[ ]+a1,a2 > -[ ]+64:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 > -[ ]+68:[ ]+91c1[ ]+srl[ ]+a1,a1,0x30 > -[ ]+6a:[ ]+03861593[ ]+sll[ ]+a1,a2,0x38 > -[ ]+6e:[ ]+95e1[ ]+sra[ ]+a1,a1,0x38 > -[ ]+70:[ ]+03061593[ ]+sll[ ]+a1,a2,0x30 > -[ ]+74:[ ]+95c1[ ]+sra[ ]+a1,a1,0x30 > -[ ]+76:[ ]+1502[ ]+sll[ ]+a0,a0,0x20 > -[ ]+78:[ ]+9101[ ]+srl[ ]+a0,a0,0x20 > -[ ]+7a:[ ]+2501[ ]+sext.w[ ]+a0,a0 > -[ ]+7c:[ ]+02061593[ ]+sll[ ]+a1,a2,0x20 > -[ ]+80:[ ]+9181[ ]+srl[ ]+a1,a1,0x20 > -[ ]+82:[ ]+0006059b[ ]+sext.w[ ]+a1,a2 > -#... > diff --git a/gas/testsuite/gas/riscv/ext-insn-32-noalias.d b/gas/testsuite/gas/riscv/ext-insn-32-noalias.d > new file mode 100644 > index 00000000000..237fcf033d0 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-32-noalias.d > @@ -0,0 +1,39 @@ > +#as: -march=rv32i -I$srcdir/$subdir -defsym XLEN=32 > +#source: ext-insn.s > +#objdump: -d -M no-aliases > + > +.*:[ ]+file format .* > + > + > +Disassembly of section .text: > + > +0+000 : > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+01051513[ ]+slli[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+01055513[ ]+srli[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+01851513[ ]+slli[ ]+a0,a0,0x18 > +[ ]+[0-9a-f]+:[ ]+41855513[ ]+srai[ ]+a0,a0,0x18 > +[ ]+[0-9a-f]+:[ ]+01051513[ ]+slli[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+41055513[ ]+srai[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+0105d593[ ]+srli[ ]+a1,a1,0x10 > +[ ]+[0-9a-f]+:[ ]+01861593[ ]+slli[ ]+a1,a2,0x18 > +[ ]+[0-9a-f]+:[ ]+4185d593[ ]+srai[ ]+a1,a1,0x18 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+4105d593[ ]+srai[ ]+a1,a1,0x10 > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+0542[ ]+c\.slli[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+8141[ ]+c\.srli[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+0562[ ]+c\.slli[ ]+a0,0x18 > +[ ]+[0-9a-f]+:[ ]+8561[ ]+c\.srai[ ]+a0,0x18 > +[ ]+[0-9a-f]+:[ ]+0542[ ]+c\.slli[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+8541[ ]+c\.srai[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+81c1[ ]+c\.srli[ ]+a1,0x10 > +[ ]+[0-9a-f]+:[ ]+01861593[ ]+slli[ ]+a1,a2,0x18 > +[ ]+[0-9a-f]+:[ ]+85e1[ ]+c\.srai[ ]+a1,0x18 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+85c1[ ]+c\.srai[ ]+a1,0x10 > +#... > diff --git a/gas/testsuite/gas/riscv/ext-insn-32-noarch.d b/gas/testsuite/gas/riscv/ext-insn-32-noarch.d > new file mode 100644 > index 00000000000..7a2f4ddfec2 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-32-noarch.d > @@ -0,0 +1,3 @@ > +#as: -march=rv32i -I$srcdir/$subdir -defsym XLEN=32 -defsym NOARCH=1 > +#source: ext-insn.s > +#error_output: ext-insn-32-noarch.l > diff --git a/gas/testsuite/gas/riscv/ext-insn-32-noarch.l b/gas/testsuite/gas/riscv/ext-insn-32-noarch.l > new file mode 100644 > index 00000000000..f5954f207f0 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-32-noarch.l > @@ -0,0 +1,9 @@ > +.*: Assembler messages: > +.*: Error: unrecognized opcode `zext.w a0,a0' > +.*: Error: unrecognized opcode `sext.w a0,a0' > +.*: Error: unrecognized opcode `zext.w a1,a2' > +.*: Error: unrecognized opcode `sext.w a1,a2' > +.*: Error: unrecognized opcode `zext.w a0,a0' > +.*: Error: unrecognized opcode `sext.w a0,a0' > +.*: Error: unrecognized opcode `zext.w a1,a2' > +.*: Error: unrecognized opcode `sext.w a1,a2' > diff --git a/gas/testsuite/gas/riscv/ext-insn-64-noalias.d b/gas/testsuite/gas/riscv/ext-insn-64-noalias.d > new file mode 100644 > index 00000000000..9a273eea0d7 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-64-noalias.d > @@ -0,0 +1,51 @@ > +#as: -march=rv64i -I$srcdir/$subdir -defsym XLEN=64 > +#source: ext-insn.s > +#objdump: -d -M no-aliases > + > +.*:[ ]+file format .* > + > + > +Disassembly of section .text: > + > +0+000 : > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+03051513[ ]+slli[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+03055513[ ]+srli[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+03851513[ ]+slli[ ]+a0,a0,0x38 > +[ ]+[0-9a-f]+:[ ]+43855513[ ]+srai[ ]+a0,a0,0x38 > +[ ]+[0-9a-f]+:[ ]+03051513[ ]+slli[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+43055513[ ]+srai[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 > +[ ]+[0-9a-f]+:[ ]+0305d593[ ]+srli[ ]+a1,a1,0x30 > +[ ]+[0-9a-f]+:[ ]+03861593[ ]+slli[ ]+a1,a2,0x38 > +[ ]+[0-9a-f]+:[ ]+4385d593[ ]+srai[ ]+a1,a1,0x38 > +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 > +[ ]+[0-9a-f]+:[ ]+4305d593[ ]+srai[ ]+a1,a1,0x30 > +[ ]+[0-9a-f]+:[ ]+02051513[ ]+slli[ ]+a0,a0,0x20 > +[ ]+[0-9a-f]+:[ ]+02055513[ ]+srli[ ]+a0,a0,0x20 > +[ ]+[0-9a-f]+:[ ]+0005051b[ ]+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\.srli[ ]+a1,0x20 > +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 > +#... > diff --git a/gas/testsuite/gas/riscv/ext-insn-64-noarch.d b/gas/testsuite/gas/riscv/ext-insn-64-noarch.d > new file mode 100644 > index 00000000000..6061373bb71 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-64-noarch.d > @@ -0,0 +1,5 @@ > +#as: -march=rv64i -I$srcdir/$subdir -defsym XLEN=64 -defsym NOARCH=1 > +#source: ext-insn.s > +#objdump: -d -M no-aliases > + > +#... > diff --git a/gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d > new file mode 100644 > index 00000000000..ccea949debc > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-zba-32-noalias.d > @@ -0,0 +1,39 @@ > +#as: -march=rv32i_zba -I$srcdir/$subdir -defsym XLEN=32 > +#source: ext-insn.s > +#objdump: -d -M no-aliases > + > +.*:[ ]+file format .* > + > + > +Disassembly of section .text: > + > +0+000 : > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+01051513[ ]+slli[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+01055513[ ]+srli[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+01851513[ ]+slli[ ]+a0,a0,0x18 > +[ ]+[0-9a-f]+:[ ]+41855513[ ]+srai[ ]+a0,a0,0x18 > +[ ]+[0-9a-f]+:[ ]+01051513[ ]+slli[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+41055513[ ]+srai[ ]+a0,a0,0x10 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+0105d593[ ]+srli[ ]+a1,a1,0x10 > +[ ]+[0-9a-f]+:[ ]+01861593[ ]+slli[ ]+a1,a2,0x18 > +[ ]+[0-9a-f]+:[ ]+4185d593[ ]+srai[ ]+a1,a1,0x18 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+4105d593[ ]+srai[ ]+a1,a1,0x10 > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+0542[ ]+c\.slli[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+8141[ ]+c\.srli[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+0562[ ]+c\.slli[ ]+a0,0x18 > +[ ]+[0-9a-f]+:[ ]+8561[ ]+c\.srai[ ]+a0,0x18 > +[ ]+[0-9a-f]+:[ ]+0542[ ]+c\.slli[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+8541[ ]+c\.srai[ ]+a0,0x10 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+81c1[ ]+c\.srli[ ]+a1,0x10 > +[ ]+[0-9a-f]+:[ ]+01861593[ ]+slli[ ]+a1,a2,0x18 > +[ ]+[0-9a-f]+:[ ]+85e1[ ]+c\.srai[ ]+a1,0x18 > +[ ]+[0-9a-f]+:[ ]+01061593[ ]+slli[ ]+a1,a2,0x10 > +[ ]+[0-9a-f]+:[ ]+85c1[ ]+c\.srai[ ]+a1,0x10 > +#... > diff --git a/gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d > new file mode 100644 > index 00000000000..a9e191a7449 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-zba-64-noalias.d > @@ -0,0 +1,47 @@ > +#as: -march=rv64i_zba -I$srcdir/$subdir -defsym XLEN=64 > +#source: ext-insn.s > +#objdump: -d -M no-aliases > + > +.*:[ ]+file format .* > + > + > +Disassembly of section .text: > + > +0+000 : > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+03051513[ ]+slli[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+03055513[ ]+srli[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+03851513[ ]+slli[ ]+a0,a0,0x38 > +[ ]+[0-9a-f]+:[ ]+43855513[ ]+srai[ ]+a0,a0,0x38 > +[ ]+[0-9a-f]+:[ ]+03051513[ ]+slli[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+43055513[ ]+srai[ ]+a0,a0,0x30 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 > +[ ]+[0-9a-f]+:[ ]+0305d593[ ]+srli[ ]+a1,a1,0x30 > +[ ]+[0-9a-f]+:[ ]+03861593[ ]+slli[ ]+a1,a2,0x38 > +[ ]+[0-9a-f]+:[ ]+4385d593[ ]+srai[ ]+a1,a1,0x38 > +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 > +[ ]+[0-9a-f]+:[ ]+4305d593[ ]+srai[ ]+a1,a1,0x30 > +[ ]+[0-9a-f]+:[ ]+0805053b[ ]+add\.uw[ ]+a0,a0,zero > +[ ]+[0-9a-f]+:[ ]+0005051b[ ]+addiw[ ]+a0,a0,0 > +[ ]+[0-9a-f]+:[ ]+080605bb[ ]+add\.uw[ ]+a1,a2,zero > +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+1542[ ]+c\.slli[ ]+a0,0x30 > +[ ]+[0-9a-f]+:[ ]+9141[ ]+c\.srli[ ]+a0,0x30 > +[ ]+[0-9a-f]+:[ ]+1562[ ]+c\.slli[ ]+a0,0x38 > +[ ]+[0-9a-f]+:[ ]+9561[ ]+c\.srai[ ]+a0,0x38 > +[ ]+[0-9a-f]+:[ ]+1542[ ]+c\.slli[ ]+a0,0x30 > +[ ]+[0-9a-f]+:[ ]+9541[ ]+c\.srai[ ]+a0,0x30 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 > +[ ]+[0-9a-f]+:[ ]+91c1[ ]+c\.srli[ ]+a1,0x30 > +[ ]+[0-9a-f]+:[ ]+03861593[ ]+slli[ ]+a1,a2,0x38 > +[ ]+[0-9a-f]+:[ ]+95e1[ ]+c\.srai[ ]+a1,0x38 > +[ ]+[0-9a-f]+:[ ]+03061593[ ]+slli[ ]+a1,a2,0x30 > +[ ]+[0-9a-f]+:[ ]+95c1[ ]+c\.srai[ ]+a1,0x30 > +[ ]+[0-9a-f]+:[ ]+0805053b[ ]+add\.uw[ ]+a0,a0,zero > +[ ]+[0-9a-f]+:[ ]+2501[ ]+c\.addiw[ ]+a0,0 > +[ ]+[0-9a-f]+:[ ]+080605bb[ ]+add\.uw[ ]+a1,a2,zero > +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 > +#... > diff --git a/gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d > new file mode 100644 > index 00000000000..edb2dcde2cf > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-zbb-32-noalias.d > @@ -0,0 +1,27 @@ > +#as: -march=rv32i_zbb -I$srcdir/$subdir -defsym XLEN=32 > +#source: ext-insn.s > +#objdump: -d -M no-aliases > + > +.*:[ ]+file format .* > + > + > +Disassembly of section .text: > + > +0+000 : > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+08054533[ ]+zext\.h[ ]+a0,a0 > +[ ]+[0-9a-f]+:[ ]+60451513[ ]+sext\.b[ ]+a0,a0 > +[ ]+[0-9a-f]+:[ ]+60551513[ ]+sext\.h[ ]+a0,a0 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+080645b3[ ]+zext\.h[ ]+a1,a2 > +[ ]+[0-9a-f]+:[ ]+60461593[ ]+sext\.b[ ]+a1,a2 > +[ ]+[0-9a-f]+:[ ]+60561593[ ]+sext\.h[ ]+a1,a2 > +[ ]+[0-9a-f]+:[ ]+0ff57513[ ]+andi[ ]+a0,a0,255 > +[ ]+[0-9a-f]+:[ ]+08054533[ ]+zext\.h[ ]+a0,a0 > +[ ]+[0-9a-f]+:[ ]+60451513[ ]+sext\.b[ ]+a0,a0 > +[ ]+[0-9a-f]+:[ ]+60551513[ ]+sext\.h[ ]+a0,a0 > +[ ]+[0-9a-f]+:[ ]+0ff67593[ ]+andi[ ]+a1,a2,255 > +[ ]+[0-9a-f]+:[ ]+080645b3[ ]+zext\.h[ ]+a1,a2 > +[ ]+[0-9a-f]+:[ ]+60461593[ ]+sext\.b[ ]+a1,a2 > +[ ]+[0-9a-f]+:[ ]+60561593[ ]+sext\.h[ ]+a1,a2 > +#... > diff --git a/gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d b/gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d > new file mode 100644 > index 00000000000..bc7b6145e59 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn-zbb-64-noalias.d > @@ -0,0 +1,39 @@ > +#as: -march=rv64i_zbb -I$srcdir/$subdir -defsym XLEN=64 > +#source: ext-insn.s > +#objdump: -d -M no-aliases > + > +.*:[ ]+file format .* > + > + > +Disassembly of section .text: > + >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]+a1,a2 > +[ ]+[0-9a-f]+:[ ]+1502[ ]+c\.slli[ ]+a0,0x20 > +[ ]+[0-9a-f]+:[ ]+9101[ ]+c\.srli[ ]+a0,0x20 > +[ ]+[0-9a-f]+:[ ]+2501[ ]+c\.addiw[ ]+a0,0 > +[ ]+[0-9a-f]+:[ ]+02061593[ ]+slli[ ]+a1,a2,0x20 > +[ ]+[0-9a-f]+:[ ]+9181[ ]+c\.srli[ ]+a1,0x20 > +[ ]+[0-9a-f]+:[ ]+0006059b[ ]+addiw[ ]+a1,a2,0 > +#... > diff --git a/gas/testsuite/gas/riscv/ext-insn.s b/gas/testsuite/gas/riscv/ext-insn.s > new file mode 100644 > index 00000000000..2e4dc1ed850 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/ext-insn.s > @@ -0,0 +1,23 @@ > +.include "testutils.inc" > + > +.macro INSN_SEQ > + zext.b a0, a0 # andi (I) > + zext.h a0, a0 # Zbb (RV32!=RV64) / shifts (I/C) > + sext.b a0, a0 # Zbb / shifts (I/C) > + sext.h a0, a0 # Zbb / shifts (I/C) > + zext.b a1, a2 # andi (I) > + zext.h a1, a2 # Zbb (RV32!=RV64) / shifts (I/C) > + sext.b a1, a2 # Zbb / shifts (I/C) > + sext.h a1, a2 # Zbb / shifts (I/C) > +.if XLEN_GE_64 > + zext.w a0, a0 # add.uw (RV64_Zba) / shifts (I/C) > + sext.w a0, a0 # addiw (I) / c.addiw (C) > + zext.w a1, a2 # add.uw (RV64_Zba) / shifts (I/C) > + sext.w a1, a2 # addiw (I/C) > +.endif > +.endm > + > +target: > + INSN_SEQ > + .option arch, +c > + INSN_SEQ > diff --git a/gas/testsuite/gas/riscv/ext.s b/gas/testsuite/gas/riscv/ext.s > deleted file mode 100644 > index 0268dcafc1d..00000000000 > --- a/gas/testsuite/gas/riscv/ext.s > +++ /dev/null > @@ -1,38 +0,0 @@ > -target: > - .option arch, -c > - zext.b a0, a0 > - zext.h a0, a0 > - sext.b a0, a0 > - sext.h a0, a0 > - > - zext.b a1, a2 > - zext.h a1, a2 > - sext.b a1, a2 > - sext.h a1, a2 > - > -.ifdef __64_bit__ > - zext.w a0, a0 > - sext.w a0, a0 > - > - zext.w a1, a2 > - sext.w a1, a2 > -.endif > - > - .option arch, +c > - zext.b a0, a0 > - zext.h a0, a0 > - sext.b a0, a0 > - sext.h a0, a0 > - > - zext.b a1, a2 > - zext.h a1, a2 > - sext.b a1, a2 > - sext.h a1, a2 > - > -.ifdef __64_bit__ > - zext.w a0, a0 > - sext.w a0, a0 > - > - zext.w a1, a2 > - sext.w a1, a2 > -.endif > -- > 2.37.2 >