[iovisor-dev] [PATCH, BPF 4/5] BPF: Add 32-bit move patterns

overall great improvement,
but before we go too far with new asm syntax like 'movw',
Do you want to revamp the whole thing?
imo the kernel verifier asm output is easier to read
due to being C-like and now more people understand it
vs what llvm bpf backend produces.
Canonical assembler style used here has intel vs gnu ambiguity
which C-style avoids.
The concern is that if we continue with existing llvm bpf asm
syntax, the gnu asm and other assemblers will come along
and it will be too late to change.
Right now we have two asms: what kernel verifier prints
and llvm bpf asm output. Kernel side we cannot drastically
change anymore, but minor changes should be ok if it
helps to converge to one common bpf asm syntax.
Few folks requested to add support for bpf inline asm in C too.

but before we go too far with new asm syntax like 'movw',
Do you want to revamp the whole thing?
imo the kernel verifier asm output is easier to read
due to being C-like and now more people understand it
vs what llvm bpf backend produces.

While the kernel verifier format is ok for the 64-bit opcodes, I personally
can't stand what it does for the 32-bit opcodes, e.g.

  (u32) r0 += (u32) r1

That's not only unnecessarily verbose, it's bad C.

Right now we have two asms: what kernel verifier prints
and llvm bpf asm output. Kernel side we cannot drastically
change anymore, but minor changes should be ok if it
helps to converge to one common bpf asm syntax.

Why, is the kernel verifier output considered part of the abi now? That seems
like an odd position to take.

I also have a disassembler written for elfutils, so that it ties in nicely with
objdump. I started with tweaks to the kernel output (which can be seen in the
post I quoted earlier), but have since changed to use the llvm disassembly (and
have not yet re-posted).

r~