From patchwork Fri Sep 22 16:36:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 114062 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3495846qgf; Fri, 22 Sep 2017 09:36:49 -0700 (PDT) X-Received: by 10.98.36.132 with SMTP id k4mr10050237pfk.148.1506098209232; Fri, 22 Sep 2017 09:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506098209; cv=none; d=google.com; s=arc-20160816; b=l7lKr8jfbUbndprnitWSMyOjdT/H+jodRhFodrnqpO+HJ2HsmDG22sMOfL9HnxQFAy dADQeRuaasKdZNHiFVA6nierlDOMEwyoLLDMmVmO9HpAcrieGL3fBYlvvVSWaxAQ/UVk 7fUZkojZrK4h4oejpCWxqV3RcxDOU/U4ZoPBJ5wz2vqsMzlDfytoMEzxmCit9G4v/Y7W r/ttt+wuUKfd7mANgQPQlnOJoCPy1wdouTPD/KR8SciLTVGVH1JkMwh9yqb7GkkDz8ZG lIF1WqW8pbmBylkh2lf4JxjBM8pezp/ISfu/5U/BJ0OsKGiqwPMQGek/z+q4XkKyAMPU GERg== 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=53JnrwSGI+J1xauU5RoyRexKqKWveD74MG5+CyDAztI=; b=gkqagS3EkzEmlXmuhcf6l4eEn28fofOXyqxW7zID+0KDGKklYXTEj8d9Bvip1LuBqJ VySqeuj3LY8mn2Yqoqzx3MxWCqNeW6EQTHqvLb06PVWliv0Zibx5xmLywBILxaN/xVQT 1WWX0mkZrZVw1ccnT2D6VHRMil2eHqwG/IhDVXLTwXnrm6rlYDP8SgSv0E/FcUmqGpQ0 HjXHmGOYX1fyLkiffSkmRgYTvfwmk27alb7Gd5ySbjbMUF6YjQrTxnzHrP1DSAFjZb7w TvVBGa2bP5+5VKj4QkcTcrqA+Gh4jXGamsHOnQ6SNvnPP3rHwhSXjqkIG/aLgNooOQty 8efw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gleas3ub; spf=pass (google.com: domain of gcc-patches-return-462793-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-462793-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 c23si104907pfc.443.2017.09.22.09.36.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2017 09:36:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-462793-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=gleas3ub; spf=pass (google.com: domain of gcc-patches-return-462793-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-462793-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=nyZUxxJ9jqaO2tZBlrJQzJaaYS+1+EJkZ/zWg9Qbi+f8pI5/3lRLu 8I5NwjAcWfpQ+YlwOraUvNhfej3T5HhSyEl3yKWxZkCFfzYsKbLLDWXstk5bwshf fPhFrZv647lV0qkIQ+mAWElwt9ale5IQ02eEpHwIobxusCDMtRhAl4= 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=3tzc3IEDKZ+CJy2XB2xIJBrbb+M=; b=gleas3ubune54YREbXcN AjO0csanccx/eM6Vpv5teAhYx+5Ha6dvYMtqD0QQxwR+w0SR+bXeAiHqOEcoFXa5 wGZukC3cCbHrTZmZnz25YFuzWUQ1hNL8snzHiLwwUu1oUVosGAaGBvrdgcEarqwL fZygeGtANjUS6pk3EGBltfQ= Received: (qmail 122070 invoked by alias); 22 Sep 2017 16:36:37 -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 122057 invoked by uid 89); 22 Sep 2017 16:36:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-16.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f169.google.com Received: from mail-wr0-f169.google.com (HELO mail-wr0-f169.google.com) (209.85.128.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Sep 2017 16:36:36 +0000 Received: by mail-wr0-f169.google.com with SMTP id l39so1329136wrl.12 for ; Fri, 22 Sep 2017 09:36:35 -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=53JnrwSGI+J1xauU5RoyRexKqKWveD74MG5+CyDAztI=; b=jdJUVmsAk6p4FGBFzAe0piTjLLKRLOgHk427nmhwPV1Pcy1e78exxTXmLAMtURPo/0 IXvk2Q4qzWCRBUsNKDWDTuYyUMA4fGJIq3j5PbViiwt+w9zzigp1fNcOh0crCcam/aSJ HqcwOHgNCUyPYRcIiQlDUm1ohQLzwlbbDCYBhZ91g/6L91WmCR72xVPjppgggXn/aBWy KRzesmcZUOzrDOsmW+RmdD/7Jj9RYEW0jmaelbLe6coGIF+xLYBcyrizDmTlmVxRdWUt BAkxDT0DEs19UQUjhKcFAGeFlJ2X0V3PX3Z4FMrY1bepFWG3wgqPOKgToAgTfUETHoOM SkpQ== X-Gm-Message-State: AHPjjUhBVwhEh7liCjorTmyeMM/rEaK6zcP+7Iirw0HVKP4kY1R8tfGJ MKLis0f3IVQT8jAxv59vNOseOC20B7M= X-Google-Smtp-Source: AOwi7QCakJt3xzP4iJP0xGCQmRvwyuhz9R5n2wzNmQp7luQceWwmigqImLmyG2S4ljYt6EIM3AmUCg== X-Received: by 10.223.160.136 with SMTP id m8mr5751278wrm.70.1506098193883; Fri, 22 Sep 2017 09:36:33 -0700 (PDT) Received: from localhost (94.197.121.89.threembb.co.uk. [94.197.121.89]) by smtp.gmail.com with ESMTPSA id w5sm97813wrg.65.2017.09.22.09.36.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 09:36:33 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: Change permute index type to unsigned short Date: Fri, 22 Sep 2017 17:36:31 +0100 Message-ID: <874lrur8q8.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch changes the element type of (auto_)vec_perm_indices from unsigned char to unsigned short. This is needed for fixed-length 2048-bit SVE. (SVE is variable-length by default, but it's possible to ask for specific vector lengths if you want to.) Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. Also tested by comparing the testsuite assembly output on at least one target per CPU directory. OK to install? Richard 2017-09-22 Richard Sandiford gcc/ * target.h (vec_perm_indices): Use unsigned short rather than unsigned char. (auto_vec_perm_indices): Likewise. * config/aarch64/aarch64.c (aarch64_vectorize_vec_perm_const_ok): Use unsigned int rather than unsigned char. * config/arm/arm.c (arm_vectorize_vec_perm_const_ok): Likewise. Index: gcc/target.h =================================================================== --- gcc/target.h 2017-09-14 17:04:19.080694343 +0100 +++ gcc/target.h 2017-09-22 17:35:22.486794044 +0100 @@ -193,11 +193,11 @@ enum vect_cost_model_location { /* The type to use for vector permutes with a constant permute vector. Each entry is an index into the concatenated input vectors. */ -typedef vec vec_perm_indices; +typedef vec vec_perm_indices; /* Same, but can be used to construct local permute vectors that are automatically freed. */ -typedef auto_vec auto_vec_perm_indices; +typedef auto_vec auto_vec_perm_indices; /* The target structure. This holds all the backend hooks. */ #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME; Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c 2017-09-22 17:31:56.412840135 +0100 +++ gcc/config/aarch64/aarch64.c 2017-09-22 17:35:22.483794044 +0100 @@ -13820,7 +13820,7 @@ aarch64_vectorize_vec_perm_const_ok (mac nelt = sel.length (); for (i = which = 0; i < nelt; ++i) { - unsigned char e = d.perm[i]; + unsigned int e = d.perm[i]; gcc_assert (e < 2 * nelt); which |= (e < nelt ? 1 : 2); } Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c 2017-09-22 17:31:56.414735941 +0100 +++ gcc/config/arm/arm.c 2017-09-22 17:35:22.486794044 +0100 @@ -29261,7 +29261,7 @@ arm_vectorize_vec_perm_const_ok (machine nelt = GET_MODE_NUNITS (d.vmode); for (i = which = 0; i < nelt; ++i) { - unsigned char e = d.perm[i]; + unsigned int e = d.perm[i]; gcc_assert (e < 2 * nelt); which |= (e < nelt ? 1 : 2); }