This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [AArch64 08/14] Define a variant of cmp for the CC_NZ case.
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Philipp Tomsich <philipp dot tomsich at theobroma-systems dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 18 Feb 2014 13:42:47 -0800
- Subject: Re: [AArch64 08/14] Define a variant of cmp for the CC_NZ case.
- Authentication-results: sourceware.org; auth=none
- References: <1392757787-25629-1-git-send-email-philipp dot tomsich at theobroma-systems dot com> <1392757787-25629-9-git-send-email-philipp dot tomsich at theobroma-systems dot com>
On Tue, Feb 18, 2014 at 1:09 PM, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> This pattern is not strictly necessary and a similar effect could
> be achieved through the use of a suitable compatibility relation
> for CC modes; in the meantime, this helps on some benchmarks.
Can you add a testcase or two for this patch? Having an example will
help people in the future understand why these patterns are added.
Thanks,
Andrew Pinski
> ---
> gcc/config/aarch64/aarch64.md | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
> index 13a75d3..60e42af 100644
> --- a/gcc/config/aarch64/aarch64.md
> +++ b/gcc/config/aarch64/aarch64.md
> @@ -2159,6 +2159,19 @@
> [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
> )
>
> +;; variant that generates a CC_NZ output mode
> +(define_insn "*cmp<mode>_nz"
> + [(set (reg:CC_NZ CC_REGNUM)
> + (compare:CC_NZ (match_operand:GPI 0 "register_operand" "r,r,r")
> + (match_operand:GPI 1 "aarch64_plus_operand" "r,I,J")))]
> + ""
> + "@
> + cmp\\t%<w>0, %<w>1
> + cmp\\t%<w>0, %<w>1
> + cmn\\t%<w>0, #%n1"
> + [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
> +)
> +
> (define_insn "*cmp<mode>"
> [(set (reg:CCFP CC_REGNUM)
> (compare:CCFP (match_operand:GPF 0 "register_operand" "w,w")
> --
> 1.9.0
>