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: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions


On 08/19/2014 06:29 AM, Kyrill Tkachov wrote:
> +(define_special_predicate "cc_register_zero"
> +  (and (match_code "reg")
> +       (and (match_test "REGNO (op) == CC_REGNUM")
> +	    (ior (match_test "mode == GET_MODE (op)")
> +		 (ior (match_test "mode == VOIDmode
> +		                   && GET_MODE_CLASS (GET_MODE (op)) == MODE_CC")
> +		      (match_test "mode == CCmode || mode == CC_Zmode
> +		                   || mode == CC_NZmode")))))
> +)

Well, you're being too liberal with the modes you're accepting, since 'mode'
will always be VOIDmode.

And personally I find those match_tests quite ugly.  Better as:

(define_special_predicate "cc_register_zero"
  (match_code "reg")
{
  return (REGNO (op) == CC_REGNUM
          && (GET_MODE (op) == CCmode
              || GET_MODE (op) == CC_Zmode
              || GET_MODE (op) == CC_NZmode));
})


r~


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