From patchwork Thu Oct 12 20:02:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 825069 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-464070-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bmkqvel2"; dkim-atps=neutral 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 3yChc45x7Xz9sNw for ; Fri, 13 Oct 2017 07:03:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=AZt6a Zr4/i9A34UdTqvbkHyjO/PNyfCBZ8tZuclIr5VBZ/PSp4MLVnWhrdDlyE5FiBxby DA+0UDfxNHDFlSJL0q1WfF9Kr0F/liq8b4Vyf1a439fUz61dQyvJA/hOXjc9V02q X31W9Vx/xGVL6vC7XlRFWBnaNUasRe6c0V4Iw0= 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 :subject:from:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; s=default; bh=xJFrjQ7nYKU xkqGNB4vOOmKqxNg=; b=bmkqvel23tFyKewfde/1lpVXmj8n2kWDvWJZ9CLmvrq 2wSRJqs34loule4Yzlu4s6je798cRyvFobwOc3iYTW13TMH7oNWIcfbSYUkHxYeG 03v5OTOKhVCLswMNglh2NVlArlbvJ4ql4ZjkbtHMyY8WWotvO0ddh3+KKFWvJjyQ = Received: (qmail 87160 invoked by alias); 12 Oct 2017 20:03:07 -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 86426 invoked by uid 89); 12 Oct 2017 20:03:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:176, H*Ad:U*wschmidt X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Oct 2017 20:03:06 +0000 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9CJxKo2022289 for ; Thu, 12 Oct 2017 16:03:02 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2djd5cvjc5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 12 Oct 2017 16:03:02 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Oct 2017 16:03:01 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 12 Oct 2017 16:02:59 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9CK2wbm50462898; Thu, 12 Oct 2017 20:02:58 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDF7E112056; Thu, 12 Oct 2017 16:02:32 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id 96220112034; Thu, 12 Oct 2017 16:02:32 -0400 (EDT) Subject: [PATCH] (gimple) Allow integer return type from vector compares From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: GCC Patches Cc: Richard Biener , Segher Boessenkool , Bill Schmidt , David Edelsohn Date: Thu, 12 Oct 2017 15:02:57 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17101220-0040-0000-0000-000003B21DFA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007886; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000236; SDB=6.00930210; UDB=6.00468250; IPR=6.00710477; BA=6.00005635; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017511; XFM=3.00000015; UTC=2017-10-12 20:03:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101220-0041-0000-0000-000007A72096 Message-Id: <1507838577.26707.176.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-12_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710120283 X-IsSubscribed: yes Hi, Update the logic in verify_gimple_comparision to allow a vector integer result from a vector comparison, where it previously was limited to only allowing compares with boolean results. This allows powerpc intrinsics such as this one to build (after gimple folding): vector bool int vec_cmpeq (vector signed int, vector signed int); This has been tested in conjunction with the "rs6000 GIMPLE folding for vector compares" patch (posted separately) on p6 and newer. OK for trunk? Thanks, -Will [gcc] 2017-10-12 Will Schmidt * gcc/tree-cfg.c: (@ verify_gimple_comparison ): allow boolean result from vector compares. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index b5e0460..adf3607 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3624,14 +3624,16 @@ verify_gimple_comparison (tree type, tree op0, tree op1, enum tree_code code) debug_generic_expr (op0_type); debug_generic_expr (op1_type); return true; } } - /* Or a boolean vector type with the same element count - as the comparison operand types. */ + /* Or a vector type with the same element count + as the comparison operand types. The vector type may + be boolean or integer. */ else if (TREE_CODE (type) == VECTOR_TYPE - && TREE_CODE (TREE_TYPE (type)) == BOOLEAN_TYPE) + && (( TREE_CODE (TREE_TYPE (type)) == BOOLEAN_TYPE) + || ( TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE))) { if (TREE_CODE (op0_type) != VECTOR_TYPE || TREE_CODE (op1_type) != VECTOR_TYPE) { error ("non-vector operands in vector comparison");