From patchwork Thu Feb 14 06:23:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hurugalawadi, Naveen" X-Patchwork-Id: 220370 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]) by ozlabs.org (Postfix) with SMTP id 3AC652C0292 for ; Thu, 14 Feb 2013 17:24:02 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1361427843; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:From:To:Subject:Date: Message-ID:Content-Type:MIME-Version:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=9z+ysp+2jSq3bYLEUkzdLd4Z02Y=; b=aXX6WRWAM8I/OlG QfaDo6ePqLmlQ+d9C93iGHVEQ3KVFIpYBDCb5OOci8QFJgvZqOlA82ExDQIaICg/ ibArnViktqffSYS6XnG36VW2rpo8v5JifRRFsuhLlHBA9QoGegZAvoB6ZZvv1X3r PKrYoHiwvmw2PJReeFfxO3EAPs2o= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:X-Forefront-Antispam-Report:X-SpamScore:X-BigFish:Received:Received:Received:Received:From:To:Subject:Date:Message-ID:Content-Type:MIME-Version:X-OriginatorOrg:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TYDPavIc08/537hynKvmuDHLQKr4bTH4hO7/RsRrGmdAYfNX1c6Eu06wf0Epft mdFlXxOo6S+hmLakWjN+jG6ewe6bcJ11pToZslrW6VqAMtt9bFw9LniDxx1ZXLWa 42da7/7mTU/cAIP+GbbcemQyJn85Yc8J9bHikEGqdYzfQ=; Received: (qmail 17970 invoked by alias); 14 Feb 2013 06:23:55 -0000 Received: (qmail 17961 invoked by uid 22791); 14 Feb 2013 06:23:53 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from va3ehsobe005.messaging.microsoft.com (HELO va3outboundpool.messaging.microsoft.com) (216.32.180.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Feb 2013 06:23:45 +0000 Received: from mail229-va3-R.bigfish.com (10.7.14.243) by VA3EHSOBE007.bigfish.com (10.7.40.11) with Microsoft SMTP Server id 14.1.225.23; Thu, 14 Feb 2013 06:23:43 +0000 Received: from mail229-va3 (localhost [127.0.0.1]) by mail229-va3-R.bigfish.com (Postfix) with ESMTP id 7546BD6015B for ; Thu, 14 Feb 2013 06:23:43 +0000 (UTC) X-Forefront-Antispam-Report: CIP:157.56.236.133; KIP:(null); UIP:(null); IPV:NLI; H:BY2PRD0710HT004.namprd07.prod.outlook.com; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: PS3(z2005kzc85fhzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz17326ah8275dh172d07hz2dh2a8h668h839hd25hf0ah1288h12a5h12bdh137ah1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h19ceh34h1155h) Received: from mail229-va3 (localhost.localdomain [127.0.0.1]) by mail229-va3 (MessageSwitch) id 1360823021975763_10626; Thu, 14 Feb 2013 06:23:41 +0000 (UTC) Received: from VA3EHSMHS032.bigfish.com (unknown [10.7.14.245]) by mail229-va3.bigfish.com (Postfix) with ESMTP id E2B5040055 for ; Thu, 14 Feb 2013 06:23:41 +0000 (UTC) Received: from BY2PRD0710HT004.namprd07.prod.outlook.com (157.56.236.133) by VA3EHSMHS032.bigfish.com (10.7.99.42) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 14 Feb 2013 06:23:41 +0000 Received: from BY2PRD0710MB364.namprd07.prod.outlook.com ([169.254.3.207]) by BY2PRD0710HT004.namprd07.prod.outlook.com ([10.255.86.39]) with mapi id 14.16.0263.000; Thu, 14 Feb 2013 06:23:40 +0000 From: "Hurugalawadi, Naveen" To: "gcc-patches@gcc.gnu.org" Subject: [PING^1] [AArch64] Implement Bitwise AND and Set Flags Date: Thu, 14 Feb 2013 06:23:40 +0000 Message-ID: MIME-Version: 1.0 X-OriginatorOrg: caviumnetworks.com 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 Hi, Please consider this as a reminder to review the patch posted at following link:- http://gcc.gnu.org/ml/gcc-patches/2013-01/msg01374.html The patch is slightly modified to use CC_NZ mode instead of CC. Please review the patch and let me know if its okay? Thanks & Regards, Naveen.H.S --- gcc/config/aarch64/aarch64.md 2013-01-29 12:27:37.289475066 +0530 +++ gcc/config/aarch64/aarch64.md 2013-01-29 11:43:06.693434952 +0530 @@ -2433,6 +2433,35 @@ [(set_attr "v8type" "logic,logic_imm") (set_attr "mode" "SI")]) +(define_insn "*and3_compare0" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ + (and:GPI (match_operand:GPI 1 "register_operand" "%r,r") + (match_operand:GPI 2 "aarch64_logical_operand" "r,")) + (const_int 0))) + (set (match_operand:GPI 0 "register_operand" "=r,r") + (and:GPI (match_dup 1) (match_dup 2)))] + "" + "ands\\t%0, %1, %2" + [(set_attr "v8type" "logic,logic_imm") + (set_attr "mode" "")] +) + +;; zero_extend version of above +(define_insn "*andsi3_compare0_uxtw" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ + (and:SI (match_operand:SI 1 "register_operand" "%r,r") + (match_operand:SI 2 "aarch64_logical_operand" "r,K")) + (const_int 0))) + (set (match_operand:DI 0 "register_operand" "=r,r") + (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] + "" + "ands\\t%w0, %w1, %w2" + [(set_attr "v8type" "logic,logic_imm") + (set_attr "mode" "SI")] +) + (define_insn "*_3" [(set (match_operand:GPI 0 "register_operand" "=r") (LOGICAL:GPI (SHIFT:GPI --- gcc/testsuite/gcc.target/aarch64/ands.c 1970-01-01 05:30:00.000000000 +0530 +++ gcc/testsuite/gcc.target/aarch64/ands.c 2013-01-29 12:29:02.001476339 +0530 @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int z; +int +foo (int x, int y) +{ + int l = x & y; + if (l == 0) + return 5; + + /* { dg-final { scan-assembler "ands\tw\[0-9\]" } } */ + z = l ; + return 25; +} + +typedef long long s64; + +s64 zz; +s64 +foo2 (s64 x, s64 y) +{ + s64 l = x & y; + if (l < 0) + return 5; + + /* { dg-final { scan-assembler "ands\tx\[0-9\]" } } */ + zz = l ; + return 25; +}