diff options
author | Jose E. Marchesi <jose.marchesi@oracle.com> | 2023-07-24 02:54:06 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2023-07-24 02:54:06 +0200 |
commit | 5cbe549257b0aed1b615714e74bb6a3f066f3253 (patch) | |
tree | e68230c56c241d79ad0061a2589971a9b0d3ee2b /include | |
parent | a50ead7822bef29a45d6e660e23264d76545981b (diff) | |
download | gdb-5cbe549257b0aed1b615714e74bb6a3f066f3253.zip gdb-5cbe549257b0aed1b615714e74bb6a3f066f3253.tar.gz gdb-5cbe549257b0aed1b615714e74bb6a3f066f3253.tar.bz2 |
bpf: gas,include,opcode: add suppor for instructions BSWAP{16,32,64}
This patch adds support for the BPF V4 ISA byte swap instructions to
opcodes, assembler and disassembler.
Tested in bpf-unknown-none.
include/ChangeLog:
2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com>
* opcode/bpf.h (BPF_IMM32_BSWAP16): Define.
(BPF_IMM32_BSWAP32): Likewise.
(BPF_IMM32_BSWAP64): Likewise.
(enum bpf_insn_id): New entries BPF_INSN_BSWAP{16,32,64}.
opcodes/ChangeLog:
2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com>
* bpf-opc.c (bpf_opcodes): Add entries for the BSWAP*
instructions.
gas/ChangeLog:
2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com>
* doc/c-bpf.texi (BPF Instructions): Document BSWAP* instructions.
* testsuite/gas/bpf/alu.s: Test BSWAP{16,32,64} instructions.
* testsuite/gas/bpf/alu.d: Likewise.
* testsuite/gas/bpf/alu-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.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 7 | ||||
-rw-r--r-- | include/opcode/bpf.h | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 8cad8e2..11c1c09 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,12 @@ 2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com> + * opcode/bpf.h (BPF_IMM32_BSWAP16): Define. + (BPF_IMM32_BSWAP32): Likewise. + (BPF_IMM32_BSWAP64): Likewise. + (enum bpf_insn_id): New entries BPF_INSN_BSWAP{16,32,64}. + +2023-07-24 Jose E. Marchesi <jose.marchesi@oracle.com> + * opcode/bpf.h (enum bpf_insn_id): Add entry BPF_INSN_JAL. (enum bpf_insn_id): Remove spurious entry BPF_INSN_CALLI. diff --git a/include/opcode/bpf.h b/include/opcode/bpf.h index dc1b6e7..ed34442 100644 --- a/include/opcode/bpf.h +++ b/include/opcode/bpf.h @@ -140,6 +140,10 @@ typedef uint64_t bpf_insn_word; #define BPF_IMM32_END32 ((uint64_t)0x00000020) #define BPF_IMM32_END64 ((uint64_t)0x00000040) +#define BPF_IMM32_BSWAP16 ((uint64_t)0x00000010) +#define BPF_IMM32_BSWAP32 ((uint64_t)0x00000020) +#define BPF_IMM32_BSWAP64 ((uint64_t)0x00000040) + #define BPF_IMM32_AADD ((uint64_t)0x00000000) #define BPF_IMM32_AOR ((uint64_t)0x00000040) #define BPF_IMM32_AAND ((uint64_t)0x00000050) @@ -178,6 +182,8 @@ enum bpf_insn_id BPF_INSN_RSH32R, BPF_INSN_RSH32I, BPF_INSN_ARSH32R, BPF_INSN_ARSH32I, BPF_INSN_MOVS328R, BPF_INSN_MOVS3216R, BPF_INSN_MOVS3232R, BPF_INSN_MOV32R, BPF_INSN_MOV32I, + /* Byte swap instructions. */ + BPF_INSN_BSWAP16, BPF_INSN_BSWAP32, BPF_INSN_BSWAP64, /* Endianness conversion instructions. */ BPF_INSN_ENDLE16, BPF_INSN_ENDLE32, BPF_INSN_ENDLE64, BPF_INSN_ENDBE16, BPF_INSN_ENDBE32, BPF_INSN_ENDBE64, |