From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by sourceware.org (Postfix) with ESMTPS id 674FC3852225 for ; Tue, 29 Nov 2022 07:48:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 674FC3852225 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-x35.google.com with SMTP id 586e51a60fabf-142faa7a207so16010721fac.13 for ; Mon, 28 Nov 2022 23:48:25 -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=BcYUlSwAoEmxNTaoDQPjhHzK2vQhxIAuU8LaFe6HZYE=; b=L7/0d7r5dBYLuMAbVL7ytuVxjS3hxfHxAMfRvd+ZNkaFRfpt5gWJWIMw4gZFIK0mAm OHAnb+WLjJ9nAH65A/zl7nnvHVgmrfvuhdT7r5fTZk77g4wf30ID0UoZ5xcQU51CbQg6 m31gr35VFMgECFarbqeIs4/dOvB4YFPAWvh/mKENb4EPPyzODq5J0b0+1NNt4Hh0HE3M nes9uzYZI1K7iCxxzMQ8uNr7VTuqbNrfB/KGm2+xX0zeuY7ykWIaMBLZdsvmfphKgtmW dgLN5XxSYm9wk41iPFSArIg8UrDBn2wx8+LoQdvmlGboNVZf/7LWlALdfdNllFvFbtUJ Vdnw== 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=BcYUlSwAoEmxNTaoDQPjhHzK2vQhxIAuU8LaFe6HZYE=; b=PR/pgNf/0Jhtu471OI65RJ8fa6JSh6z6ykeeqU6OvBAcvglgeZuhnDUULnyN7uJT/V SNM4wEau4CnK9h9Jt5DHq5ogMhHnSM98HdbFY+BbcL6kiNIIv8ZnnGCkGQFzr7BXiAUy rQkxED2p2ZBU+MnDUi+hibJwYLu18Dtzz8SjoRPHfhvDxJZaf5MOhM40pRgaLBOSTZnv ULyUsOd7O4QWz+d4ZxCUSR3BKxOWTmCsc5h4wXg31CXK7Mn3nfwMJmnJLqnpJv24VwBN UL2MOEqLxbmtUaMA8KW+Iij0CUn+IwTsSgDjYZd9MCF3tzTfUthpQH16a3Nk4p6Us/6j nROg== X-Gm-Message-State: ANoB5plu7OedfYpyFyJsnmIjhG0CjdbAUY7ZIIFUyU1dExfR2Syt6pB0 PNFlT1mydD+gnhE+J9RogH+EEqAnywXz97EkAlNRUA== X-Google-Smtp-Source: AA0mqf4l6zKSCfNDiRyP1I1xgStF8AXYW8d88XrY022pZUsUMsQpIuzShvDK5lAnAT3XaVGwZTDOOd46mgXSceyGCtw= X-Received: by 2002:a05:6870:9110:b0:142:6390:4724 with SMTP id o16-20020a056870911000b0014263904724mr1620356oae.82.1669708104786; Mon, 28 Nov 2022 23:48:24 -0800 (PST) MIME-Version: 1.0 References: <4496235002a396043598ab9755bd8eda5c077b1f.1667651354.git.research_trasio@irq.a4lg.com> In-Reply-To: <4496235002a396043598ab9755bd8eda5c077b1f.1667651354.git.research_trasio@irq.a4lg.com> From: Nelson Chu Date: Tue, 29 Nov 2022 15:48:14 +0800 Message-ID: Subject: Re: [PATCH 02/12] RISC-V: Tidy disassembler corner case tests To: Tsukasa OI Cc: Kito Cheng , Palmer Dabbelt , binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.7 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: If the purpose of this patch is to prepare to support rv128 or larger xlen, then I'm ok with it, although it seems useless until we have already had any rv128 instructions. Btw, I cannot figure out the purpose of this patch from the title "RISC-V: Tidy disassembler corner case tests". It seems like it's not only for the tidy from the contents. Thanks Nelson On Sat, Nov 5, 2022 at 8:29 PM Tsukasa OI wrote: > > Because later commits use "XLEN" symbol rather than "rv64", it replaces > occurrences of "rv64" with "XLEN" and makes other tidying changes for > consistency with other testcases. > > gas/ChangeLog: > > * testsuite/gas/riscv/dis-addr-addiw-a.d: Tidying. > * testsuite/gas/riscv/dis-addr-addiw-b.d: Likewise. > * testsuite/gas/riscv/dis-addr-overflow.s: Tidying. > * testsuite/gas/riscv/dis-addr-overflow-32.d: Use XLEN symbol. > * testsuite/gas/riscv/dis-addr-overflow-64.d: Likewise. > * testsuite/gas/riscv/dis-addr-topaddr-gp.s: Tidying. > * testsuite/gas/riscv/dis-addr-topaddr-gp-32.d: Use XLEN symbol. > * testsuite/gas/riscv/dis-addr-topaddr-gp-64.d: Likewise. > * testsuite/gas/riscv/dis-addr-topaddr.s: Moved to... > * testsuite/gas/riscv/dis-addr-topaddr-zero.s: ...here > with tidying. > * testsuite/gas/riscv/dis-addr-topaddr-32.d: Moved to... > * testsuite/gas/riscv/dis-addr-topaddr-zero-32.d: ...here. > Use XLEN symbol. Minimize architecture requirements. > * testsuite/gas/riscv/dis-addr-topaddr-64.d: Moved to... > * testsuite/gas/riscv/dis-addr-topaddr-zero-64.d: ...here. > Use XLEN symbol. Minimize architecture requirements. > --- > gas/testsuite/gas/riscv/dis-addr-addiw-a.d | 2 +- > gas/testsuite/gas/riscv/dis-addr-addiw-b.d | 2 +- > .../gas/riscv/dis-addr-overflow-32.d | 4 +- > .../gas/riscv/dis-addr-overflow-64.d | 4 +- > gas/testsuite/gas/riscv/dis-addr-overflow.s | 40 +++++++++---------- > .../gas/riscv/dis-addr-topaddr-gp-32.d | 4 +- > .../gas/riscv/dis-addr-topaddr-gp-64.d | 4 +- > gas/testsuite/gas/riscv/dis-addr-topaddr-gp.s | 12 +++--- > ...opaddr-32.d => dis-addr-topaddr-zero-32.d} | 6 +-- > ...opaddr-64.d => dis-addr-topaddr-zero-64.d} | 6 +-- > .../gas/riscv/dis-addr-topaddr-zero.s | 11 +++++ > gas/testsuite/gas/riscv/dis-addr-topaddr.s | 10 ----- > 12 files changed, 53 insertions(+), 52 deletions(-) > rename gas/testsuite/gas/riscv/{dis-addr-topaddr-32.d => dis-addr-topaddr-zero-32.d} (60%) > rename gas/testsuite/gas/riscv/{dis-addr-topaddr-64.d => dis-addr-topaddr-zero-64.d} (58%) > create mode 100644 gas/testsuite/gas/riscv/dis-addr-topaddr-zero.s > delete mode 100644 gas/testsuite/gas/riscv/dis-addr-topaddr.s > > diff --git a/gas/testsuite/gas/riscv/dis-addr-addiw-a.d b/gas/testsuite/gas/riscv/dis-addr-addiw-a.d > index c4e4cfe6df7..44837ff4f69 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-addiw-a.d > +++ b/gas/testsuite/gas/riscv/dis-addr-addiw-a.d > @@ -2,7 +2,7 @@ > #source: dis-addr-addiw.s > #objdump: -d --adjust-vma=0xffffffe0 > > -.*: file format elf64-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-addiw-b.d b/gas/testsuite/gas/riscv/dis-addr-addiw-b.d > index d5f84db172e..bc1841f35f1 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-addiw-b.d > +++ b/gas/testsuite/gas/riscv/dis-addr-addiw-b.d > @@ -2,7 +2,7 @@ > #source: dis-addr-addiw.s > #objdump: -d --adjust-vma=0x7fffffe0 > > -.*: file format elf64-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-overflow-32.d b/gas/testsuite/gas/riscv/dis-addr-overflow-32.d > index 287c5ea022f..b246605e361 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-overflow-32.d > +++ b/gas/testsuite/gas/riscv/dis-addr-overflow-32.d > @@ -1,8 +1,8 @@ > -#as: -march=rv32ic > +#as: -march=rv32ic -defsym XLEN=32 > #source: dis-addr-overflow.s > #objdump: -d > > -.*: file format elf32-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-overflow-64.d b/gas/testsuite/gas/riscv/dis-addr-overflow-64.d > index 1966a5ed743..61885edbc75 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-overflow-64.d > +++ b/gas/testsuite/gas/riscv/dis-addr-overflow-64.d > @@ -1,8 +1,8 @@ > -#as: -march=rv64ic -defsym rv64=1 > +#as: -march=rv64ic -defsym XLEN=64 > #source: dis-addr-overflow.s > #objdump: -d > > -.*: file format elf64-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-overflow.s b/gas/testsuite/gas/riscv/dis-addr-overflow.s > index 77ca39c07b6..47e5351c9fc 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-overflow.s > +++ b/gas/testsuite/gas/riscv/dis-addr-overflow.s > @@ -1,26 +1,26 @@ > -.set __global_pointer$, 0x00000200 > +.set __global_pointer$, 0x00000200 > > -.ifdef rv64 > -topbase = 0xffffffff00000000 > +.ifge XLEN-64 > +.set topbase, 0xffffffff00000000 > .else > -topbase = 0 > +.set topbase, 0 > .endif > > -.set addr_load, topbase + 0xffffeffc # -0x1000 -4 > -.set addr_store, topbase + 0xffffdff8 # -0x2000 -8 > -.set addr_jalr_1, topbase + 0xffffd000 # -0x3000 > -.set addr_jalr_2, topbase + 0xffffbff4 # -0x4000 -12 > -.set addr_jalr_3, topbase + 0xffffb000 # -0x5000 > -.set addr_loadaddr, topbase + 0xffff9ff0 # -0x6000 -16 > -.set addr_loadaddr_c, topbase + 0xffff8fec # -0x7000 -20 > -.set addr_loadaddr_w, topbase + 0xffff7fe8 # -0x8000 -24 > -.set addr_loadaddr_w_c, topbase + 0xffff6fe4 # -0x9000 -28 > -.set addr_rel_gp_pos, 0x00000600 # __global_pointer$ + 0x400 > -.set addr_rel_gp_neg, topbase + 0xfffffe00 # __global_pointer$ - 0x400 > -.set addr_rel_zero_pos, 0x00000100 > -.set addr_rel_zero_neg, topbase + 0xfffff800 # -0x800 > -.set addr_jalr_rel_zero_pos, 0x00000104 > -.set addr_jalr_rel_zero_neg, topbase + 0xfffff804 # -0x7fc > +.set addr_load, topbase + 0xffffeffc # -0x1000 -4 > +.set addr_store, topbase + 0xffffdff8 # -0x2000 -8 > +.set addr_jalr_1, topbase + 0xffffd000 # -0x3000 > +.set addr_jalr_2, topbase + 0xffffbff4 # -0x4000 -12 > +.set addr_jalr_3, topbase + 0xffffb000 # -0x5000 > +.set addr_loadaddr, topbase + 0xffff9ff0 # -0x6000 -16 > +.set addr_loadaddr_c, topbase + 0xffff8fec # -0x7000 -20 > +.set addr_loadaddr_w, topbase + 0xffff7fe8 # -0x8000 -24 > +.set addr_loadaddr_w_c, topbase + 0xffff6fe4 # -0x9000 -28 > +.set addr_rel_gp_pos, 0x00000600 # __global_pointer$ + 0x400 > +.set addr_rel_gp_neg, topbase + 0xfffffe00 # __global_pointer$ - 0x400 > +.set addr_rel_zero_pos, 0x00000100 > +.set addr_rel_zero_neg, topbase + 0xfffff800 # -0x800 > +.set addr_jalr_rel_zero_pos, 0x00000104 > +.set addr_jalr_rel_zero_neg, topbase + 0xfffff804 # -0x7fc > > target: > .option push > @@ -48,7 +48,7 @@ target: > lui t6, 0xffff9 > .option pop > c.addi t6, -20 > -.ifdef rv64 > +.ifge XLEN-64 > .option push > .option arch, -c > # ADDIW (not compressed) > diff --git a/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-32.d b/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-32.d > index 875bfe73189..cdbbe3bf846 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-32.d > +++ b/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-32.d > @@ -1,8 +1,8 @@ > -#as: -march=rv32i > +#as: -march=rv32i -defsym XLEN=32 > #source: dis-addr-topaddr-gp.s > #objdump: -d > > -.*: file format elf32-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-64.d b/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-64.d > index 5ac4b52b18d..54fc8631901 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-64.d > +++ b/gas/testsuite/gas/riscv/dis-addr-topaddr-gp-64.d > @@ -1,8 +1,8 @@ > -#as: -march=rv64i -defsym rv64=1 > +#as: -march=rv64i -defsym XLEN=64 > #source: dis-addr-topaddr-gp.s > #objdump: -d > > -.*: file format elf64-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-topaddr-gp.s b/gas/testsuite/gas/riscv/dis-addr-topaddr-gp.s > index 6ba9fc7a39d..1689cdf89c1 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-topaddr-gp.s > +++ b/gas/testsuite/gas/riscv/dis-addr-topaddr-gp.s > @@ -1,12 +1,12 @@ > -.ifdef rv64 > -topbase = 0xffffffff00000000 > +.ifge XLEN-64 > +.set topbase, 0xffffffff00000000 > .else > -topbase = 0 > +.set topbase, 0 > .endif > > -.set __global_pointer$, topbase + 0xffffffff # -1 > -.set addr_rel_gp_pos, 0x00000004 # +4 > -.set addr_rel_gp_neg, topbase + 0xfffffffc # -4 > +.set __global_pointer$, topbase + 0xffffffff # -1 > +.set addr_rel_gp_pos, 0x00000004 # +4 > +.set addr_rel_gp_neg, topbase + 0xfffffffc # -4 > > target: > # Use addresses relative to gp > diff --git a/gas/testsuite/gas/riscv/dis-addr-topaddr-32.d b/gas/testsuite/gas/riscv/dis-addr-topaddr-zero-32.d > similarity index 60% > rename from gas/testsuite/gas/riscv/dis-addr-topaddr-32.d > rename to gas/testsuite/gas/riscv/dis-addr-topaddr-zero-32.d > index 87854cd58e6..2934e2d5fec 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-topaddr-32.d > +++ b/gas/testsuite/gas/riscv/dis-addr-topaddr-zero-32.d > @@ -1,8 +1,8 @@ > -#as: -march=rv32ic > -#source: dis-addr-topaddr.s > +#as: -march=rv32i -defsym XLEN=32 > +#source: dis-addr-topaddr-zero.s > #objdump: -d > > -.*: file format elf32-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-topaddr-64.d b/gas/testsuite/gas/riscv/dis-addr-topaddr-zero-64.d > similarity index 58% > rename from gas/testsuite/gas/riscv/dis-addr-topaddr-64.d > rename to gas/testsuite/gas/riscv/dis-addr-topaddr-zero-64.d > index 38f67efdcaf..9b2d170d3d6 100644 > --- a/gas/testsuite/gas/riscv/dis-addr-topaddr-64.d > +++ b/gas/testsuite/gas/riscv/dis-addr-topaddr-zero-64.d > @@ -1,8 +1,8 @@ > -#as: -march=rv64ic -defsym rv64=1 > -#source: dis-addr-topaddr.s > +#as: -march=rv64i -defsym XLEN=64 > +#source: dis-addr-topaddr-zero.s > #objdump: -d > > -.*: file format elf64-(little|big)riscv > +.*:[ ]+file format .* > > > Disassembly of section .text: > diff --git a/gas/testsuite/gas/riscv/dis-addr-topaddr-zero.s b/gas/testsuite/gas/riscv/dis-addr-topaddr-zero.s > new file mode 100644 > index 00000000000..cdf44b5403b > --- /dev/null > +++ b/gas/testsuite/gas/riscv/dis-addr-topaddr-zero.s > @@ -0,0 +1,11 @@ > +.ifge XLEN-64 > +.set topbase, 0xffffffff00000000 > +.else > +.set topbase, 0 > +.endif > + > +.set addr_top, topbase + 0xffffffff # -1 > + > +target: > + # Use address relative to zero > + lb t0, -1(zero) > diff --git a/gas/testsuite/gas/riscv/dis-addr-topaddr.s b/gas/testsuite/gas/riscv/dis-addr-topaddr.s > deleted file mode 100644 > index b66587f448d..00000000000 > --- a/gas/testsuite/gas/riscv/dis-addr-topaddr.s > +++ /dev/null > @@ -1,10 +0,0 @@ > -.ifdef rv64 > -topbase = 0xffffffff00000000 > -.else > -topbase = 0 > -.endif > - > -.set addr_top, topbase + 0xffffffff # -1 > - > -target: > - lb t0, -1(zero) > -- > 2.37.2 >