aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/bpf
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2023-07-26 12:07:30 +0200
committerJose E. Marchesi <jose.marchesi@oracle.com>2023-07-26 12:09:41 +0200
commit590a8287bf2e7c6b179cfa9a39b4b9a7ae5624a5 (patch)
treea193a5576617952ed4f16a51f9ad039b3944af7f /gcc/config/bpf
parent819f3d3692cbfe69ed7861da6ef47805914bb0b8 (diff)
downloadgcc-590a8287bf2e7c6b179cfa9a39b4b9a7ae5624a5.zip
gcc-590a8287bf2e7c6b179cfa9a39b4b9a7ae5624a5.tar.gz
gcc-590a8287bf2e7c6b179cfa9a39b4b9a7ae5624a5.tar.bz2
bpf: fix generation of neg and neg32 BPF instructions
This patch fixes GCC to generate correct neg and neg32 instructions, which do not take a source register operand. A couple of new tests are added. Tested in bpf-unknown-none. gcc/ChangeLog 2023-07-26 Jose E. Marchesi <jose.marchesi@oracle.com> * config/bpf/bpf.md: Fix neg{SI,DI}2 insn. gcc/testsuite/ChangeLog 2023-07-26 Jose E. Marchesi <jose.marchesi@oracle.com> * gcc.target/bpf/neg-1.c: New test. * gcc.target/bpf/neg-pseudoc-1.c: Likewise.
Diffstat (limited to 'gcc/config/bpf')
-rw-r--r--gcc/config/bpf/bpf.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/bpf/bpf.md b/gcc/config/bpf/bpf.md
index 579a821..1b5e190 100644
--- a/gcc/config/bpf/bpf.md
+++ b/gcc/config/bpf/bpf.md
@@ -142,9 +142,9 @@
;;; Negation
(define_insn "neg<AM:mode>2"
[(set (match_operand:AM 0 "register_operand" "=r,r")
- (neg:AM (match_operand:AM 1 "reg_or_imm_operand" " r,I")))]
+ (neg:AM (match_operand:AM 1 "reg_or_imm_operand" " 0,I")))]
""
- "{neg<msuffix>\t%0,%1|%w0 = -%w1}"
+ "{neg<msuffix>\t%0|%w0 = -%w1}"
[(set_attr "type" "<mtype>")])
;;; Multiplication