Re: [PATCH] bpf: fixed template for neg (added second operand)

2023-07-21 Thread David Faust via Gcc-patches
Hi Cupertino,

On 7/21/23 09:43, Cupertino Miranda wrote:
> gcc/ChangeLog:
> 
>   * config/bpf/bpf.md: fixed template for neg instruction.
> ---
>  gcc/config/bpf/bpf.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/config/bpf/bpf.md b/gcc/config/bpf/bpf.md
> index 329f62f55c33..bb414d8a4428 100644
> --- a/gcc/config/bpf/bpf.md
> +++ b/gcc/config/bpf/bpf.md
> @@ -142,7 +142,7 @@
>[(set (match_operand:AM 0 "register_operand" "=r")
>  (neg:AM (match_operand:AM 1 "register_operand" " 0")))]
>""
> -  "neg\t%0"
> +  "neg\t%0,%1"
>[(set_attr "type" "")])

I think you will need to update the constraint for the second
operand as well; it could be any register, or a 32-bit immediate.

>  
>  ;;; Multiplication


[PATCH] bpf: fixed template for neg (added second operand)

2023-07-21 Thread Cupertino Miranda via Gcc-patches
gcc/ChangeLog:

* config/bpf/bpf.md: fixed template for neg instruction.
---
 gcc/config/bpf/bpf.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/bpf/bpf.md b/gcc/config/bpf/bpf.md
index 329f62f55c33..bb414d8a4428 100644
--- a/gcc/config/bpf/bpf.md
+++ b/gcc/config/bpf/bpf.md
@@ -142,7 +142,7 @@
   [(set (match_operand:AM 0 "register_operand" "=r")
 (neg:AM (match_operand:AM 1 "register_operand" " 0")))]
   ""
-  "neg\t%0"
+  "neg\t%0,%1"
   [(set_attr "type" "")])
 
 ;;; Multiplication
-- 
2.30.2