From patchwork Tue Feb 18 21:09:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 321680 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5F4402C01A7 for ; Wed, 19 Feb 2014 08:29:23 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=ck0FhYZwwpH1vvT5VVg5C/NPBGkV9E4osAyPwR8PEeeozDYHdiHGi NeNVKd7lO3+lLnnw2oIre9YfQAA/uYCEeem9HiAcvyXAczNTv5tN+TGu8VeEcaSu rDB3I6/vzqEe4KHJqqJHtpDY0QfW4e3nDt2hw3BhgNba1Na0y8mjhE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=BrAS3lfimBaJlVONjQPw5n04fbI=; b=V7//V9hBs+kAfzJvEj3w /XpD2uF9m/BWCVT2GRZ3Fjw24mmfP2VE7wxLkkWKO2FN6jRYCEW5itaLulumawNs a1YTD+g34cxskbUESpeB7FxfBSoIyvWxcFj24RH4KBWCYuE+wKUEG4+5dRDaBwXR fqczsLRH2HDyw3yNO1SvFvU= Received: (qmail 3836 invoked by alias); 18 Feb 2014 21:29:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 3827 invoked by uid 89); 18 Feb 2014 21:29:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 18 Feb 2014 21:29:16 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFrvs-000434-8W for gcc-patches@gcc.gnu.org; Tue, 18 Feb 2014 16:10:32 -0500 Received: from vegas.theobroma-systems.com ([144.76.126.164]:47334 helo=mail.theobroma-systems.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrvs-00041i-1y for gcc-patches@gcc.gnu.org; Tue, 18 Feb 2014 16:10:24 -0500 Received: from [85.31.14.210] (port=52453 helo=android.com) by mail.theobroma-systems.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1WFrvl-0007JV-KO; Tue, 18 Feb 2014 22:10:17 +0100 From: Philipp Tomsich To: gcc-patches@gcc.gnu.org Cc: philipp.tomsich@theobroma-systems.com Subject: [AArch64 09/14] Add special cases of zero-extend w/ compare operations. Date: Tue, 18 Feb 2014 22:09:42 +0100 Message-Id: <1392757787-25629-10-git-send-email-philipp.tomsich@theobroma-systems.com> In-Reply-To: <1392757787-25629-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1392757787-25629-1-git-send-email-philipp.tomsich@theobroma-systems.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 144.76.126.164 --- 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 "*zextqi3_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%0, %1, 0xFF" + [(set_attr "type" "logics_imm")] +) + +(define_insn "*zexthi3_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%0, %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 ;; -------------------------------------------------------------------