public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ping] [PATCH, 8/10] aarch64: ccmp insn patterns
@ 2014-09-23  6:45 Zhenqiang Chen
  2014-10-11 20:45 ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Zhenqiang Chen @ 2014-09-23  6:45 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 3312 bytes --]

Ping?

Patch is attached for easy to apply.

Move the cstorecc4 pattern from "[PATCH, 10/10] aarch64: Handle ccmp in
ifcvt to make it work with cmov" to this patch, since cmov optimization does
not depend on that patch.

Thanks!
-Zhenqiang

ChangeLog:
2014-09-23  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

	* config/aarch64/aarch64.md (cbranchcc4, *ccmp_and, *ccmp_ior,
	cstorecc4): New.

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Zhenqiang Chen
> Sent: Monday, June 23, 2014 3:01 PM
> To: gcc-patches@gcc.gnu.org
> Subject: [PATCH, 8/10] aarch64: ccmp insn patterns
> 
> Hi,
> 
> The patch adds two insn patterns for ccmp instructions.
> 
> cbranchcc4 is introduced to generate optimized conditional branch without
> an additional compare against the result of ccmp.
> 
> OK for trunk?
> 
> Thanks!
> -Zhenqiang
> 
> ChangeLog:
> 2014-06-23  Zhenqiang Chen  <zhenqiang.chen@linaro.org>
> 
>         * config/aarch64/aarch64.md (cbranchcc4): New.
>         (*ccmp_and, *ccmp_ior): New.
> 
> diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
> index a4d8887..c25d940 100644
> --- a/gcc/config/aarch64/aarch64.md
> +++ b/gcc/config/aarch64/aarch64.md
> @@ -230,6 +230,52 @@
>    "
>  )
> +(define_expand "cbranchcc4"
> +  [(set (pc) (if_then_else
> +             (match_operator 0 "aarch64_comparison_operator"
> +              [(match_operand 1 "cc_register" "")
> +               (const_int 0)])
> +             (label_ref (match_operand 3 "" ""))
> +             (pc)))]
> +  ""
> +  " ")
> +
> +(define_insn "*ccmp_and"
> +  [(set (match_operand 6 "ccmp_cc_register" "")
> +       (compare
> +        (and:SI
> +         (match_operator 4 "aarch64_comparison_operator"
> +          [(match_operand 0 "ccmp_cc_register" "")
> +           (match_operand 1 "aarch64_plus_operand" "")])
> +         (match_operator 5 "aarch64_comparison_operator"
> +          [(match_operand:GPI 2 "register_operand" "r,r,r")
> +           (match_operand:GPI 3 "aarch64_ccmp_operand" "r,Uss,Usn")]))
> +        (const_int 0)))]
> +  ""
> +  {
> +    return aarch64_output_ccmp (operands, true, which_alternative);
> +  }
> +  [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
> +)
> +
> +(define_insn "*ccmp_ior"
> +  [(set (match_operand 6 "ccmp_cc_register" "")
> +       (compare
> +        (ior:SI
> +         (match_operator 4 "aarch64_comparison_operator"
> +          [(match_operand 0 "ccmp_cc_register" "")
> +           (match_operand 1 "aarch64_plus_operand" "")])
> +         (match_operator 5 "aarch64_comparison_operator"
> +          [(match_operand:GPI 2 "register_operand" "r,r,r")
> +           (match_operand:GPI 3 "aarch64_ccmp_operand" "r,Uss,Usn")]))
> +        (const_int 0)))]
> +  ""
> +  {
> +    return aarch64_output_ccmp (operands, false, which_alternative);
> +  }
> +  [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
> +)
> +
>  (define_insn "*condjump"
>    [(set (pc) (if_then_else (match_operator 0
> "aarch64_comparison_operator"
>                             [(match_operand 1 "cc_register" "") (const_int
0)])
>                                                                    57,1

[-- Attachment #2: 8-patterns.patch --]
[-- Type: application/octet-stream, Size: 2322 bytes --]

diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index c60038a..e213cbe 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -239,6 +239,52 @@
   "
 )
 
+(define_expand "cbranchcc4"
+  [(set (pc) (if_then_else
+	      (match_operator 0 "aarch64_comparison_operator"
+	       [(match_operand 1 "cc_register" "")
+	        (const_int 0)])
+	      (label_ref (match_operand 3 "" ""))
+	      (pc)))]
+  ""
+  " ")
+
+(define_insn "*ccmp_and"
+  [(set (match_operand 6 "ccmp_cc_register" "")
+	(compare
+	 (and:SI
+	  (match_operator 4 "aarch64_comparison_operator"
+	   [(match_operand 0 "ccmp_cc_register" "")
+	    (match_operand 1 "aarch64_plus_operand" "")])
+	  (match_operator 5 "aarch64_comparison_operator"
+	   [(match_operand:GPI 2 "register_operand" "r,r,r")
+	    (match_operand:GPI 3 "aarch64_ccmp_operand" "r,Uss,Usn")]))
+	 (const_int 0)))]
+  ""
+  {
+    return aarch64_output_ccmp (operands, true, which_alternative);
+  }
+  [(set_attr "type" "alus_sreg,alus_imm,alus_imm")]
+)
+
+(define_insn "*ccmp_ior"
+  [(set (match_operand 6 "ccmp_cc_register" "")
+	(compare
+	 (ior:SI
+	  (match_operator 4 "aarch64_comparison_operator"
+	   [(match_operand 0 "ccmp_cc_register" "")
+	    (match_operand 1 "aarch64_plus_operand" "")])
+	  (match_operator 5 "aarch64_comparison_operator"
+	   [(match_operand:GPI 2 "register_operand" "r,r,r")
+	    (match_operand:GPI 3 "aarch64_ccmp_operand" "r,Uss,Usn")]))
+	 (const_int 0)))]
+  ""
+  {
+    return aarch64_output_ccmp (operands, false, which_alternative);
+  }
+  [(set_attr "type" "alus_sreg,alus_imm,alus_imm")]
+)
+
 (define_insn "*condjump"
   [(set (pc) (if_then_else (match_operator 0 "aarch64_comparison_operator"
 			    [(match_operand 1 "cc_register" "") (const_int 0)])
@@ -2382,6 +2428,19 @@
   "
 )
 
+(define_expand "cstorecc4"
+  [(set (match_operand:SI 0 "register_operand")
+       (match_operator 1 "aarch64_comparison_operator"
+        [(match_operand 2 "ccmp_cc_register")
+         (match_operand 3 "aarch64_plus_operand")]))]
+  ""
+"{
+  operands[3] = const0_rtx;
+  emit_insn (gen_rtx_SET (SImode, operands[0], operands[1]));
+  DONE;
+}")
+
+
 (define_expand "cstore<mode>4"
   [(set (match_operand:SI 0 "register_operand" "")
 	(match_operator:SI 1 "aarch64_comparison_operator"

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-29 14:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23  6:45 [Ping] [PATCH, 8/10] aarch64: ccmp insn patterns Zhenqiang Chen
2014-10-11 20:45 ` Richard Henderson
2014-10-27  7:50   ` Zhenqiang Chen
2014-10-27 15:58     ` Richard Henderson
2014-10-29 10:42       ` Zhenqiang Chen
2014-10-29 14:32         ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).