[PATCH 2/2] x86/local: local_add/local_sub: Support large immediate values
From: David Laight
Date: Mon Aug 03 2026 - 05:56:58 EST
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@xxxxxxxxx>
---
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));
}
/**
--
2.39.5