objdump, as: add callx support for BPF CPU v1

Albeit not being a currently valid BPF instruction, callx is generated
by both clang and GCC when BPF programs are compiled unoptimized.
Until now, GCC would emit it only whe using the experimental
compiler-testing cpu version xbpf, whereas clang would emit it from
v1.  This patch makes GAS to accept callx also starting with cpu v1.

opcodes/ChangeLog

	* bpf-opc.c: Move callx into the v1 BPF CPU variant.

gas/ChangeLog

	* testsuite/gas/bpf/indcall-1-pseudoc.d: Do not select xbpf cpu
	version.
	* testsuite/gas/bpf/indcall-1.d: Likewise.
This commit is contained in:
Will Hawkins 2024-02-15 15:11:44 +01:00 committed by Jose E. Marchesi
parent 664239bcaa
commit 7921285b6c
5 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2024-02-15 Will Hawkins <hawkinsw@obs.cr>
* testsuite/gas/bpf/indcall-1-pseudoc.d: Do not select xbpf cpu
version.
* testsuite/gas/bpf/indcall-1.d: Likewise.
2024-02-14 Yuriy Kolerov <ykolerov@synopsys.com>
* config/tc-arc.c (is_br_jmp_insn_p): Add check against "DBNZ".

View File

@ -1,5 +1,5 @@
#as: -EL -mdialect=pseudoc -misa-spec=xbpf
#objdump: -M xbpf,pseudoc,dec -dr
#as: -EL -mdialect=pseudoc
#objdump: -M pseudoc,dec -dr
#source: indcall-1-pseudoc.s
#name: BPF indirect call 1, pseudoc syntax

View File

@ -1,5 +1,5 @@
#as: -EL -misa-spec=xbpf
#objdump: -dr -M xbpf,dec
#as: -EL
#objdump: -dr -M dec
#source: indcall-1.s
#name: BPF indirect call 1, normal syntax

View File

@ -1,3 +1,7 @@
2024-02-15 Will Hawkins <hawkinsw@obs.cr>
* bpf-opc.c: Move callx into the v1 BPF CPU variant.
2024-02-14 Yuriy Kolerov <ykolerov@synopsys.com>
* arc-tbl.h (dbnz): Use "DBNZ" class.

View File

@ -273,7 +273,7 @@ const struct bpf_opcode bpf_opcodes[] =
{BPF_INSN_JNER, "jne%W%dr , %sr , %d16", "if%w%dr != %sr%wgoto%w%d16",
BPF_V1, BPF_CODE, BPF_CLASS_JMP|BPF_CODE_JNE|BPF_SRC_X},
{BPF_INSN_CALLR, "call%W%dr", "callx%w%dr",
BPF_XBPF, BPF_CODE, BPF_CLASS_JMP|BPF_CODE_CALL|BPF_SRC_X},
BPF_V1, BPF_CODE, BPF_CLASS_JMP|BPF_CODE_CALL|BPF_SRC_X},
{BPF_INSN_CALL, "call%W%d32", "call%w%d32",
BPF_V1, BPF_CODE, BPF_CLASS_JMP|BPF_CODE_CALL|BPF_SRC_K},
{BPF_INSN_EXIT, "exit", "exit",