The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Laight <david.laight.linux@gmail.com>
Cc: "Borislav Betkov" <bp@alien8.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Thomas Gleinxer" <tglx@linutronix.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	"Nicolas Pitre" <npitre@baylibre.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	rodrigo.alencar@analog.com, jic23@kernel.org
Subject: Re: [PATCH 2/2] x86/local: local_add/local_sub: Support large immediate values
Date: Mon, 3 Aug 2026 12:01:14 +0200	[thread overview]
Message-ID: <20260803100114.GG49951@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260803094702.3852-3-david.laight.linux@gmail.com>

On Mon, Aug 03, 2026 at 10:47:02AM +0100, David Laight wrote:
> Replace the "ir" constraint with "er" so that constants over 2^31
> get loaded into a register.
> 
> Signed-off-by: David Laight <david.laight.linux@gmail.com>
> ---
>  arch/x86/include/asm/local.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
> index 4957018fef3e..68af7b74450a 100644
> --- a/arch/x86/include/asm/local.h
> +++ b/arch/x86/include/asm/local.h
> @@ -32,14 +32,14 @@ static inline void local_add(long i, local_t *l)
>  {
>  	asm volatile(_ASM_ADD "%1,%0"
>  		     : "+m" (l->a.counter)
> -		     : "ir" (i));
> +		     : "er" (i));
>  }
>  
>  static inline void local_sub(long i, local_t *l)
>  {
>  	asm volatile(_ASM_SUB "%1,%0"
>  		     : "+m" (l->a.counter)
> -		     : "ir" (i));
> +		     : "er" (i));
>  }

And the other two sites already have "er", how inconsistent :/

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  reply	other threads:[~2026-08-03 10:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  9:47 [PATCH 0/2] x86: Use "er" asm constriant for add/sub David Laight
2026-08-03  9:47 ` [PATCH 1/2] lib: mul_u64_add_u64_div_u64: Fix addition of large constants David Laight
2026-08-03 10:08   ` H. Peter Anvin
2026-08-03  9:47 ` [PATCH 2/2] x86/local: local_add/local_sub: Support large immediate values David Laight
2026-08-03 10:01   ` Peter Zijlstra [this message]
2026-08-03 10:07   ` H. Peter Anvin
2026-08-03  9:59 ` [PATCH 0/2] x86: Use "er" asm constriant for add/sub Peter Zijlstra
2026-08-03 14:49 ` Nicolas Pitre
2026-08-03 15:39   ` David Laight

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=20260803100114.GG49951@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.laight.linux@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jic23@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=npitre@baylibre.com \
    --cc=rodrigo.alencar@analog.com \
    --cc=tglx@linutronix.de \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=x86@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