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~

Reply via email to