This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Ping] [PATCH, 5/10] aarch64: add ccmp operand predicate


On 09/22/2014 11:44 PM, Zhenqiang Chen wrote:
> +/* Return true if val can be encoded as a 5-bit unsigned immediate.  */
> +bool
> +aarch64_uimm5 (HOST_WIDE_INT val)
> +{
> +  return (val & (HOST_WIDE_INT) 0x1f) == val;
> +}

This is just silly.

> +(define_constraint "Usn"
> + "A constant that can be used with a CCMN operation (once negated)."
> + (and (match_code "const_int")
> +      (match_test "aarch64_uimm5 (-ival)")))

(match_test "IN_RANGE (ival, -31, 0)")

> +(define_predicate "aarch64_ccmp_immediate"
> +  (and (match_code "const_int")
> +       (ior (match_test "aarch64_uimm5 (INTVAL (op))")
> +	    (match_test "aarch64_uimm5 (-INTVAL (op))"))))

(and (match_code "const_int")
     (match_test "IN_RANGE (INTVAL (op), -31, 31)"))


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]