Skip to content

Commit d90c7bc

Browse files
committed
eBPF.md: add Jump-32bit class instructions
Reflecting the recent addition of 32-bit jump instruction class support to the Linux kernel [0], add the related instructions to the unofficial spec to keep it up-to-date. [0] merge commit ae575c8a9868 ("Merge branch 'jmp32-insns'")
1 parent b5ac15b commit d90c7bc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

eBPF.md

+32
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ Opcode | Mnemonic | Pseudocode
158158

159159
## Branch Instructions
160160

161+
### 64-bit
162+
161163
Opcode | Mnemonic | Pseudocode
162164
-------|---------------------|------------------------
163165
0x05 | ja +off | PC += off
@@ -185,3 +187,33 @@ Opcode | Mnemonic | Pseudocode
185187
0xdd | jsle dst, src, +off | PC += off if dst <= src (signed)
186188
0x85 | call imm | Function call
187189
0x95 | exit | return r0
190+
191+
### 32-bit
192+
193+
These instructions use only the lower 32 bits of their operands and zero the
194+
upper 32 bits of the destination register.
195+
196+
Opcode | Mnemonic | Pseudocode
197+
-------|---------------------|------------------------
198+
0x16 | jeq dst, imm, +off | PC += off if dst == imm
199+
0x1e | jeq dst, src, +off | PC += off if dst == src
200+
0x26 | jgt dst, imm, +off | PC += off if dst > imm
201+
0x2e | jgt dst, src, +off | PC += off if dst > src
202+
0x36 | jge dst, imm, +off | PC += off if dst >= imm
203+
0x3e | jge dst, src, +off | PC += off if dst >= src
204+
0xa6 | jlt dst, imm, +off | PC += off if dst < imm
205+
0xae | jlt dst, src, +off | PC += off if dst < src
206+
0xb6 | jle dst, imm, +off | PC += off if dst <= imm
207+
0xbe | jle dst, src, +off | PC += off if dst <= src
208+
0x46 | jset dst, imm, +off | PC += off if dst & imm
209+
0x4e | jset dst, src, +off | PC += off if dst & src
210+
0x56 | jne dst, imm, +off | PC += off if dst != imm
211+
0x5e | jne dst, src, +off | PC += off if dst != src
212+
0x66 | jsgt dst, imm, +off | PC += off if dst > imm (signed)
213+
0x6e | jsgt dst, src, +off | PC += off if dst > src (signed)
214+
0x76 | jsge dst, imm, +off | PC += off if dst >= imm (signed)
215+
0x7e | jsge dst, src, +off | PC += off if dst >= src (signed)
216+
0xc6 | jslt dst, imm, +off | PC += off if dst < imm (signed)
217+
0xce | jslt dst, src, +off | PC += off if dst < src (signed)
218+
0xd6 | jsle dst, imm, +off | PC += off if dst <= imm (signed)
219+
0xde | jsle dst, src, +off | PC += off if dst <= src (signed)

0 commit comments

Comments
 (0)