Re: [PATCH 0/2] x86: Use "er" asm constriant for add/sub
From: Peter Zijlstra
Date: Mon Aug 03 2026 - 06:17:43 EST
On Mon, Aug 03, 2026 at 10:47:00AM +0100, David Laight wrote:
> The x86 instruction set only supports 32bit signed immediate values
> for add/sub.
> Replace the "ir" constraint with "er" to avoid build errors.
>
> Found by a patch that added used mul_u64_add_u64_div_u64() to
> do a rounding divide by 2^32 (perhaps not the best way to do this).
>
> A quick grep only found one other affected file.
I suppose the percpu stuff works because of __pcpu_cast_4 truncating the
value to u32 and then ignoring the whole signed/unsigned business. And
__pcpu_reg_imm_8 has "re".