diff options
author | Jose E. Marchesi <jose.marchesi@oracle.com> | 2019-07-15 16:00:28 +0200 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2019-07-15 16:00:28 +0200 |
commit | 3719fd55b6f89662653d50d33bb267c5f21127a5 (patch) | |
tree | 7c046c3a10249178af42ff1ab11ba51468b62d6c /opcodes | |
parent | 5b9d7a9a647260ba754fbd2a176d37806f15acc8 (diff) | |
download | gdb-3719fd55b6f89662653d50d33bb267c5f21127a5.zip gdb-3719fd55b6f89662653d50d33bb267c5f21127a5.tar.gz gdb-3719fd55b6f89662653d50d33bb267c5f21127a5.tar.bz2 |
cpu,opcodes,gas: fix explicit arguments to eBPF ldabs instructions
This patch fixes the eBPF CPU description in order to reflect the
right explicit arguments passed to the ldabs{b,h,w,dw} instructions,
updates the corresponding GAS tests, and updates the BPF section of
the GAS manual.
cpu/ChangeLog:
2019-07-15 Jose E. Marchesi <jose.marchesi@oracle.com>
* bpf.cpu (dlabs): New pmacro.
(dlind): Likewise.
opcodes/ChangeLog:
2019-07-15 Jose E. Marchesi <jose.marchesi@oracle.com>
* bpf-desc.c: Regenerate.
* bpf-opc.c: Likewise.
* bpf-opc.h: Likewise.
gas/ChangeLog:
2019-07-15 Jose E. Marchesi <jose.marchesi@oracle.com>
* testsuite/gas/bpf/mem.s: ldabs instructions do not take a `src'
register as an argument.
* testsuite/gas/bpf/mem.d: Updated accordingly.
* testsuite/gas/bpf/mem-be.d: Likewise.
* doc/c-bpf.texi (BPF Opcodes): Update to reflect the correct
explicit arguments to ldabs and ldind instructions.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 6 | ||||
-rw-r--r-- | opcodes/bpf-desc.c | 44 | ||||
-rw-r--r-- | opcodes/bpf-opc.c | 72 | ||||
-rw-r--r-- | opcodes/bpf-opc.h | 7 |
4 files changed, 47 insertions, 82 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index e1de65b..c00cb8a 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2019-07-15 Jose E. Marchesi <jose.marchesi@oracle.com> + + * bpf-desc.c: Regenerate. + * bpf-opc.c: Likewise. + * bpf-opc.h: Likewise. + 2019-07-14 Jose E. Marchesi <jose.marchesi@oracle.com> * bpf-desc.c: Regenerate. diff --git a/opcodes/bpf-desc.c b/opcodes/bpf-desc.c index 3b94335..18ded6e 100644 --- a/opcodes/bpf-desc.c +++ b/opcodes/bpf-desc.c @@ -824,25 +824,25 @@ static const CGEN_IBASE bpf_cgen_insn_table[MAX_INSNS] = BPF_INSN_LDDWBE, "lddwbe", "lddw", 128, { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x40" } } } } }, -/* ldabsw $srcle,$imm32 */ +/* ldabsw $imm32 */ { - BPF_INSN_LDABSWLE, "ldabswle", "ldabsw", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x80" } } } } + BPF_INSN_LDABSW, "ldabsw", "ldabsw", 64, + { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } } } } }, -/* ldabsh $srcle,$imm32 */ +/* ldabsh $imm32 */ { - BPF_INSN_LDABSHLE, "ldabshle", "ldabsh", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x80" } } } } + BPF_INSN_LDABSH, "ldabsh", "ldabsh", 64, + { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } } } } }, -/* ldabsb $srcle,$imm32 */ +/* ldabsb $imm32 */ { - BPF_INSN_LDABSBLE, "ldabsble", "ldabsb", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x80" } } } } + BPF_INSN_LDABSB, "ldabsb", "ldabsb", 64, + { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } } } } }, -/* ldabsdw $srcle,$imm32 */ +/* ldabsdw $imm32 */ { - BPF_INSN_LDABSDWLE, "ldabsdwle", "ldabsdw", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x80" } } } } + BPF_INSN_LDABSDW, "ldabsdw", "ldabsdw", 64, + { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } } } } }, /* ldindw $srcle,$imm32 */ { @@ -864,26 +864,6 @@ static const CGEN_IBASE bpf_cgen_insn_table[MAX_INSNS] = BPF_INSN_LDINDDWLE, "ldinddwle", "ldinddw", 64, { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x80" } } } } }, -/* ldabsw $srcbe,$imm32 */ - { - BPF_INSN_LDABSWBE, "ldabswbe", "ldabsw", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x40" } } } } - }, -/* ldabsh $srcbe,$imm32 */ - { - BPF_INSN_LDABSHBE, "ldabshbe", "ldabsh", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x40" } } } } - }, -/* ldabsb $srcbe,$imm32 */ - { - BPF_INSN_LDABSBBE, "ldabsbbe", "ldabsb", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x40" } } } } - }, -/* ldabsdw $srcbe,$imm32 */ - { - BPF_INSN_LDABSDWBE, "ldabsdwbe", "ldabsdw", 64, - { 0, { { { (1<<MACH_BASE), 0 } }, { { 1, "\x40" } } } } - }, /* ldindw $srcbe,$imm32 */ { BPF_INSN_LDINDWBE, "ldindwbe", "ldindw", 64, diff --git a/opcodes/bpf-opc.c b/opcodes/bpf-opc.c index 4a36cb9..7707aaa 100644 --- a/opcodes/bpf-opc.c +++ b/opcodes/bpf-opc.c @@ -89,11 +89,15 @@ static const CGEN_IFMT ifmt_lddwbe ATTRIBUTE_UNUSED = { 8, 128, 0xff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } }; -static const CGEN_IFMT ifmt_ldabswle ATTRIBUTE_UNUSED = { +static const CGEN_IFMT ifmt_ldabsw ATTRIBUTE_UNUSED = { + 8, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_OP_CLASS) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_ldindwle ATTRIBUTE_UNUSED = { 8, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } }; -static const CGEN_IFMT ifmt_ldabswbe ATTRIBUTE_UNUSED = { +static const CGEN_IFMT ifmt_ldindwbe ATTRIBUTE_UNUSED = { 8, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } }; @@ -792,101 +796,77 @@ static const CGEN_OPCODE bpf_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (DSTBE), ',', OP (IMM64), 0 } }, & ifmt_lddwbe, { 0x18 } }, -/* ldabsw $srcle,$imm32 */ +/* ldabsw $imm32 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x20 } + { { MNEM, ' ', OP (IMM32), 0 } }, + & ifmt_ldabsw, { 0x20 } }, -/* ldabsh $srcle,$imm32 */ +/* ldabsh $imm32 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x28 } + { { MNEM, ' ', OP (IMM32), 0 } }, + & ifmt_ldabsw, { 0x28 } }, -/* ldabsb $srcle,$imm32 */ +/* ldabsb $imm32 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x30 } + { { MNEM, ' ', OP (IMM32), 0 } }, + & ifmt_ldabsw, { 0x30 } }, -/* ldabsdw $srcle,$imm32 */ +/* ldabsdw $imm32 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x38 } + { { MNEM, ' ', OP (IMM32), 0 } }, + & ifmt_ldabsw, { 0x38 } }, /* ldindw $srcle,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x40 } + & ifmt_ldindwle, { 0x40 } }, /* ldindh $srcle,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x48 } + & ifmt_ldindwle, { 0x48 } }, /* ldindb $srcle,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x50 } + & ifmt_ldindwle, { 0x50 } }, /* ldinddw $srcle,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCLE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswle, { 0x58 } - }, -/* ldabsw $srcbe,$imm32 */ - { - { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x20 } - }, -/* ldabsh $srcbe,$imm32 */ - { - { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x28 } - }, -/* ldabsb $srcbe,$imm32 */ - { - { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x30 } - }, -/* ldabsdw $srcbe,$imm32 */ - { - { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x38 } + & ifmt_ldindwle, { 0x58 } }, /* ldindw $srcbe,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x40 } + & ifmt_ldindwbe, { 0x40 } }, /* ldindh $srcbe,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x48 } + & ifmt_ldindwbe, { 0x48 } }, /* ldindb $srcbe,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x50 } + & ifmt_ldindwbe, { 0x50 } }, /* ldinddw $srcbe,$imm32 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRCBE), ',', OP (IMM32), 0 } }, - & ifmt_ldabswbe, { 0x58 } + & ifmt_ldindwbe, { 0x58 } }, /* ldxw $dstle,[$srcle+$offset16] */ { diff --git a/opcodes/bpf-opc.h b/opcodes/bpf-opc.h index b989d7f..a2cdc7c 100644 --- a/opcodes/bpf-opc.h +++ b/opcodes/bpf-opc.h @@ -74,10 +74,9 @@ typedef enum cgen_insn_type { , BPF_INSN_MOVRBE, BPF_INSN_MOV32IBE, BPF_INSN_MOV32RBE, BPF_INSN_ARSHIBE , BPF_INSN_ARSHRBE, BPF_INSN_ARSH32IBE, BPF_INSN_ARSH32RBE, BPF_INSN_NEGBE , BPF_INSN_NEG32BE, BPF_INSN_ENDLELE, BPF_INSN_ENDBELE, BPF_INSN_ENDLEBE - , BPF_INSN_ENDBEBE, BPF_INSN_LDDWLE, BPF_INSN_LDDWBE, BPF_INSN_LDABSWLE - , BPF_INSN_LDABSHLE, BPF_INSN_LDABSBLE, BPF_INSN_LDABSDWLE, BPF_INSN_LDINDWLE - , BPF_INSN_LDINDHLE, BPF_INSN_LDINDBLE, BPF_INSN_LDINDDWLE, BPF_INSN_LDABSWBE - , BPF_INSN_LDABSHBE, BPF_INSN_LDABSBBE, BPF_INSN_LDABSDWBE, BPF_INSN_LDINDWBE + , BPF_INSN_ENDBEBE, BPF_INSN_LDDWLE, BPF_INSN_LDDWBE, BPF_INSN_LDABSW + , BPF_INSN_LDABSH, BPF_INSN_LDABSB, BPF_INSN_LDABSDW, BPF_INSN_LDINDWLE + , BPF_INSN_LDINDHLE, BPF_INSN_LDINDBLE, BPF_INSN_LDINDDWLE, BPF_INSN_LDINDWBE , BPF_INSN_LDINDHBE, BPF_INSN_LDINDBBE, BPF_INSN_LDINDDWBE, BPF_INSN_LDXWLE , BPF_INSN_LDXHLE, BPF_INSN_LDXBLE, BPF_INSN_LDXDWLE, BPF_INSN_STXWLE , BPF_INSN_STXHLE, BPF_INSN_STXBLE, BPF_INSN_STXDWLE, BPF_INSN_LDXWBE |