From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by sourceware.org (Postfix) with ESMTPS id 17730384A884 for ; Sat, 18 Apr 2020 11:08:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 17730384A884 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-pj1-x1041.google.com with SMTP id a22so2185515pjk.5 for ; Sat, 18 Apr 2020 04:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ehk3vYN0f3RU+y/v7f3r8bFNpWwByL6xyTMTUySgmEw=; b=hR6eoGD5yDjZ/I6oGDSfvHFrfUJENglveYJO6iF9LWtb+oEwYBAqWiKa9ywvNEND/b DmQGbP7wfz1GhL3LN7Y4Z6eDkzNAGeZtP0JvxAOji0eqpONJCM9uAfH3LCLMe2ZUPc/+ +MfwEdjnbCpgMTdlE9isoxGm80EsYcPmu7JO4Rwk79m9JC1Pd8qdAuCjDUAMMMXLhhcE Amc7tsZ832s0nNthXILfsFDZra49qUMhWfP8OepH6mi4M8GFMEOHpLNqR1ma4HB2IHGA PRhWuyQ0evQyeBAckyZcSRJwwmukCl3Zue7JKPQIdf7CJ94SfuftBT/VUwnRtxU3TMNO LiJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ehk3vYN0f3RU+y/v7f3r8bFNpWwByL6xyTMTUySgmEw=; b=Y8VYP29Da7P/BPyui5mUxPXrpkzJegX+l0m5CFVA5R8f9hkeNiRdmvRBpP2XYhJxzA rJdeMSKON3VmG7DcgffTmTSC6fo2CgGehV7mJp/2Z4zAtfTsSc9hEJyGsovISOmy7Y4Y yP+dVh9MzOFMOgvTN3pAFh/7CMFiiUesFW+Q5g5uOKYefBiFt4+8I2pga24WuUdRH0XD JrNb00RK7Ee0qmmPZ1YNbllp5Z3iI1Kuj5jDuqKL+PT4HvDhnwhuFqkqwQHISHt6rt/G Fm1f67cnYRharXvjrrCRWWDLiWl4xBUr67T/tB0JgLWEZWSH68LXleBsFLCxKxtznNVv hMxg== X-Gm-Message-State: AGi0PubyWD7qFrPOUUwNyaMcpzDqU5O7pqbiSEWw5SSDNp9W4ecqi0sv pM3JwkIq6N774tSxkFhM+XZrPw== X-Google-Smtp-Source: APiQypJo/m9Bag38JvVU37/WKkoIKqtEOanC2fAy4q6EliLOS8oqNCsDFn2ohbSilfz1psT/02e1pw== X-Received: by 2002:a17:902:261:: with SMTP id 88mr2404647plc.308.1587208101251; Sat, 18 Apr 2020 04:08:21 -0700 (PDT) Received: from gamma05.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id fy21sm8008313pjb.25.2020.04.18.04.08.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Apr 2020 04:08:20 -0700 (PDT) From: Nelson Chu To: binutils@sourceware.org, gdb-patches@sourceware.org Cc: andrew.burgess@embecosm.com, andrew@sifive.com, asb@lowrisc.org, kito.cheng@sifive.com, maxim.blinov@embecosm.com, jimw@sifive.com Subject: [PATCH 7/7] RISC-V: Add documents and --help for the new GAS and OBJDUMP options. Date: Sat, 18 Apr 2020 04:07:55 -0700 Message-Id: <1587208075-2462-8-git-send-email-nelson.chu@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587208075-2462-1-git-send-email-nelson.chu@sifive.com> References: <1587208075-2462-1-git-send-email-nelson.chu@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-21.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_BARRACUDACENTRAL, 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:08:26 -0000 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=ISA set the RISC-V architecture\n\ - -mabi=ABI 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=ISA set the RISC-V architecture\n\ + -misa-spec=ISAspec set the RISC-V ISA spec (2p0, 2p1, 2p2, 20190608, 20191213)\n\ + -mriscv-isa-version=ISAver update the default version of RISC-V architecture\n\ + -mpriv-spec=PRIVspec set the RISC-V privilege spec (1p9, 1p9p1, 1p10, 1p11)\n\ + -mabi=ABI 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=ISA} option, RISC-V @item -march=ISA Select the base isa, as specified by ISA. For example -march=rv32ima. +If this option and the architecture attributes aren’t set, then assembler +will check the default configure setting --with-arch=ISA. + +@cindex @samp{-misa-spec=ISAspec} option, RISC-V +@item -misa-spec=ISAspec +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=ISAspec. + +@cindex @samp{-mriscv-isa-version=ISAver} option, RISC-V +@item -mriscv-isa-version=ISAver +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=i2p0m2p0a2p0. There are two reasons that you may need +this option, + +Some versions of extensions defined in the ISA spec are not matched to the +toolchain’s implementation. For example, V-ext is defined to version 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 configure +setting --with-riscv-isa-version=ISAver. + +@cindex @samp{-mpriv-spec=PRIVspec} option, RISC-V +@item -mpriv-spec=PRIVspec +Select the privileged spec version. We can decide whether the CSR is valid or +not according to the chosen spec. If this option and the privilege attributes +aren't set, then assembler will check the default configure setting +--with-priv-spec=PRIVspec. @cindex @samp{-mabi=ABI} option, RISC-V @item -mabi=ABI 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=PRIV Print the CSR according to the chosen privilege spec.\n")); fprintf (stream, _("\n")); } -- 2.7.4