On Wed, Jun 28, 2023 at 11:37:21PM -0700, Yonghong Song wrote: > > +/* LDX: dst_reg = *(s8*)(src_reg + off) */ > +static void emit_lds(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off) > +{ ... > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index 60a9d59beeab..b28109bc5c54 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -19,6 +19,7 @@ > > /* ld/ldx fields */ > #define BPF_DW 0x18 /* double word (64-bit) */ > +#define BPF_MEMS 0x80 /* load with sign extension */ Intel assembly instruction to do sign extending mov is called 'movsx'. Let's adopt SX suffix here and in other patches ? s/BPF_MEMS/BPF_MEMSX/ here. s/emit_lds/emit_ldsx/ above. s/emit_movs_reg/emit_movsx_reg/ in patch 3. s/bpf_movs_string/bpf_movsx_string/ in patch 7 s/bpf_lds_string/bpf_ldsx_string/ in patch 7. s/is_movs/is_movsx/ in patch 7. sdiv/smod can stay as-is. Naming is hard, of course.