]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
bpf: fixed template for neg (added second operand)
authorCupertino Miranda <cupertino.miranda@oracle.com>
Fri, 21 Jul 2023 16:40:07 +0000 (17:40 +0100)
committerCupertino Miranda <cupertino.miranda@oracle.com>
Fri, 21 Jul 2023 18:14:33 +0000 (19:14 +0100)
This patch fixes define_insn for "neg" to support 2 operands.
Initial implementation assumed the format "neg %0" while the instruction
allows both a destination and source operands. The second operand can
either be a register or an immediate value.

gcc/ChangeLog:

* config/bpf/bpf.md: fixed template for neg instruction.

gcc/config/bpf/bpf.md

index 329f62f55c336f50f2c2faa53d2c229fda369b0a..adf11e151df12cdabb6f2b5429d530a656c3c9bf 100644 (file)
 
 ;;; Negation
 (define_insn "neg<AM:mode>2"
-  [(set (match_operand:AM 0 "register_operand" "=r")
-        (neg:AM (match_operand:AM 1 "register_operand" " 0")))]
+  [(set (match_operand:AM         0 "register_operand" "=r,r")
+        (neg:AM (match_operand:AM 1 "register_operand" " r,I")))]
   ""
-  "neg<msuffix>\t%0"
+  "neg<msuffix>\t%0,%1"
   [(set_attr "type" "<mtype>")])
 
 ;;; Multiplication