linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: How to use "y" constraint in GCC inline powerpc assembly ?
Date: Sat, 18 Apr 2020 16:39:53 -0500	[thread overview]
Message-ID: <20200418213953.GO26902@gate.crashing.org> (raw)
In-Reply-To: <9fd93f18-652e-c301-f110-d9f07201330d@c-s.fr>

Hi!

On Sat, Apr 18, 2020 at 08:28:53AM +0000, Christophe Leroy wrote:
> I'd like to use cr instead of gpr to return error condition from 
> __get_user().
> 
> I saw in GCC doc 
> (https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html) that it is 
> possible to use "y" as constraint to refer to "Any condition register 
> field, cr0…cr7".
> 
> I tried the test below, but it fails with "error: impossible register 
> constraint in 'asm'"
> 
> How does "y" has to be used ?

The same as "x".  You cannot really use these constraints in asm, it's
internal only.  I'll remove it from the inline asm documentation.  Thanks!

(You should put the cr fields you use in an inline asm in its clobber
list, i.e. "cr0" or "cr7").


Segher

      reply	other threads:[~2020-04-18 21:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18  8:28 How to use "y" constraint in GCC inline powerpc assembly ? Christophe Leroy
2020-04-18 21:39 ` Segher Boessenkool [this message]

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=20200418213953.GO26902@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).