All of lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	linuxppc-dev@lists.ozlabs.org,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH] powerpc/vdso: Don't use r30 to avoid breaking Go lang
Date: Fri, 30 Jul 2021 18:55:54 -0500	[thread overview]
Message-ID: <20210730235554.GJ1583@gate.crashing.org> (raw)
In-Reply-To: <CAKwvOdmR9nB3T-PLNSGea3=9qbZuOoLs5D22UPRBbvw_+aOO7A@mail.gmail.com>

On Thu, Jul 29, 2021 at 09:25:43AM -0700, Nick Desaulniers wrote:
> On Thu, Jul 29, 2021 at 6:42 AM Paul Menzel <pmenzel@molgen.mpg.de> wrote:
> > Am 29.07.21 um 15:12 schrieb Michael Ellerman:
> > > Note this only works with GCC, clang does not support -ffixed-rN.
> >
> > Maybe the clang/LLVM build support folks (in CC) have an idea.
> 
> Right, we've had issues with these in the past.  Generally, we need to
> teach clang about which registers are valid for `N` so that it can
> diagnose invalid values ASAP.  This has to be done on a per arch basis
> in LLVM to steal the register from the register allocator.  For
> example, this was used previously for aarch64 (but removed from use in
> the kernel) and IIRC is used for m68k (which we're working to get
> builds online for).

In GCC, it is -ffixed-* (note: no "r").  The string is stripped of the
standard prefix for the target (for Power, none), and possibly of one
"%" or "#".  If the string is a recognised register name (or alternative
register name) for the target, that is used.  If not, and it is a
decimal number, then the internal GCC register of that number is used
(these numbers can differ from one GCC release to another, and in fact
we have changed the numbering for Power before -- but 0..31 have always
been the GPRs, and 32..63 have always been the FPRs).

The names for the Power registers are:
GPRs:
  0..31, or alternatively
  r0..r31
FPRs:
  0..31, or alternatively
  fr0..fr31, or alternatively
  vs0..vs31
VRs:
  0..31, or alternatively
  v0..v31, or alternatively
  vs32..vs63
CR fields:
  0..7, or alternatively
  cr0..cr7

(There are more, but changing the default calling convention for those
will not work anyway.  Also, some non-Linux configurations use different
names.)


Segher

  reply	other threads:[~2021-07-31  0:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 13:12 Michael Ellerman
2021-07-29 13:42 ` Paul Menzel
2021-07-29 16:25   ` Nick Desaulniers
2021-07-30 23:55     ` Segher Boessenkool [this message]
2021-08-01 13:14 ` Michael Ellerman
2021-08-02 11:27 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210730235554.GJ1583@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=pmenzel@molgen.mpg.de \
    --subject='Re: [PATCH] powerpc/vdso: Don'\''t use r30 to avoid breaking Go lang' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.