[PATCH 1/2] bpf, doc: Clarify Pseudo-C notation and w vs r register usage

Vineet Gupta vineet.gupta@linux.dev
Wed Apr 1 18:10:34 GMT 2026


On 4/1/26 10:59 AM, bot+bpf-ci@kernel.org wrote:
>> +Note: BPF ISA is unique as it uses "Pseudo-C" notation for the assembly
>> +      instructions. In the table below, the column name actually specifies
>> +      the encodings. Assembly instructions (as generated by compilers) are
> Looking at the arithmetic instructions table just below, the columns are
> "name", "code", "offset", and "description".  The "name" column contains
> mnemonics (ADD, SUB, MUL, etc.) while the "code" column has the actual
> numeric encodings (0x0, 0x1, 0x2, etc.).

My understanding is that the ISA itself is specified in Pesudo-C 
assembly and formally lacks mnemonics which in a conventional ISA would 
would refer to the "operator" of an instruction, spelled out in English.

> Does "the column name actually specifies the encodings" refer to the
> column titled "name"?

Yes that's what I meant.

> If so, those are mnemonic names rather than
> encodings.  The numeric encodings are in the "code" column.  Could this
> be reworded to avoid conflating mnemonics with encodings?

I can omit this part if this is controversial or non agreeable.


>> +      specified in the description column for some cases. Description of
>> +      ``?DIV``, ``?MOD`` includes additional logic part of semantics not
>> +      actual assembly.
> The "?DIV" and "?MOD" notation appears to use '?' as a wildcard to
> match both DIV/SDIV and MOD/SMOD, but this convention is not defined
> anywhere in the document.  Would it be clearer to spell these out
> explicitly, e.g. "DIV/SDIV" and "MOD/SMOD"?

OK.

> Also, "includes additional logic part of semantics not actual assembly"
> reads a bit rough.  Perhaps something like "includes additional semantic
> logic, not actual assembly" would be clearer.

OK.

Thx,
-Vineet


More information about the bpf mailing list