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 /gas/testsuite | |
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 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/bpf/alu-be-pseudoc.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/bpf/alu-be.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/bpf/alu-pseudoc.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/bpf/alu-pseudoc.s | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/bpf/alu.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/bpf/alu.s | 3 |
6 files changed, 18 insertions, 0 deletions
diff --git a/gas/testsuite/gas/bpf/alu-be-pseudoc.d b/gas/testsuite/gas/bpf/alu-be-pseudoc.d index 5eb7f39..1d83eac 100644 --- a/gas/testsuite/gas/bpf/alu-be-pseudoc.d +++ b/gas/testsuite/gas/bpf/alu-be-pseudoc.d @@ -66,3 +66,6 @@ Disassembly of section .text: 1b8: bf 12 00 08 00 00 00 00 r1 = \(s8\) r2 1c0: bf 12 00 10 00 00 00 00 r1 = \(s16\) r2 1c8: bf 12 00 20 00 00 00 00 r1 = \(s32\) r2 + 1d0: d7 10 00 00 00 00 00 10 r1 = bswap16 r1 + 1d8: d7 20 00 00 00 00 00 20 r2 = bswap32 r2 + 1e0: d7 30 00 00 00 00 00 40 r3 = bswap64 r3 diff --git a/gas/testsuite/gas/bpf/alu-be.d b/gas/testsuite/gas/bpf/alu-be.d index a082c46..2911d8b 100644 --- a/gas/testsuite/gas/bpf/alu-be.d +++ b/gas/testsuite/gas/bpf/alu-be.d @@ -66,3 +66,6 @@ Disassembly of section .text: 1b8: bf 12 00 08 00 00 00 00 movs %r1,%r2,8 1c0: bf 12 00 10 00 00 00 00 movs %r1,%r2,16 1c8: bf 12 00 20 00 00 00 00 movs %r1,%r2,32 + 1d0: d7 10 00 00 00 00 00 10 bswap %r1,16 + 1d8: d7 20 00 00 00 00 00 20 bswap %r2,32 + 1e0: d7 30 00 00 00 00 00 40 bswap %r3,64 diff --git a/gas/testsuite/gas/bpf/alu-pseudoc.d b/gas/testsuite/gas/bpf/alu-pseudoc.d index 586fc09..bfc2493 100644 --- a/gas/testsuite/gas/bpf/alu-pseudoc.d +++ b/gas/testsuite/gas/bpf/alu-pseudoc.d @@ -66,3 +66,6 @@ Disassembly of section .text: 1b8: bf 21 08 00 00 00 00 00 r1 = \(s8\) r2 1c0: bf 21 10 00 00 00 00 00 r1 = \(s16\) r2 1c8: bf 21 20 00 00 00 00 00 r1 = \(s32\) r2 + 1d0: d7 01 00 00 10 00 00 00 r1 = bswap16 r1 + 1d8: d7 02 00 00 20 00 00 00 r2 = bswap32 r2 + 1e0: d7 03 00 00 40 00 00 00 r3 = bswap64 r3 diff --git a/gas/testsuite/gas/bpf/alu-pseudoc.s b/gas/testsuite/gas/bpf/alu-pseudoc.s index 4a47ba6..172a93c 100644 --- a/gas/testsuite/gas/bpf/alu-pseudoc.s +++ b/gas/testsuite/gas/bpf/alu-pseudoc.s @@ -58,3 +58,6 @@ r1 = (s8) r2 r1 = (s16) r2 r1 = (s32) r2 + r1 = bswap16 r1 + r2 = bswap32 r2 + r3 = bswap64 r3 diff --git a/gas/testsuite/gas/bpf/alu.d b/gas/testsuite/gas/bpf/alu.d index 409018d..65f3280 100644 --- a/gas/testsuite/gas/bpf/alu.d +++ b/gas/testsuite/gas/bpf/alu.d @@ -66,3 +66,6 @@ Disassembly of section .text: 1b8: bf 21 08 00 00 00 00 00 movs %r1,%r2,8 1c0: bf 21 10 00 00 00 00 00 movs %r1,%r2,16 1c8: bf 21 20 00 00 00 00 00 movs %r1,%r2,32 + 1d0: d7 01 00 00 10 00 00 00 bswap %r1,16 + 1d8: d7 02 00 00 20 00 00 00 bswap %r2,32 + 1e0: d7 03 00 00 40 00 00 00 bswap %r3,64 diff --git a/gas/testsuite/gas/bpf/alu.s b/gas/testsuite/gas/bpf/alu.s index 6f8c30f..3e8a3cf 100644 --- a/gas/testsuite/gas/bpf/alu.s +++ b/gas/testsuite/gas/bpf/alu.s @@ -58,3 +58,6 @@ movs %r1,%r2,8 movs %r1,%r2,16 movs %r1,%r2,32 + bswap %r1, 16 + bswap %r2, 32 + bswap %r3, 64 |