[PATCH 2/2] bpf: md: fix zero_extendsidi2 reg->reg codegen [PR124670]

Vineet Gupta vineet.gupta@linux.dev
Fri Mar 27 22:55:03 GMT 2026


On 3/27/26 3:41 PM, Jose E. Marchesi wrote:
>> Note that 'W specifier ignores the RTL mode and unconditionally emits
>> the 'w' reg which might feel like creating a potential future bug.
>>
>> However for this insn, it is correct/completely safe as follows:
>>   - 'W1' for src operand: src operand has a SI mode in pattern.
>>   - 'W0' for dst: Technically dst is DI, but the upper 32-bits of output
>>     have to be 0 due to zero-extension, thus a 'w' reg is OK.
> Using wN for registers in the pseudo-C syntax simply selects the mov32
> opcode.  Please use %W in both destination and source in the template.
> It makes little sense to use %w in an operand with a fixed mode.

Hmm, I intended to use 'W' as the commentary above suggests,must have 
fat-fingered it.
Fixed in v2.

Thx for the quick review !
-Vineet


More information about the bpf mailing list