This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions
- From: Richard Henderson <rth at redhat dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Tue, 19 Aug 2014 08:25:27 -0700
- Subject: Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions
- Authentication-results: sourceware.org; auth=none
- References: <53F1F068 dot 4070708 at arm dot com> <53F24B7D dot 1010200 at redhat dot com> <53F35128 dot 9010801 at arm dot com>
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~