Skip to content

Commit ef22d47

Browse files
committed
Fix 4-bit code field values in tables
Signed-off-by: Dave Thaler <[email protected]>
1 parent b786e45 commit ef22d47

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

isa/kernel.org/instruction-set.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ The encoding of the 'opcode' field varies and can be determined from
109109
the three least significant bits (LSB) of the 'opcode' field which holds
110110
the "instruction class", as follows:
111111

112-
========= ===== =============================== =================
112+
========= ===== =============================== ===================================
113113
class value description reference
114-
========= ===== =============================== =================
114+
========= ===== =============================== ===================================
115115
BPF_LD 0x00 non-standard load operations `Load and store instructions`_
116116
BPF_LDX 0x01 load into register operations `Load and store instructions`_
117117
BPF_ST 0x02 store from immediate operations `Load and store instructions`_
@@ -120,7 +120,7 @@ BPF_ALU 0x04 32-bit arithmetic operations `Arithmetic and jump instruct
120120
BPF_JMP 0x05 64-bit jump operations `Arithmetic and jump instructions`_
121121
BPF_JMP32 0x06 32-bit jump operations `Arithmetic and jump instructions`_
122122
BPF_ALU64 0x07 64-bit arithmetic operations `Arithmetic and jump instructions`_
123-
========= ===== =============================== =================
123+
========= ===== =============================== ===================================
124124

125125
Arithmetic and jump instructions
126126
================================
@@ -140,12 +140,12 @@ code
140140
source
141141
the source operand location, which unless otherwise specified is one of:
142142

143-
====== ===== ========================================
143+
====== ===== ==========================================
144144
source value description
145-
====== ===== ========================================
145+
====== ===== ==========================================
146146
BPF_K 0x00 use 32-bit 'imm' value as source operand
147147
BPF_X 0x08 use 'src' register value as source operand
148-
====== ===== ========================================
148+
====== ===== ==========================================
149149

150150
instruction class
151151
the instruction class (see `Instruction classes`_)
@@ -159,9 +159,9 @@ otherwise identical operations.
159159

160160
The 4-bit 'code' field encodes the operation as follows:
161161

162-
======== ===== =================================================
162+
======== ===== ==========================================================
163163
code value description
164-
======== ===== =================================================
164+
======== ===== ==========================================================
165165
BPF_ADD 0x00 dst += src
166166
BPF_SUB 0x10 dst -= src
167167
BPF_MUL 0x20 dst \*= src
@@ -176,7 +176,7 @@ BPF_XOR 0xa0 dst ^= src
176176
BPF_MOV 0xb0 dst = src
177177
BPF_ARSH 0xc0 sign extending shift right
178178
BPF_END 0xd0 byte swap operations (see `Byte swap instructions`_ below)
179-
======== ===== =================================================
179+
======== ===== ==========================================================
180180

181181
where 'src' is the source operand value.
182182

@@ -268,22 +268,22 @@ The 4-bit 'code' field encodes the operation as below, where PC is the program c
268268
======== ===== === ========================== ========================
269269
code value src description notes
270270
======== ===== === ========================== ========================
271-
BPF_JA 0x00 0x0 PC += offset BPF_JMP only
272-
BPF_JEQ 0x10 any PC += offset if dst == src
273-
BPF_JGT 0x20 any PC += offset if dst > src unsigned
274-
BPF_JGE 0x30 any PC += offset if dst >= src unsigned
275-
BPF_JSET 0x40 any PC += offset if dst & src
276-
BPF_JNE 0x50 any PC += offset if dst != src
277-
BPF_JSGT 0x60 any PC += offset if dst > src signed
278-
BPF_JSGE 0x70 any PC += offset if dst >= src signed
279-
BPF_CALL 0x80 0x0 call helper function imm see `Helper functions`_
280-
BPF_CALL 0x80 0x1 call PC += offset see `eBPF functions`_
281-
BPF_CALL 0x80 0x2 call runtime function imm see `Runtime functions`_
282-
BPF_EXIT 0x95 0x0 return BPF_JMP only
283-
BPF_JLT 0xa0 any PC += offset if dst < src unsigned
284-
BPF_JLE 0xb0 any PC += offset if dst <= src unsigned
285-
BPF_JSLT 0xc0 any PC += offset if dst < src signed
286-
BPF_JSLE 0xd0 any PC += offset if dst <= src signed
271+
BPF_JA 0x0 0x0 PC += offset BPF_JMP only
272+
BPF_JEQ 0x1 any PC += offset if dst == src
273+
BPF_JGT 0x2 any PC += offset if dst > src unsigned
274+
BPF_JGE 0x3 any PC += offset if dst >= src unsigned
275+
BPF_JSET 0x4 any PC += offset if dst & src
276+
BPF_JNE 0x5 any PC += offset if dst != src
277+
BPF_JSGT 0x6 any PC += offset if dst > src signed
278+
BPF_JSGE 0x7 any PC += offset if dst >= src signed
279+
BPF_CALL 0x8 0x0 call helper function imm see `Helper functions`_
280+
BPF_CALL 0x8 0x1 call PC += offset see `eBPF functions`_
281+
BPF_CALL 0x8 0x2 call runtime function imm see `Runtime functions`_
282+
BPF_EXIT 0x9 0x0 return BPF_JMP only
283+
BPF_JLT 0xa any PC += offset if dst < src unsigned
284+
BPF_JLE 0xb any PC += offset if dst <= src unsigned
285+
BPF_JSLT 0xc any PC += offset if dst < src signed
286+
BPF_JSLE 0xd any PC += offset if dst <= src signed
287287
======== ===== === ========================== ========================
288288

289289
Helper functions
@@ -401,7 +401,7 @@ The 'imm' field is used to encode the actual atomic operation.
401401
Simple atomic operation use a subset of the values defined to encode
402402
arithmetic operations in the 'imm' field to encode the atomic operation:
403403

404-
======== ===== ===========
404+
======== ===== ===========
405405
imm value description
406406
======== ===== ===========
407407
BPF_ADD 0x00 atomic add

0 commit comments

Comments
 (0)