]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
bpf: Add atomic compare-and-exchange instructions
authorDavid Faust <david.faust@oracle.com>
Mon, 24 Jul 2023 21:50:34 +0000 (14:50 -0700)
committerDavid Faust <david.faust@oracle.com>
Tue, 25 Jul 2023 20:40:06 +0000 (13:40 -0700)
commit02f68ef297b8d4b51829e850da0ec898e529372f
tree9121a3515ee517e64eadab2d11946d2e6e15ff7e
parent055a4c8e0f100bbca2ff7cd6fb423dece561a8cd
bpf: Add atomic compare-and-exchange instructions

This patch adds the two remaining BPF v3 atomic instructions:
- BPF_INSN_ACMP{,32}: atomic compare-and-swap
- BPF_INSN_AXCHG{,32}: atomic (non-conditional) exchange

Tests and documentation are also updated.

gas/
* doc/c-bpf.texi (BPF Instructions): Document atomic exchange and
atomic compare-and-swap instructions.
* testsuite/gas/bpf/atomic.s: Test ACMP, ACMP32, AXCHG, AXCGH32
instructions.
* testsuite/gas/bpf/atomic.d: Likewise.
* testsuite/gas/bpf/atomic-be.d: Likewise.
* testsuite/gas/bpf/atomic-pseudoc.s: Likewise.
* testsuite/gas/bpf/atomic-pseudoc.d: Likewise.
* testsuite/gas/bpf/atomic-be-pseudoc.d: Likewise.

include/
* opcode/bpf.h (BPF_IMM32_ACMP): Fix typo.
(enum bpf_insn_id): New entries for BPF_INSN_ACMP{,32} and
BPF_INSN_AXCHG{,32}.

opcodes/
* bpf-opc.c (bpf_opcodes): Add entries for ACMP{,32} and
AXCHG{,32} instructions.
gas/doc/c-bpf.texi
gas/testsuite/gas/bpf/atomic-be-pseudoc.d
gas/testsuite/gas/bpf/atomic-be.d
gas/testsuite/gas/bpf/atomic-pseudoc.d
gas/testsuite/gas/bpf/atomic-pseudoc.s
gas/testsuite/gas/bpf/atomic.d
gas/testsuite/gas/bpf/atomic.s
include/opcode/bpf.h
opcodes/bpf-opc.c