From patchwork Fri Sep 15 10:45:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 112705 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp451335edb; Fri, 15 Sep 2017 03:45:47 -0700 (PDT) X-Received: by 10.98.68.206 with SMTP id m75mr24654573pfi.163.1505472346881; Fri, 15 Sep 2017 03:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505472346; cv=none; d=google.com; s=arc-20160816; b=ucnPTaupRbkZ59KUGEkiqqU2Ig4aWLBX8IpKrB/B36xNixSoKvFhxGqEPNc9/o9ScE ehl4MHrut7XwTd0Yl7AJLX1Aq+65Q0VMw50iA3nABLmqQi1Oo1jHVdKF6EIgy8jfFhrD ZlMvby2o9O02dJ+0KTy+3UhKXkpc1z33sY5r7QezjFIBRrxC4dorWIYMZkeosNu0F5YL EmUuZK7RCJ0a0hw1SdqWE0K2ajJfuzftRgUBPN72VvPcQ6pFiYNdVDEp8knTRws2rftn 2jZkhhC8rpdVrDvCXkPYdPuUZvPcQHzH0xllJKYLtd0EGnJl+PwLCRMDoThrCyjPys9i d0Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date:subject:mail-followup-to:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=qTg+X9055Ha/hLvUShLv6tR67Smin+lfz0czPMTbHSQ=; b=scHwTNpQBDOLzyn6yU92BOo8c4YvtE8CaSeoQZ/Cq/QnZZBqRl0acZddEhVkLfienS chCfNDYDuFz5LVEub+3hUiAIRwqzbXoomutfqYYvkAZelyqISCWtRCHX9aLOjowGIBFZ Yf91T1QKiY4ScHEl5tTON49+ZOpDNPy436jU3M55BWarM3L/mZDTNKuOynhYN12bgVmx 6TkUs8I/oeo7XRDu26ZS2Z7BWU0/fO8+/qkmJol1o4x/K0Ln4UF2uA/KgAY4C+QgtRz0 KNbHF+7OAoxBr9f0pGoOw0ms6FbyfVaxFJ7dhpHN0XLP1XjPidRgKYPDmcPXlN8UoEpL Luhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=p5oBTLw4; spf=pass (google.com: domain of gcc-patches-return-462217-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-462217-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b5si494198ple.493.2017.09.15.03.45.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2017 03:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-462217-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=p5oBTLw4; spf=pass (google.com: domain of gcc-patches-return-462217-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-462217-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=VO4ZLQ8oeAk6CGgm/7Zs6zBumsjGxnRn939KZzPjsg53ZWMKiRGAs 34fHYCOj5+788/y7YD/wyURoMYivlGFS6nVRYwxFPktQjG2F4nMlwbhJ55CPIxt1 aFDQWSWodAxqDTGrgG9X3x6P1uQcq24cLeMHqcG4Qo6n4KSWbJxyB0= 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:subject:date:message-id:mime-version:content-type; s= default; bh=TZmXw3NlOOIIeDT/Wj82XnjNh5g=; b=p5oBTLw41m2J78PnPJzK 44xcHNyL9GmfSWAt39r23XK7V2nLKPPWdImxD1jBpHIAXO/Lio1C0Llqe+WB8f6z ADScaaEJQDasOgYsX087rsULPAJv4oKWCJw1DQFTaa1xLiUokVUIf4tQStycff6g MLQGYi+VcOGu27WRRwO5csU= Received: (qmail 78463 invoked by alias); 15 Sep 2017 10:45:35 -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 77874 invoked by uid 89); 15 Sep 2017 10:45:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f52.google.com Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Sep 2017 10:45:14 +0000 Received: by mail-wm0-f52.google.com with SMTP id e71so7193760wmg.4 for ; Fri, 15 Sep 2017 03:45:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:date:message-id :user-agent:mime-version; bh=qTg+X9055Ha/hLvUShLv6tR67Smin+lfz0czPMTbHSQ=; b=l+XkbaMUGJ+3z5ROhiXOtKtgqAmPZltfPqOk8Ixf+htbSm11Ox28JoWPULG9vyMkgD 7FQ2jiB5yC6w1i2zJz2nKi8X6KLm/PRz9gAuhJueLgPiIdo/V3ahMH+h5ppH+ApyHfbV 4fVZvNrG9buYr/xRjE6ZaG87FWXaBiXOWFDCPCi/JOtvV9TQTtMY2ODbzFpTOCY/eaN3 9g1mxPUQa/TL9qdZZ14PHBw52/CqxF5t1ZUbP1PcxAuLjK6WVUlMD8WKInth1BLbhn82 MYTsJFX2IygBADNl8HpU1g7Ub6+e7F3i0C37cb0C65M6EojkrDcStWMebrXAD0SnR5s5 exYQ== X-Gm-Message-State: AHPjjUghPRpAl5ie+NxdMLRJWOayN5FgYd7hVIOaDd7JTZuvlCo3zUbU VmnEoXpUAAvQS4w8UF8Zbw== X-Google-Smtp-Source: AOwi7QCzuxhyyxkgrWIeU6DJLmdNikv4upRlosVb47Q+l+U+UlzSdNez+0ZxaA7agjnDkrp416N/2w== X-Received: by 10.28.54.206 with SMTP id y75mr2426922wmh.53.1505472311767; Fri, 15 Sep 2017 03:45:11 -0700 (PDT) Received: from localhost (92.40.248.1.threembb.co.uk. [92.40.248.1]) by smtp.gmail.com with ESMTPSA id 15sm821238wmu.4.2017.09.15.03.45.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2017 03:45:10 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: Fix vectorizable_live_operation handling of vector booleans Date: Fri, 15 Sep 2017 11:45:09 +0100 Message-ID: <87efr8nsui.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 vectorizable_live_operation needs to use BIT_FIELD_REF to extract one element of a vector. For a packed vector boolean type, the number of bits to extract should be taken from TYPE_PRECISION rather than TYPE_SIZE. This is shown by existing tests once SVE is added. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. OK to install? Richard 2017-09-15 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-vect-loop.c (vectorizable_live_operation): Fix element size calculation for vector booleans. Index: gcc/tree-vect-loop.c =================================================================== --- gcc/tree-vect-loop.c 2017-09-15 11:35:46.832592132 +0100 +++ gcc/tree-vect-loop.c 2017-09-15 11:37:45.639244036 +0100 @@ -7065,7 +7065,9 @@ vectorizable_live_operation (gimple *stm : gimple_get_lhs (stmt); lhs_type = TREE_TYPE (lhs); - bitsize = TYPE_SIZE (TREE_TYPE (vectype)); + bitsize = (VECTOR_BOOLEAN_TYPE_P (vectype) + ? bitsize_int (TYPE_PRECISION (TREE_TYPE (vectype))) + : TYPE_SIZE (TREE_TYPE (vectype))); vec_bitsize = TYPE_SIZE (vectype); /* Get the vectorized lhs of STMT and the lane to use (counted in bits). */