Maxim Kuvyrkov <ma...@codesourcery.com> writes:
> I thought I'll butt in since I did a very similar thing for
> sync_memmodel a couple of months ago.

Thanks.

> +  /* We take care in instruction definitions to make sure accum_in operand is
> +     a register_operand or [a more restrictive] muldiv_target_operand.  */
> +  gcc_assert (REG_P (accum_in_op));

register_operand can accept subregs too.  I think it'd be better to
leave this bit out.

> diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
> index 759958b..79c1f25 100644
> --- a/gcc/config/mips/mips.md
> +++ b/gcc/config/mips/mips.md
> @@ -275,6 +275,10 @@
>  (define_attr "sync_memmodel" "" (const_int 10))
>  
>  
> +;; Accumulator operand for madd patterns.
> +(define_attr "accum_in" "none,0,1,2,3,4,5" (const_string "none"))
> +
> +

Nit: just one blank line between attributes.

> @@ -1715,6 +1724,7 @@
>    "ISA_HAS_MACC && reload_completed"
>    "macc\t%3,%1,%2"
>    [(set_attr "type"  "imadd")
> +   (set_attr "accum_in"      "3")
>     (set_attr "mode"  "SI")])
>  
>  (define_insn "*msac2"
> @@ -1729,6 +1739,7 @@
>    "ISA_HAS_MSAC && reload_completed"
>    "msac\t%3,%1,%2"
>    [(set_attr "type"  "imadd")
> +   (set_attr "accum_in"      "3")
>     (set_attr "mode"  "SI")])
>  
>  ;; Convert macc $0,<r1>,<r2> & mflo <r3> into macc <r3>,<r1>,<r2>

These two should be "0" instead.

OK with those changes, thanks.

Richard

Reply via email to