From patchwork Fri Oct 2 14:01:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 525551 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 2D487140316 for ; Sat, 3 Oct 2015 00:02:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=cV94s+YS; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=mfTLSpgX6EzOPScALTaQ4sA73SM2CXf+6MHRgks17p0DirBc4ptC7 yyPxg7EOIhl1aXhm4dsnd1/ogg89XhFFsMGWZJi/Cz5xtJChIKMrAdJP/y/GYr4T /lPJdp1q2lKR6QrPxF7DiO+9q2i9/IsOhJvBC8hm0bHjNHs+L/Ji7M= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=IYVz2ygKF53G0j894Rli828l9cg=; b=cV94s+YSZtdD4n8Znp8f wICoiz+UTHL0dJy8kXT7prgZgNzf+4MLWL6cGMKzpSb0cDkR9thW/eYEEkWMmQIN 9hLzWLKxAyLGCR/BRFMnV64Jaz1TYtY1wugZe36Ac80sGUwlVJX+1GhW0qOi+/6Y OmT/zVoHx1LcoMID+uEQb0k= Received: (qmail 128898 invoked by alias); 2 Oct 2015 14:02:25 -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 128886 invoked by uid 89); 2 Oct 2015 14:02:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 02 Oct 2015 14:02:14 +0000 Received: by wicgb1 with SMTP id gb1so34433528wic.1 for ; Fri, 02 Oct 2015 07:02:11 -0700 (PDT) X-Received: by 10.180.89.101 with SMTP id bn5mr4362216wib.20.1443794531635; Fri, 02 Oct 2015 07:02:11 -0700 (PDT) Received: from msticlxl57.ims.intel.com ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id hd1sm1739000wib.5.2015.10.02.07.02.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2015 07:02:11 -0700 (PDT) Date: Fri, 2 Oct 2015 17:01:51 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [Boolean Vector, patch 2/5] Change vector comparison IL requirement Message-ID: <20151002140151.GF26618@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, This patch change vector comparison to require boolean vector resulting type. Thanks, Ilya --- gcc/ 2015-10-02 Ilya Enkovich * tree-cfg.c (verify_gimple_comparison) Require boolean vector type for vector comparison. (verify_gimple_assign_ternary): Likewise. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 807d96f..c3dcced 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3464,10 +3464,10 @@ verify_gimple_comparison (tree type, tree op0, tree op1) return true; } } - /* Or an integer vector type with the same size and element count + /* Or a boolean vector type with the same element count as the comparison operand types. */ else if (TREE_CODE (type) == VECTOR_TYPE - && TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE) + && TREE_CODE (TREE_TYPE (type)) == BOOLEAN_TYPE) { if (TREE_CODE (op0_type) != VECTOR_TYPE || TREE_CODE (op1_type) != VECTOR_TYPE) @@ -3478,12 +3478,7 @@ verify_gimple_comparison (tree type, tree op0, tree op1) return true; } - if (TYPE_VECTOR_SUBPARTS (type) != TYPE_VECTOR_SUBPARTS (op0_type) - || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (type))) - != GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0_type)))) - /* The result of a vector comparison is of signed - integral type. */ - || TYPE_UNSIGNED (TREE_TYPE (type))) + if (TYPE_VECTOR_SUBPARTS (type) != TYPE_VECTOR_SUBPARTS (op0_type)) { error ("invalid vector comparison resulting type"); debug_generic_expr (type); @@ -3970,15 +3965,13 @@ verify_gimple_assign_ternary (gassign *stmt) break; case VEC_COND_EXPR: - if (!VECTOR_INTEGER_TYPE_P (rhs1_type) - || TYPE_SIGN (rhs1_type) != SIGNED - || TYPE_SIZE (rhs1_type) != TYPE_SIZE (lhs_type) + if (!VECTOR_BOOLEAN_TYPE_P (rhs1_type) || TYPE_VECTOR_SUBPARTS (rhs1_type) != TYPE_VECTOR_SUBPARTS (lhs_type)) { - error ("the first argument of a VEC_COND_EXPR must be of a signed " - "integral vector type of the same size and number of " - "elements as the result"); + error ("the first argument of a VEC_COND_EXPR must be of a " + "boolean vector type of the same number of elements " + "as the result"); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true;