From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by sourceware.org (Postfix) with ESMTPS id 98B20384407C for ; Sat, 18 Apr 2020 11:19:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98B20384407C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nelson.chu@sifive.com Received: by mail-io1-xd43.google.com with SMTP id w1so5344903iot.7 for ; Sat, 18 Apr 2020 04:19:19 -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:content-transfer-encoding; bh=vyszn9mF+y+wrsZCE1j/tQA7a6WqtCohpfAkCXkiD7Q=; b=VEPms/+ZaZ8bredXN5r29RuwOvK4k7NonPOCggfH30+Or2T7HvhrzI06IEhpS1QjpW YxGYZ3JEuWCoudcz3I4DcY1+afcHjU3WU56iVdVtSQNMIjooQSIEC+M/7R3hUk00F/oo MQk9Ot9tpnE/AjZNOnOepjUQqXWUYInclBfBPK+qwHAfCVRRhxkIjfhV3i724GwfwujS DKlOhbYwR56AVpDvckQRjsZvoI8CUs0R31SAWxRpiHFq9/RkJjoqoEAT7s7l4vz3+6yf clatv3t7Qk1FSUo4kIFBnyBTaSeEBF1gJgQeKZ3MKHtVO27cTpUlH5pumab5euv4O3um LqOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vyszn9mF+y+wrsZCE1j/tQA7a6WqtCohpfAkCXkiD7Q=; b=Wa72S8Xw8j+RH2RsVbIItHqnH9HImKyH1rOc99F6DHWq4zWu6q7lDPq+l40lgrb3g2 1A/eEb8rmbFrDNQ2KSPDMSaMOghhLfLMonmAsNrI6UW+z4VMnI6rM+v8Q1+Qwkrxcs3P PejYjdO9Vu2Rww9FmaBg7mRZoEqO42hHravvQaT2urizfiMRWY2YkqDYm6nwmcwHbqsu WGlWTXJjA0upTI16hn1+lV61oE2KfcBQvehrZYn6ppNRKeMguXHYuXg31n4ZYPCx1sWr QMTUv1ZpHznh3Z4YiF9QNiv7qfG4aBVH4jAGQq9vFC38LdbaHVliipgSsYNclOu6MCol 57+Q== X-Gm-Message-State: AGi0PuYie13mcwcgLsslWg32Vd6BTUmiv5ZdoVbJ1VlAjGg27DEBiozs qjxVJ23XIoQRo/nbFqE3b8gJ694D9lVtHRsnsk0YR/qOWU4zzg== X-Google-Smtp-Source: APiQypKbJJfXQaav1RLZ3svJSXF0YuIcFfZQt2deOgh634eUqc/xXosoWfgLbmFwxG8C3Hu45lNWIyV9MomUCqpSKWQ= X-Received: by 2002:a02:b19a:: with SMTP id t26mr7433127jah.111.1587208759101; Sat, 18 Apr 2020 04:19:19 -0700 (PDT) MIME-Version: 1.0 References: <1587208075-2462-1-git-send-email-nelson.chu@sifive.com> <1587208075-2462-8-git-send-email-nelson.chu@sifive.com> In-Reply-To: <1587208075-2462-8-git-send-email-nelson.chu@sifive.com> From: Nelson Chu Date: Sat, 18 Apr 2020 19:19:10 +0800 Message-ID: Subject: Re: [PATCH 7/7] RISC-V: Add documents and --help for the new GAS and OBJDUMP options. To: Binutils , gdb-patches@sourceware.org Cc: Andrew Burgess , Andrew Waterman , asb@lowrisc.org, Kito Cheng , Maxim Blinov , Jim Wilson , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-23.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2020 11:19:21 -0000 CC Palmer. Thanks Nelson On Sat, Apr 18, 2020 at 7:08 PM Nelson Chu wrote: > > gas/ > * config/tc-riscv.c (md_show_usage): Add descriptions about > the new GAS options. > * doc/c-riscv.texi: Likewise. > > opcodes/ > * riscv-dis.c (print_riscv_disassembler_options): Add description > about the new OBJDUMP option. > --- > gas/config/tc-riscv.c | 19 +++++++++++-------- > gas/doc/c-riscv.texi | 35 +++++++++++++++++++++++++++++++++++ > opcodes/riscv-dis.c | 9 ++++++--- > 3 files changed, 52 insertions(+), 11 deletions(-) > > diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c > index 81bdfa8..95f787f 100644 > --- a/gas/config/tc-riscv.c > +++ b/gas/config/tc-riscv.c > @@ -3490,14 +3490,17 @@ md_show_usage (FILE *stream) > { > fprintf (stream, _("\ > RISC-V options:\n\ > - -fpic generate position-independent code\n\ > - -fno-pic don't generate position-independent code (default)\n\ > - -march=3DISA set the RISC-V architecture\n\ > - -mabi=3DABI set the RISC-V ABI\n\ > - -mrelax enable relax (default)\n\ > - -mno-relax disable relax\n\ > - -march-attr generate RISC-V arch attribute\n\ > - -mno-arch-attr don't generate RISC-V arch attribute\n\ > + -fpic generate position-independent code\n\ > + -fno-pic don't generate position-independent code (= default)\n\ > + -march=3DISA set the RISC-V architecture\n\ > + -misa-spec=3DISAspec set the RISC-V ISA spec (2p0, 2p1, 2p2, = 20190608, 20191213)\n\ > + -mriscv-isa-version=3DISAver update the default version of RISC-V arc= hitecture\n\ > + -mpriv-spec=3DPRIVspec set the RISC-V privilege spec (1p9, 1p9p= 1, 1p10, 1p11)\n\ > + -mabi=3DABI set the RISC-V ABI\n\ > + -mrelax enable relax (default)\n\ > + -mno-relax disable relax\n\ > + -march-attr generate RISC-V arch attribute\n\ > + -mno-arch-attr don't generate RISC-V arch attribute\n\ > ")); > } > > diff --git a/gas/doc/c-riscv.texi b/gas/doc/c-riscv.texi > index 488cf56..559c87a 100644 > --- a/gas/doc/c-riscv.texi > +++ b/gas/doc/c-riscv.texi > @@ -42,6 +42,41 @@ Don't generate position-independent code (default) > @cindex @samp{-march=3DISA} option, RISC-V > @item -march=3DISA > Select the base isa, as specified by ISA. For example -march=3Drv32ima. > +If this option and the architecture attributes aren=E2=80=99t set, then = assembler > +will check the default configure setting --with-arch=3DISA. > + > +@cindex @samp{-misa-spec=3DISAspec} option, RISC-V > +@item -misa-spec=3DISAspec > +Select the default isa spec version. If the version of ISA isn't set > +by -march, then assembler helps to set the version according to > +the default chosen spec. If this option isn't set, then assembler will > +check the default configure setting --with-isa-spec=3DISAspec. > + > +@cindex @samp{-mriscv-isa-version=3DISAver} option, RISC-V > +@item -mriscv-isa-version=3DISAver > +The syntax of ISAver is same as the ISA set by -march, but must set with > +versions, and without the rv32 or rv64 prefix. For example > +-mriscv-isa-version=3Di2p0m2p0a2p0. There are two reasons that you may = need > +this option, > + > +Some versions of extensions defined in the ISA spec are not matched to t= he > +toolchain=E2=80=99s implementation. For example, V-ext is defined to ve= rsion 0.7 in > +ISA spec, but we only have implementations for 0.8 and 0.9. Therefore, = you > +have to use this option to choose the correct version for V-ext. > + > +The other reason is that you want to update the version for the specific > +standard extensions if the version are not set in the ELF architecture > +attributes or -march option. > + > +If this option isn't set, then assembler will check the default configur= e > +setting --with-riscv-isa-version=3DISAver. > + > +@cindex @samp{-mpriv-spec=3DPRIVspec} option, RISC-V > +@item -mpriv-spec=3DPRIVspec > +Select the privileged spec version. We can decide whether the CSR is va= lid or > +not according to the chosen spec. If this option and the privilege attr= ibutes > +aren't set, then assembler will check the default configure setting > +--with-priv-spec=3DPRIVspec. > > @cindex @samp{-mabi=3DABI} option, RISC-V > @item -mabi=3DABI > diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c > index 38ae8ac..b558282 100644 > --- a/opcodes/riscv-dis.c > +++ b/opcodes/riscv-dis.c > @@ -601,11 +601,14 @@ The following RISC-V-specific disassembler options = are supported for use\n\ > with the -M switch (multiple options should be separated by commas):\n")= ); > > fprintf (stream, _("\n\ > - numeric Print numeric register names, rather than ABI names.\n")= ); > + numeric Print numeric register names, rather than ABI names.\n= ")); > > fprintf (stream, _("\n\ > - no-aliases Disassemble only into canonical instructions, rather\n\ > - than into pseudoinstructions.\n")); > + no-aliases Disassemble only into canonical instructions, rather\n= \ > + than into pseudoinstructions.\n")); > + > + fprintf (stream, _("\n\ > + priv-spec=3DPRIV Print the CSR according to the chosen privilege spec= .\n")); > > fprintf (stream, _("\n")); > } > -- > 2.7.4 >