This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[AArch64 09/14] Add special cases of zero-extend w/ compare operations.
- From: Philipp Tomsich <philipp dot tomsich at theobroma-systems dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: philipp dot tomsich at theobroma-systems dot com
- Date: Tue, 18 Feb 2014 22:09:42 +0100
- Subject: [AArch64 09/14] Add special cases of zero-extend w/ compare operations.
- Authentication-results: sourceware.org; auth=none
- References: <1392757787-25629-1-git-send-email-philipp dot tomsich at theobroma-systems dot com>
---
gcc/config/aarch64/aarch64.md | 56 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 60e42af..c72d123 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -2227,6 +2227,62 @@
[(set_attr "type" "alus_ext")]
)
+(define_insn "*zext<mode>qi3_compare0"
+ [(set (reg:CC_ZESWP CC_REGNUM)
+ (compare:CC_ZESWP
+ (zero_extend:GPI (match_operand:QI 1 "register_operand" "r"))
+ (const_int 0)))
+ (set (match_operand:GPI 0 "register_operand" "=r")
+ (zero_extend:GPI (match_dup 1)))]
+ ""
+ "ands\\t%<w>0, %<w>1, 0xFF"
+ [(set_attr "type" "logics_imm")]
+)
+
+(define_insn "*zext<mode>hi3_compare0"
+ [(set (reg:CC_ZESWP CC_REGNUM)
+ (compare:CC_ZESWP
+ (zero_extend:GPI (match_operand:HI 1 "register_operand" "r"))
+ (const_int 0)))
+ (set (match_operand:GPI 0 "register_operand" "=r")
+ (zero_extend:GPI (match_dup 1)))]
+ ""
+ "ands\\t%<w>0, %<w>1, 0xFFFF"
+ [(set_attr "type" "logics_imm")]
+)
+
+(define_insn "*zextdisi3_compare0"
+ [(set (reg:CC_ZESWP CC_REGNUM)
+ (compare:CC_ZESWP
+ (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
+ (const_int 0)))
+ (set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (match_dup 1)))]
+ ""
+ "ands\\t%x0, %x1, 0xFFFFFFFF"
+ [(set_attr "type" "logics_imm")]
+)
+
+(define_insn "*zextqi3nr_compare0"
+ [(set (reg:CC_ZESWP CC_REGNUM)
+ (compare:CC_ZESWP
+ (match_operand:QI 0 "register_operand" "r")
+ (const_int 0)))]
+ ""
+ "tst\\t%w0, 0xFF"
+ [(set_attr "type" "logics_imm")]
+)
+
+(define_insn "*zexthi3nr_compare0"
+ [(set (reg:CC_ZESWP CC_REGNUM)
+ (compare:CC_ZESWP
+ (match_operand:HI 0 "register_operand" "r")
+ (const_int 0)))]
+ ""
+ "tst\\t%w0, 0xFFFF"
+ [(set_attr "type" "logics_imm")]
+)
+
;; -------------------------------------------------------------------
;; Store-flag and conditional select insns
;; -------------------------------------------------------------------
--
1.9.0