From patchwork Wed Jun 26 08:01:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenqiang Chen X-Patchwork-Id: 254599 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 2330A2C0092 for ; Wed, 26 Jun 2013 18:01:57 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=cFp19Jf01YwMwlr/X4 64XKSMgsXUvKWom4J4EkWwErFjKO67AXfq3XpDA+zIrh9FQ7PfdogHIDBI5TfNFX PudHALKxlTg+urjqKeQd0KiQ38txckdk8bX8Cete0vctkNV0WB8PKwYDeTvryE8U v71Gk465i3JTb0W+9OB7Zt928= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=2TBaLPqn4Tg+61RdNseTk02s GDU=; b=mVYB4RBizEjS8dF7cTg7SAWY572GV8WVCjsI9mKKM/wJNt601kPq7JLg A6QSmUudpbP56k3CfmXqjSvsCf3NpTMHBWYDSQIImdZfdIQBYqMt6j4pLD7x2QHt mcqAxWVxL9bMx1hc61Dx2IxG1pMrFnpGngWJsqoMSm1MADWeBSQ= Received: (qmail 19927 invoked by alias); 26 Jun 2013 08:01:41 -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 19886 invoked by uid 89); 26 Jun 2013 08:01:40 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-la0-f48.google.com (HELO mail-la0-f48.google.com) (209.85.215.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 26 Jun 2013 08:01:39 +0000 Received: by mail-la0-f48.google.com with SMTP id lx15so13036654lab.7 for ; Wed, 26 Jun 2013 01:01:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=a9jBq77R5vTg5F1BAO0kbfjQKnvttqEvcvfyVj/pZxw=; b=Vdsqu/Bl5NlosgLO6jiYmeli99bS2Uqy1rQT1+kF36TKBR/oG3UdoUaR3v/ZdvrKoi WhCqlG07Xje+yLbN7dWQgsxcCj15FIplprj7CQ57n6xh/2T15XrbN00OgaXZQMTJ60Sv Bv+GsZSIedTzFn2dThR1t2cxXXKl0lBTnyvNRB/amFoCoQjMYTuRBr4NMLoXBJKX1Hyi cTEyh6X+8eYO97NNvgJH+AtJQMFEPAfKpR+UYBb7lbGdRmY8lbHMdgoHZNFZON3f6d3P at4HQP5itSUzOfzwDeE6hbRtbO7pbkxHgtFbsTxkI2Icx4gDEigl4AWFQanM/NG4Q4Wg M0ag== MIME-Version: 1.0 X-Received: by 10.112.150.201 with SMTP id uk9mr920163lbb.61.1372233696656; Wed, 26 Jun 2013 01:01:36 -0700 (PDT) Received: by 10.112.162.229 with HTTP; Wed, 26 Jun 2013 01:01:36 -0700 (PDT) In-Reply-To: <51C02B34.7050104@arm.com> References: <51C02B34.7050104@arm.com> Date: Wed, 26 Jun 2013 16:01:36 +0800 Message-ID: Subject: Re: [PATCH, ARM] Fix unrecognizable vector comparisons From: Zhenqiang Chen To: Ramana Radhakrishnan Cc: "gcc-patches@gcc.gnu.org" X-Gm-Message-State: ALoCoQkY4jtqeTFbg1ZhMfW+tBUff7+dOvrLIZ2USVcCjsEnQQScI5OsyBtA3FhaIfH38K7ST1Lh On 18 June 2013 17:41, Ramana Radhakrishnan wrote: > On 06/18/13 09:50, Zhenqiang Chen wrote: >> >> Hi, >> >> During expand, function vcond inverses some CMP, e.g. >> >> a LE b -> b GE a >> >> But if "b" is "CONST0_RTX", "b GE a" will be an illegal insn. >> >> (insn 933 932 934 113 (set (reg:V4SI 1027) >> (unspec:V4SI [ >> (const_vector:V4SI [ >> (const_int 0 [0]) >> (const_int 0 [0]) >> (const_int 0 [0]) >> (const_int 0 [0]) >> ]) >> (reg:V4SI 1023 [ vect_var_.49 ]) >> (const_int 1 [0x1]) >> ] UNSPEC_VCGE)) PUGHSlab/Mapping.c:567 -1 >> (nil)) >> >> Refer https://bugs.launchpad.net/linaro-toolchain-binaries/+bug/1189445 >> for more. And the bug also happens for FSF trunk. >> >> The similar issue >> (https://bugs.launchpad.net/linaro-toolchain-binaries/+bug/1163942) >> had fixed on AARCH64: >> http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00581.html >> >> The patch is similar to the fix for aarch64. >> >> Bootstrap and no make check regression on Panda Board. >> >> Is it OK for trunk and 4.8? > > > No, not without an appropriate set of testcases that exercise these cases. Thanks for the comments. Patch is updated with a test case. diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index 2761adb..6d9f604 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -1710,6 +1710,9 @@ case LE: case UNLE: inverse = 1; + /* Can not inverse "a LE 0" to "0 GE a". */ + if (operands[5] == CONST0_RTX (mode)) + inverse = 0; /* Fall through. */ case GT: case UNGT: diff --git a/gcc/testsuite/gcc.target/arm/lp1189445.c b/gcc/testsuite/gcc.target/arm/lp1189445.c new file mode 100644 index 0000000..8ce4b97 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/lp1189445.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mfpu=neon -mcpu=cortex-a9 -mthumb -mfloat-abi=hard -S" } */ + +int id; +int +test (const long int *data) +{ + int i, retval; + retval = id; + for (i = 0; i < id; i++) + { + retval &= (data[i] <= 0); + } + + return (retval); +}