aboutsummaryrefslogtreecommitdiff
path: root/gas/doc/c-bpf.texi
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2023-08-21 09:07:11 -0700
committerDavid Faust <david.faust@oracle.com>2023-08-21 10:07:25 -0700
commit41aa80c5440ff24fc931fa2a3e681213dc1dbdec (patch)
treeeeda5e5d2a14d7f6927af428599c89d089a259d8 /gas/doc/c-bpf.texi
parent11e3488d3f787d51196a115fd9c6085e57bd9626 (diff)
downloadgdb-41aa80c5440ff24fc931fa2a3e681213dc1dbdec.zip
gdb-41aa80c5440ff24fc931fa2a3e681213dc1dbdec.tar.gz
gdb-41aa80c5440ff24fc931fa2a3e681213dc1dbdec.tar.bz2
bpf: correct neg and neg32 instruction encoding
The neg/neg32 BPF instructions always use BPF_SRC_K (=0) in their header source bit, despite operating on registers. If BPF_SRC_X (=1) is set, the instructions are rejected by the kernel. Because of this there are also no neg/neg32 instructions which operate on immediates, so remove them. bd434cc4d94ec3d2f9fc1e7c00c27b074f962bc1 was a similar fix in the old CGEN-based port, but was not carried forward in the new port. include/ * opcode/bpf.h (enum bpf_insn_id): Remove spurious entries BPF_INSN_NEGI and BPF_INSN_NEG32I. opcodes/ * bpf-opc.c (bpf_opcodes): Remove erroneous NEGI and NEG32I instructions. gas/ * doc/c-bpf.texi (BPF Instructions): Remove erroneous neg and neg32 instructions operating on immediates. * testsuite/gas/bpf/alu.s: Adapt accordingly. * testsuite/gas/bpf/alu.d: Likewise. * testsuite/gas/bpf/alu-be.d: Likewise * testsuite/gas/bpf/alu32.s: Likewise. * testsuite/gas/bpf/alu32.d: Likewise. * testsuite/gas/bpf/alu32-be.d: Likewise. * testsuite/gas/bpf/alu-pseudoc.s: Likewise. * testsuite/gas/bpf/alu-pseudoc.d: Likewise. * testsuite/gas/bpf/alu-be-pseudoc.d: Likewise. * testsuite/gas/bpf/alu32-pseudoc.s: Likewise. * testsuite/gas/bpf/alu32-pseudoc.d: Likewise. * testsuite/gas/bpf/alu32-be-pseudoc.d: Likewise.
Diffstat (limited to 'gas/doc/c-bpf.texi')
-rw-r--r--gas/doc/c-bpf.texi16
1 files changed, 0 insertions, 16 deletions
diff --git a/gas/doc/c-bpf.texi b/gas/doc/c-bpf.texi
index 75372de..bdd9fde 100644
--- a/gas/doc/c-bpf.texi
+++ b/gas/doc/c-bpf.texi
@@ -256,17 +256,9 @@ registers.
64-bit right arithmetic shift, by @code{rs} or @code{imm32} bits.
@item neg rd
-@itemx neg rd, imm32
@itemx rd = - rd
-@itemx rd = - imm32
64-bit arithmetic negation.
-Note that in the @code{rd = - imm32} syntax there must be at least
-one white space between @code{-} and @code{imm32}. Otherwise the
-instruction is parsed as a @code{mov rd, imm32} instruction with a
-negative 32-bit immediate. This is a consequence of a syntactic
-ambiguity in the pseudoc syntax.
-
@item mov rd, rs
@itemx mov rd, imm32
@itemx rd = rs
@@ -363,17 +355,9 @@ in the same instruction.
32-bit right arithmetic shift, by @code{rs} or @code{imm32} bits.
@item neg32 rd
-@itemx neg32 rd, imm32
@itemx rd = - rd
-@itemx rd = - imm32
32-bit arithmetic negation.
-Note that in the @code{rd = - imm32} syntax there must be at least
-one white space between @code{-} and @code{imm32}. Otherwise the
-instruction is parsed as a @code{mov32 rd, imm32} instruction with a
-negative 32-bit immediate. This is a consequence of a syntactic
-ambiguity in the pseudoc syntax.
-
@item mov32 rd, rs
@itemx mov32 rd, imm32
@itemx rd = rs