@@ -20,60 +20,57 @@ pub enum SBPFVersion {
20
20
}
21
21
22
22
impl SBPFVersion {
23
- /// Enable the little-endian byte swap instructions
24
- pub fn disable_le ( & self ) -> bool {
23
+ /// Enable SIMD-0166: SBPF dynamic stack frames
24
+ pub fn dynamic_stack_frames ( & self ) -> bool {
25
25
self != & SBPFVersion :: V1
26
26
}
27
27
28
- /// Enable the negation instruction
29
- pub fn disable_neg ( & self ) -> bool {
28
+ /// Enable SIMD-0173: SBPF instruction encoding improvements
29
+ pub fn callx_uses_src_reg ( & self ) -> bool {
30
30
self != & SBPFVersion :: V1
31
31
}
32
-
33
- /// Swaps the reg and imm operands of the subtraction instruction
34
- pub fn swap_sub_reg_imm_operands ( & self ) -> bool {
32
+ /// ... SIMD-0173
33
+ pub fn disable_lddw ( & self ) -> bool {
35
34
self != & SBPFVersion :: V1
36
35
}
37
-
38
- /// Enable the only two slots long instruction: LD_DW_IMM
39
- pub fn disable_lddw ( & self ) -> bool {
36
+ /// ... SIMD-0173
37
+ pub fn disable_le ( & self ) -> bool {
40
38
self != & SBPFVersion :: V1
41
39
}
42
40
43
- /// Enable the BPF_PQR instruction class
41
+ /// Enable SIMD-0174: SBPF arithmetics improvements
44
42
pub fn enable_pqr ( & self ) -> bool {
45
43
self != & SBPFVersion :: V1
46
44
}
47
-
48
- /// Use src reg instead of imm in callx
49
- pub fn callx_uses_src_reg ( & self ) -> bool {
45
+ /// ... SIMD-0174
46
+ pub fn disable_neg ( & self ) -> bool {
50
47
self != & SBPFVersion :: V1
51
48
}
52
-
53
- /// Ensure that rodata sections don't exceed their maximum allowed size and
54
- /// overlap with the stack
55
- pub fn reject_rodata_stack_overlap ( & self ) -> bool {
49
+ /// ... SIMD-0174
50
+ pub fn swap_sub_reg_imm_operands ( & self ) -> bool {
56
51
self != & SBPFVersion :: V1
57
52
}
53
+ /// ... SIMD-0174
54
+ pub fn implicit_sign_extension_of_results ( & self ) -> bool {
55
+ self == & SBPFVersion :: V1
56
+ }
58
57
59
- /// Allow sh_addr != sh_offset in elf sections. Used in V2 to align
60
- /// section vaddrs to MM_PROGRAM_START.
61
- pub fn enable_elf_vaddr ( & self ) -> bool {
58
+ /// Enable SIMD-0176: SBPF static syscalls
59
+ pub fn static_syscalls ( & self ) -> bool {
62
60
self != & SBPFVersion :: V1
63
61
}
64
62
65
- /// Use dynamic stack frame sizes
66
- pub fn dynamic_stack_frames ( & self ) -> bool {
63
+ /// Enable SIMD-XXXX: SBPF stricter controlflow
64
+ pub fn stricter_controlflow ( & self ) -> bool {
67
65
self != & SBPFVersion :: V1
68
66
}
69
67
70
- /// Support syscalls via pseudo calls (insn.src = 0)
71
- pub fn static_syscalls ( & self ) -> bool {
68
+ /// Enable SIMD-XXXX: Stricter ELF header
69
+ pub fn reject_rodata_stack_overlap ( & self ) -> bool {
72
70
self != & SBPFVersion :: V1
73
71
}
74
-
75
- /// Restricts jump and call targets to function boundaries
76
- pub fn stricter_controlflow ( & self ) -> bool {
72
+ /// ... SIMD-XXXX
73
+ pub fn enable_elf_vaddr ( & self ) -> bool {
77
74
self != & SBPFVersion :: V1
78
75
}
79
76
}
0 commit comments