From bd434cc4d94ec3d2f9fc1e7c00c27b074f962bc1 Mon Sep 17 00:00:00 2001 From: "Jose E. Marchesi" Date: Thu, 30 Jan 2020 13:59:04 +0100 Subject: cpu,opcodes,gas: fix neg and neg32 instructions in BPF This patch fixes the neg/neg32 BPF instructions, which have K (=0) instead of X (=1) in their header source bit, despite operating on registes. cpu/ChangeLog: 2020-01-30 Jose E. Marchesi * bpf.cpu (define-alu-insn-un): The unary BPF instructions (neg and neg32) use OP_SRC_K even if they operate only in registers. opcodes/ChangeLog: 2020-01-30 Jose E. Marchesi * bpf-opc.c: Regenerate. gas/ChangeLog: 2020-01-30 Jose E. Marchesi * testsuite/gas/bpf/alu.d: Update expected opcode for `neg'. * testsuite/gas/bpf/alu-be.d: Likewise. * testsuite/gas/bpf/alu32.d: Likewise for `neg32'. * testsuite/gas/bpf/alu32-be.d: Likewise. --- opcodes/ChangeLog | 4 ++++ opcodes/bpf-opc.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 19c2772..13333aa 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2020-01-30 Jose E. Marchesi + + * bpf-opc.c: Regenerate. + 2020-01-30 Jan Beulich * i386-dis.c (X86_64_C2, X86_64_C3): New enumerators. diff --git a/opcodes/bpf-opc.c b/opcodes/bpf-opc.c index c728558..d03e8d2 100644 --- a/opcodes/bpf-opc.c +++ b/opcodes/bpf-opc.c @@ -452,13 +452,13 @@ static const CGEN_OPCODE bpf_cgen_insn_opcode_table[MAX_INSNS] = { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (DSTLE), 0 } }, - & ifmt_negle, { 0x8f } + & ifmt_negle, { 0x87 } }, /* neg32 $dstle */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (DSTLE), 0 } }, - & ifmt_negle, { 0x8c } + & ifmt_negle, { 0x84 } }, /* add $dstbe,$imm32 */ { @@ -752,13 +752,13 @@ static const CGEN_OPCODE bpf_cgen_insn_opcode_table[MAX_INSNS] = { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (DSTBE), 0 } }, - & ifmt_negbe, { 0x8f } + & ifmt_negbe, { 0x87 } }, /* neg32 $dstbe */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (DSTBE), 0 } }, - & ifmt_negbe, { 0x8c } + & ifmt_negbe, { 0x84 } }, /* endle $dstle,$endsize */ { -- cgit v1.1