From 6e25f88828f500fc649aa6eac8b567c7b1e96c59 Mon Sep 17 00:00:00 2001 From: David Faust Date: Fri, 18 Sep 2020 09:56:43 -0700 Subject: bpf: xBPF SDIV, SMOD instructions Add gas and opcodes support for two xBPF-exclusive ALU operations: SDIV (signed division) and SMOD (signed modulo), and add tests for them in gas. cpu/ * bpf.cpu (insn-op-code-alu): Add SDIV and SMOD. (define-alu-insn-bin, daib): Take ISAs as an argument. (define-alu-instructions): Update calls to daib pmacro with ISAs; add sdiv and smod. gas/ * testsuite/gas/bpf/alu-xbpf.d: New file. * testsuite/gas/bpf/alu-xbpf.s: Likewise. * testsuite/gas/bpf/alu32-xbpf.d: Likewise. * testsuite/gas/bpf/alu32-xbpf.d: Likewise. * testuiste/gas/bpf/bpf.exp: Run new tests. opcodes/ * bpf-desc.c: Regenerate. * bpf-desc.h: Likewise. * bpf-opc.c: Likewise. * bpf-opc.h: Likewise. --- opcodes/ChangeLog | 7 ++++ opcodes/bpf-desc.c | 80 +++++++++++++++++++++++++++++++++++++++++++++ opcodes/bpf-desc.h | 9 ++--- opcodes/bpf-opc.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ opcodes/bpf-opc.h | 8 +++-- 5 files changed, 194 insertions(+), 6 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 6243511..0f3c270 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2020-09-18 David Faust + + * bpf-desc.c: Regenerate. + * bpf-desc.h: Likewise. + * bpf-opc.c: Likewise. + * bpf-opc.h: Likewise. + 2020-09-16 Andrew Burgess * csky-dis.c (csky_get_disassembler): Don't return NULL when there diff --git a/opcodes/bpf-desc.c b/opcodes/bpf-desc.c index 6914ce9..adcff34 100644 --- a/opcodes/bpf-desc.c +++ b/opcodes/bpf-desc.c @@ -520,6 +520,46 @@ static const CGEN_IBASE bpf_cgen_insn_table[MAX_INSNS] = BPF_INSN_ARSH32RLE, "arsh32rle", "arsh32", 64, { 0, { { { (1<