Re: [RFC PATCH bpf-next 01/13] bpf: Support new sign-extension load insns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 7/2/23 5:53 PM, Alexei Starovoitov wrote:
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.

Sounds good to me! Will use the above suggested names
in the next revision.


Naming is hard, of course.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux