bpf: simulator: correct div, mod insn semantics
authorDavid Faust <david.faust@oracle.com>
Tue, 8 Sep 2020 18:39:07 +0000 (11:39 -0700)
committerDavid Faust <david.faust@oracle.com>
Tue, 8 Sep 2020 18:39:07 +0000 (11:39 -0700)
commit3ad6c19423eedf84dfd5ea83bc03933dff8a4579
treee76e0f17f4d59deba3bd65dabb1b19f1a0eba84c
parent790147a9e9ee05542c621a36669288413880c876
bpf: simulator: correct div, mod insn semantics

The div and mod eBPF instructions are unsigned, but the semantic
specification for the simulator incorrectly used signed operators.
Correct them to unsigned versions, and correct the ALU tests in
the simulator (which incorrectly assumed signed semantics).

Tested in bpf-unknown-none.

cpu/ChangeLog:
2020-09-08  David Faust  <david.faust@oracle.com>

* bpf.cpu (define-alu-instructions): Correct semantic operators
for div, mod to unsigned versions.

sim/ChangeLog:
2020-09-08  David Faust  <david.faust@oracle.com>

* bpf/sem-be.c: Regenerate.
* bpf/sem-le.c: Likewise.

sim/testsuite/ChangeLog:
2020-09-08  David Faust  <david.faust@oracle.com>

* sim/bpf/alu.s: Correct div and mod tests.
* sim/bpf/alu32.s: Likewise.
cpu/ChangeLog
cpu/bpf.cpu
sim/ChangeLog
sim/bpf/sem-be.c
sim/bpf/sem-le.c
sim/testsuite/ChangeLog
sim/testsuite/sim/bpf/alu.s
sim/testsuite/sim/bpf/alu32.s