public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
To: gcc-patches@gcc.gnu.org
Cc: philipp.tomsich@theobroma-systems.com
Subject: [AArch64 07/14] Define additional patterns for adds/subs.
Date: Tue, 18 Feb 2014 21:10:00 -0000	[thread overview]
Message-ID: <1392757787-25629-8-git-send-email-philipp.tomsich@theobroma-systems.com> (raw)
In-Reply-To: <1392757787-25629-1-git-send-email-philipp.tomsich@theobroma-systems.com>

---
 gcc/config/aarch64/aarch64.md | 49 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 90f1ee9..13a75d3 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -1138,6 +1138,22 @@
   [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
 )
 
+;; alternative using the condition output only
+(define_insn "*add<mode>3_compare0_internal2"
+  [(set (reg:CC_NZ CC_REGNUM)
+        (compare:CC_NZ
+         (plus:GPI (match_operand:GPI 1 "register_operand" "%r,r,r")
+                   (match_operand:GPI 2 "aarch64_plus_operand" "r,I,J"))
+	 (const_int 0)))
+   (clobber (match_scratch:GPI 0 "=r,r,r"))]
+  ""
+  "@
+  adds\\t%<w>0, %<w>1, %<w>2
+  adds\\t%<w>0, %<w>1, %<w>2
+  subs\\t%<w>0, %<w>1, #%n2"
+  [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
+)
+
 ;; zero_extend version of above
 (define_insn "*addsi3_compare0_uxtw"
   [(set (reg:CC_NZ CC_REGNUM)
@@ -1155,6 +1171,39 @@
   [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
 )
 
+;; variant of the above using a swapped condition/comparator
+(define_insn "*addsi3_compare0_uxtw_zeswp"
+  [(set (reg:CC_ZESWP CC_REGNUM)
+        (compare:CC_ZESWP
+         (plus:SI (match_operand:SI 1 "register_operand" "%r,r,r")
+                  (match_operand:SI 2 "aarch64_plus_operand" "r,I,J"))
+	 (const_int 0)))
+   (set (match_operand:DI 0 "register_operand" "=r,r,r")
+        (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))]
+  ""
+  "@
+  adds\\t%w0, %w1, %w2
+  adds\\t%w0, %w1, %w2
+  subs\\t%w0, %w1, #%n2"
+  [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
+)
+
+;; alternative using the condition output only
+(define_insn "*addsi3_compare0_uxtw_zeswp_internal2"
+  [(set (reg:CC_ZESWP CC_REGNUM)
+         (compare:CC_ZESWP
+	 (plus:SI (match_operand:SI 1 "register_operand" "%r,r,r")
+                  (match_operand:SI 2 "aarch64_plus_operand" "r,I,J"))
+	 (const_int 0)))
+   (clobber (match_scratch:DI 0 "=r,r,r"))]
+  ""
+  "@
+  adds\\t%w0, %w1, %w2
+  adds\\t%w0, %w1, %w2
+  subs\\t%w0, %w1, #%n2"
+  [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
+)
+
 (define_insn "*adds_mul_imm_<mode>"
   [(set (reg:CC_NZ CC_REGNUM)
 	(compare:CC_NZ
-- 
1.9.0

  parent reply	other threads:[~2014-02-18 21:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 21:10 [AArch64 00/14] Pipeline-independent changes for XGene-1 Philipp Tomsich
2014-02-18 21:10 ` [AArch64 04/14] Correct the maximum shift amount for shifted operands Philipp Tomsich
2014-02-18 21:20   ` Andrew Pinski
2014-02-18 21:10 ` [AArch64 03/14] Retrieve BRANCH_COST from tuning structure Philipp Tomsich
2014-02-18 21:10 ` Philipp Tomsich [this message]
2014-02-18 21:19   ` [AArch64 07/14] Define additional patterns for adds/subs Andrew Pinski
2014-02-18 21:10 ` [AArch64 06/14] Extend '*tb<optab><mode>1' Philipp Tomsich
2014-02-18 21:19   ` Andrew Pinski
2014-02-18 21:10 ` [AArch64 02/14] Add "xgene1" core identifier Philipp Tomsich
2014-02-18 21:10 ` [AArch64 05/14] Add AArch64 'prefetch'-pattern Philipp Tomsich
2014-02-18 21:18   ` Andrew Pinski
2014-02-28  8:58   ` Gopalasubramanian, Ganesh
2014-02-28  9:14   ` Gopalasubramanian, Ganesh
2014-02-28  9:28     ` Dr. Philipp Tomsich
2014-05-28 14:25       ` Gopalasubramanian, Ganesh
2014-05-28 14:41         ` Dr. Philipp Tomsich
2014-02-18 21:10 ` [AArch64 01/14] Use "generic" target, if no other default Philipp Tomsich
2014-02-21 14:02   ` Kyrill Tkachov
2014-02-18 21:26 ` [AArch64 10/14] Add mov<mode>cc definition for GPF case Philipp Tomsich
2014-02-18 21:40   ` Andrew Pinski
2014-02-18 21:27 ` [AArch64 11/14] Optimize and(s) patterns for HI/QI operands Philipp Tomsich
2014-02-18 21:41   ` Andrew Pinski
2014-02-18 21:28 ` [AArch64 14/14] Add cost-model for XGene-1 Philipp Tomsich
2014-02-18 21:28 ` [AArch64 13/14] Initial tuning description for XGene-1 core Philipp Tomsich
2014-02-18 21:29 ` [AArch64 08/14] Define a variant of cmp for the CC_NZ case Philipp Tomsich
2014-02-18 21:42   ` Andrew Pinski
2014-02-18 21:29 ` [AArch64 09/14] Add special cases of zero-extend w/ compare operations Philipp Tomsich
2014-02-18 21:42   ` Andrew Pinski
2014-02-18 21:30 ` [AArch64 12/14] Generate 'bics', when only interested in CC_NZ Philipp Tomsich
2014-02-18 21:43   ` Andrew Pinski
2014-02-19 14:02 ` [AArch64 00/14] Pipeline-independent changes for XGene-1 Richard Earnshaw
2014-02-19 14:41 ` Ramana Radhakrishnan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392757787-25629-8-git-send-email-philipp.tomsich@theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).