diff options
author | David Faust <david.faust@oracle.com> | 2023-08-21 09:36:36 -0700 |
---|---|---|
committer | David Faust <david.faust@oracle.com> | 2023-08-21 10:07:25 -0700 |
commit | 3f3175554f28ee42652aa5729a77cd1f2747be98 (patch) | |
tree | fd0394af434753b701f522c0e4907edf5733f92c /sim | |
parent | 41aa80c5440ff24fc931fa2a3e681213dc1dbdec (diff) | |
download | gdb-3f3175554f28ee42652aa5729a77cd1f2747be98.zip gdb-3f3175554f28ee42652aa5729a77cd1f2747be98.tar.gz gdb-3f3175554f28ee42652aa5729a77cd1f2747be98.tar.bz2 |
sim: bpf: remove negi, neg32i insns
The BPF virtual machine does not support neg instructions operating on
immediates, and these erroneous instructions were recently removed from
gas. Remove them from the simulator as well.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/bpf/bpf-sim.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/sim/bpf/bpf-sim.c b/sim/bpf/bpf-sim.c index 5e01dde..a4af22b 100644 --- a/sim/bpf/bpf-sim.c +++ b/sim/bpf/bpf-sim.c @@ -730,10 +730,6 @@ execute (SIM_CPU *cpu, struct bpf_insn *insn) BPF_TRACE ("BPF_INSN_NEGR\n"); bpf_regs[insn->dst] = - (int64_t) bpf_regs[insn->dst]; break; - case BPF_INSN_NEGI: - BPF_TRACE ("BPF_INSN_NEGI\n"); - bpf_regs[insn->dst] = - (int64_t) insn->imm32; - break; case BPF_INSN_LSHR: BPF_TRACE ("BPF_INSN_LSHR\n"); bpf_regs[insn->dst] <<= bpf_regs[insn->src]; @@ -867,10 +863,6 @@ execute (SIM_CPU *cpu, struct bpf_insn *insn) BPF_TRACE ("BPF_INSN_NEG32R\n"); bpf_regs[insn->dst] = (uint32_t) (- (int32_t) bpf_regs[insn->dst]); break; - case BPF_INSN_NEG32I: - BPF_TRACE ("BPF_INSN_NEG32I\n"); - bpf_regs[insn->dst] = (uint32_t) - (int32_t) insn->imm32; - break; case BPF_INSN_LSH32R: BPF_TRACE ("BPF_INSN_LSH32R\n"); bpf_regs[insn->dst] = (uint32_t) bpf_regs[insn->dst] << bpf_regs[insn->src]; |