[PATCH 1/4] [MIPS] Add support for MIPS SIMD Architecture (MSA)

Robert Suchanek Robert.Suchanek@imgtec.com
Tue Jan 5 16:15:00 GMT 2016


Hi,

Comments inlined.

> >diff --git a/gcc/config/mips/constraints.md b/gcc/config/mips/constraints.md
> >index 7d1a8ba..cde0196 100644
> >--- a/gcc/config/mips/constraints.md
> >+++ b/gcc/config/mips/constraints.md
> >@@ -308,6 +308,53 @@ (define_constraint "Yx"
> >    "@internal"
> >    (match_operand 0 "low_bitmask_operand"))
> >
> >+(define_constraint "YI"
> >+  "@internal
> >+   A replicated vector const in which the replicated is a 10-bit signed
> value."
> 
> replicated value is in the range [-512,511].

Done.
> 
> >+(define_constraint "Unv5"
> >+  "@internal
> >+   A replicated vector const in which the replicated value is a negative
> >+   integer number in range [-31,0]."
> 
> Stick with similar phrasing throughout: replicated value is in the range...
> 
> >+  (and (match_code "const_vector")
> >+       (match_test "mips_const_vector_same_int_p (op, mode, -31, 0)")))
> >+
> >+(define_constraint "Uuv5"
> >+  "@internal
> >+   A replicated vector const in which the replicated value is a positive
> >+   integer number in range [0,31]."
> >+  (and (match_code "const_vector")
> >+       (match_test "mips_const_vector_same_int_p (op, mode, 0, 31)")))
> 
> likewise.
> 
> >+(define_constraint "Uuv6"
> >+  "@internal
> >+   A replicated vector const in which the replicated value is an unsigned
> >+   6-bit integer number."
> >+  (and (match_code "const_vector")
> >+       (match_test "mips_const_vector_same_int_p (op, mode, 0, 63)")))
> 
> likewise.

Done.
> 
> >+(define_constraint "Ubv8"
> >+  "@internal
> >+   A replicated vector const in which the replicated value is an 8-bit byte."
> 
> A replicated vector const.
> 
> (see below)...
> 
> >+  (and (match_code "const_vector")
> >+       (match_test "mips_const_vector_same_byte_p (op, mode)")))
> 
> This is no different from mips_const_vector_same_val_p excep for a mode
> assertion. This constraint may as well just verify that all elements are the
> same value and I think we can reasonably expect that you can't construct
> a V16QI vec_const with values outside of an 8-bit range. Perhaps call it
> Uxvx to indicate it is just checking mode width. Obviously this cannot be
> used in a context where an immediate is implicitly sign extended but that
> is what the other constraints are for.
> You can then delete mips_const_vector_same_byte_p.

I was going to follow this change as suggested but changed the constraint
name to "Urv8" and used mips_const_vector_same_bytes_p.  The constraint
represents a replicated byte values regardless of the mode.  This change
followed comments for mips-msa.md.

> 
> >diff --git a/gcc/config/mips/mips-ftypes.def b/gcc/config/mips/mips-ftypes.def
> >index d56accc..29ef33c 100644
> >--- a/gcc/config/mips/mips-ftypes.def
> >+++ b/gcc/config/mips/mips-ftypes.def
> >@@ -36,6 +36,226 @@ along with GCC; see the file COPYING3.  If not see
> > DEF_MIPS_FTYPE (1, (DF, DF))
> > DEF_MIPS_FTYPE (2, (DF, DF, DF))
> >
> >+DEF_MIPS_FTYPE (2, (V16QI, V16QI, V16QI))
> 
> ...
> 
> Please sort these as the file requests towards the top. I have not checked
> these are all needed but am assuming they are.

Done. I found some unused types. I will send another patch as some of the entries
were not sorted before MSA.

> 
> Thanks,
> Matthew

Regards,
Robert



More information about the Gcc-patches mailing list