public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Fangrui Song <maskray@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Jisheng Zhang <jszhang@kernel.org>,
	Peter Smith <peter.smith@arm.com>,
	llvm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: jump_label: use constraints "Si" instead of "i"
Date: Mon, 5 Feb 2024 15:19:47 +0000	[thread overview]
Message-ID: <ZcD8k2UTs3wyk9Dx@e133380.arm.com> (raw)
In-Reply-To: <CAMj1kXGN-nKSzxJoyM9peBTDevuPkH-+P2UzH746P-F913Dg-g@mail.gmail.com>

On Sat, Feb 03, 2024 at 10:50:44AM +0100, Ard Biesheuvel wrote:
> On Fri, 2 Feb 2024 at 23:51, Fangrui Song <maskray@google.com> wrote:

[...]

> > "Si" is fine for GCC and Clang.
> > "i" is fine for Clang but not for GCC PIC.
> >
> >      https://maskray.me/blog/2024-01-30-raw-symbol-names-in-inline-assembly#aarch64
> >
> >      In gcc/config/aarch64, LEGITIMATE_PIC_OPERAND_P(X) disallows any symbol
> >      reference, which means that "i" and "s" cannot be used for PIC. Instead,
> >      the constraint "S" has been supported since the initial port (2012) to
> >      reference a symbol or label.
> >
> > I am also not familiar with
> > https://gcc.gnu.org/onlinedocs/gcc/Multi-Alternative.html (comma in a
> > constraint string). Thankfully we don't need this powerful construct:)

Ack, I had thought that this was relevant, but it is not,
and "Si" seems right.

[...]

> > I am convinced by Ard' argument that two inputs (key, branch) deserve
> > two operands.
> > The existing "i"(&((char *)key)[branch]) is kinda ugly and also longer:)
> 
> If it helps clarify things, we might do something like
> 
> ".quad  (%[key]  - .) + %[bit0]"
> 
> : : [key]"Si"(key), [bit0]"i"(branch) :  : l_yes);

I don't have a strong opinion on the naming, but something like this
seems fine.

Cheers
---Dave

      reply	other threads:[~2024-02-05 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 22:35 [PATCH] arm64: jump_label: use constraints "Si" instead of "i" Fangrui Song
2024-02-02 15:56 ` Dave Martin
2024-02-02 16:32   ` Ard Biesheuvel
2024-02-02 16:54     ` Dave Martin
2024-02-02 22:51       ` Fangrui Song
2024-02-03  9:50         ` Ard Biesheuvel
2024-02-05 15:19           ` Dave Martin [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=ZcD8k2UTs3wyk9Dx@e133380.arm.com \
    --to=dave.martin@arm.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=jszhang@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=maskray@google.com \
    --cc=peter.smith@arm.com \
    --cc=will@kernel.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