]> git.ipfire.org Git - thirdparty/gcc.git/commit
bpf: neg instruction does not accept an immediate
authorDavid Faust <david.faust@oracle.com>
Mon, 21 Aug 2023 20:34:08 +0000 (13:34 -0700)
committerDavid Faust <david.faust@oracle.com>
Mon, 21 Aug 2023 22:10:28 +0000 (15:10 -0700)
commite2c42860b6bad30bad8dd12fd0e25dc55646a69c
tree4a62b47bf34a7e00d5dd2667d9bbd9e214cfaea3
parent36788c9ff6d044210ddee23154306ba54bc3087b
bpf: neg instruction does not accept an immediate

The BPF virtual machine does not support neg nor neg32 instructions with
an immediate.

The erroneous instructions were removed from binutils:
https://sourceware.org/pipermail/binutils/2023-August/129135.html

Change the define_insn so that an immediate cannot be accepted.

From testing, a neg-immediate was probably never chosen over a
mov-immediate anyway.

gcc/

* config/bpf/bpf.md (neg): Second operand must be a register.
gcc/config/bpf/bpf.md