cpu,opcodes: add instruction semantics to bpf.cpu and minor fixes
authorJose E. Marchesi <jose.marchesi@oracle.com>
Thu, 28 May 2020 14:53:54 +0000 (16:53 +0200)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Thu, 28 May 2020 19:52:31 +0000 (21:52 +0200)
commit78c1c35437a013c63acbff6926ff8d254e283d69
tree96a630975112891435c7b7dc926c75d1204ccbc0
parent989ade05525047fc6b94f24ece5fc09e076027b0
cpu,opcodes: add instruction semantics to bpf.cpu and minor fixes

This patch adds semantic RTL descriptions to the eBPF instructions
defined in cpu/bpf.cpu.  It also contains a couple of minor
improvements.

Tested in bpf-unknown-none targets.
No regressions.

cpu/ChangeLog:

2020-05-28  Jose E. Marchesi  <jose.marchesi@oracle.com>
    David Faust <david.faust@oracle.com>

* bpf.cpu (define-alu-insn-un): Add definitions of semantics.
(define-alu-insn-mov): Likewise.
(daib): Likewise.
(define-alu-instructions): Likewise.
(define-endian-insn): Likewise.
(define-lddw): Likewise.
(dlabs): Likewise.
(dlind): Likewise.
(dxli): Likewise.
(dxsi): Likewise.
(dsti): Likewise.
(define-ldstx-insns): Likewise.
(define-st-insns): Likewise.
(define-cond-jump-insn): Likewise.
(dcji): Likewise.
(define-condjump-insns): Likewise.
(define-call-insn): Likewise.
(ja): Likewise.
("exit"): Likewise.
(define-atomic-insns): Likewise.
(sem-exchange-and-add): New macro.
* bpf.cpu ("brkpt"): New instruction.
(bpfbf): Set word-bitsize to 32 and insn-endian big.
(h-gpr): Prefer r0 to `a' and r6 to `ctx'.
(h-pc): Expand definition.
* bpf.opc (bpf_print_insn): Set endian_code to BIG.

opcodes/ChangeLog:

2020-05-28  Jose E. Marchesi  <jose.marchesi@oracle.com>
    David Faust <david.faust@oracle.com>

* bpf-desc.c: Regenerate.
* bpf-opc.h: Likewise.
* bpf-opc.c: Likewise.
* bpf-dis.c: Likewise.
cpu/ChangeLog
cpu/bpf.cpu
cpu/bpf.opc
opcodes/ChangeLog
opcodes/bpf-desc.c
opcodes/bpf-dis.c
opcodes/bpf-opc.c
opcodes/bpf-opc.h