From patchwork Thu Oct 26 16:45:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 830810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465243-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="yQXaK701"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yNCZ118PYz9t6f for ; Fri, 27 Oct 2017 03:45:59 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:date:message-id:cc:from:to; q=dns; s=default; b=BlpUxzf m3ZjppHIYtAILsdEnrGypNQKC1C3MglM7klxBvFwGLplkgMDIBNk4qp48nsI4BJS HQP77fMKs7s+uImPAoAAfByHgYDz0T6Mw1Q7qahIEsaG1YSGFf9XRBolpLE/qkjX uMa43wMvNCRDchz+daH1y2WND1sdqYbxZjEk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:date:message-id:cc:from:to; s=default; bh=YkRN5ZBgUOkru L3HrzM0pbsJcbs=; b=yQXaK701Vl+sL/BA4Z7yXghyiIty0e8wqwKHgM9LUDo1H myFsiOi0LmqXYBOrZxi0MclMvJAQLdr1ikKLhqQM7l+ub+G++vP53moNjJXy9qdQ 6n5iAQ9zVVfBcXMr1r08SHVjCRaVe/hw53z7UjZ7ZtvfN2w4/D2U7m5lrUTxhE= Received: (qmail 50733 invoked by alias); 26 Oct 2017 16:45:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 50714 invoked by uid 89); 26 Oct 2017 16:45:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pg0-f41.google.com Received: from mail-pg0-f41.google.com (HELO mail-pg0-f41.google.com) (74.125.83.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Oct 2017 16:45:48 +0000 Received: by mail-pg0-f41.google.com with SMTP id b192so3147524pga.2 for ; Thu, 26 Oct 2017 09:45:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:cc:from:to; bh=wmge/1pKvTKJ6LIo5vOM/9XCiqZu3AuxZv0nMUMWzfU=; b=OGTBFBXsRpZyArjQmbqDa5uEk3GxzOn8efPf2baF0/ZAssOWX1RuXVpeSdQ4zAYWvF IuLuHeWF8cFrBm71T8zD2cCG3L5buKNyeNWybHXLbhcLkjHUifm8LU1wE71EqQZipbmR og0aGUl2MJBQ6XBYMpwfWKmS2w1mLwlM2WE6hCH5ywahfX2nWyEwVnHgfLQMva6dGX3v HakRdhQ3Sn6GJDSaifh9CMtALL+zFN3yBG6/FX0RJvrVKT4XWiZTA9+bksdtpfM6XqTm TOXcZq8cnIxp/XEqSPkUfExqg0C6CMoczL7VkMEGfhJ1GbTrM9iCWW9p4q5eZRc6Kex0 K0WA== X-Gm-Message-State: AMCzsaXcTMUn/Mc//98jTJpzRUHMrhjpzbVNFeuubJxUAAOOfNDEuj2a qrod8e4F79+LowZp2PgAjQJkJouNghY= X-Google-Smtp-Source: ABhQp+TWSugdoBboFg4w8jGMv0qjTtSeauBXInsbsTqGoMKrGlICbMnuroSUOoOae7PSXJ0na53Bbg== X-Received: by 10.84.132.9 with SMTP id 9mr4937698ple.77.1509036346937; Thu, 26 Oct 2017 09:45:46 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id 84sm11059958pfy.179.2017.10.26.09.45.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 09:45:46 -0700 (PDT) Subject: [PATCH] RISC-V: Correct and improve the "-mabi" documentation Date: Thu, 26 Oct 2017 09:45:07 -0700 Message-Id: <20171026164507.2631-1-palmer@dabbelt.com> Cc: Alex Bradbury , patches@groups.riscv.org, Palmer Dabbelt From: Palmer Dabbelt To: gcc-patches@gcc.gnu.org X-IsSubscribed: yes The documentation for the "-mabi" argument on RISC-V was incorrect. We chose to treat this as a documentation bug rather than a code bug, and to make the documentation match what GCC currently does. In the process, I also improved the documentation a bit. Thanks to Alex Bradbury for finding the bug! PR target/82717: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82717 gcc/ChangeLog 2017-10-26 Palmer Dabbelt PR target/82717 * doc/invoke.texi (RISC-V) <-mabi>: Correct and improve. --- gcc/doc/invoke.texi | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 71b2445f70fd..d184e1d7b7d4 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21669,9 +21669,26 @@ When generating PIC code, allow the use of PLTs. Ignored for non-PIC. @item -mabi=@var{ABI-string} @opindex mabi -Specify integer and floating-point calling convention. This defaults to the -natural calling convention: e.g.@ LP64 for RV64I, ILP32 for RV32I, LP64D for -RV64G. +@item -mabi=@var{ABI-string} +@opindex mabi +Specify integer and floating-point calling convention. @var{ABI-string} +contains two parts: the size of integer types and the registers used for +floating-point types. For example @samp{-march=rv64ifd -mabi=lp64d} means that +@samp{long} and pointers are 64-bit (implicitly defining @samp{int} to be +32-bit), and that floating-point values up to 64 bits wide are passed in F +registers. Contrast this with @samp{-march=rv64ifd -mabi=lp64f}, which still +allows the compiler to generate code that uses the F and D extensions but only +allows floating-point values up to 32 bits long to be passed in registers; or +@samp{-march=rv64ifd -mabi=lp64}, in which no floating-point arguments will be +passed in registers. + +The default for this argument is system dependent, users who want a specific +calling convention should specify one explicitly. The valid calling +conventions are: @samp{ilp32}, @samp{ilp32f}, @samp{ilp32d}, @samp{lp64}, +@samp{lp64f}, and @samp{lp64d}. Some calling conventions are impossible to +implement on some ISAs: for example, @samp{-march=rv32if -mabi=ilp32d} is +invalid because the ABI requires 64-bit values be passed in F registers, but F +registers are only 32 bits wide. @item -mfdiv @itemx -mno-fdiv