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: 817639 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-462793-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="d5DA/Fl5"; 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 3xzJz049Rmz9t3h for ; Sat, 23 Sep 2017 02:36:44 +1000 (AEST) 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=VZ8PutNAABsTUL7n/Xi835/jPs2Vch56BPQhbXmrrWBPy2N+097uS RFULSZ1PI8LbGwkWR1xgjmAWY9fBfAVtH8kee+WRAGqZp2AFg4dxafgf/fauZ3mu a9WPPA3l0CKE9ExPzlfVjZrodSNIjFtklBmfX2qpzil5/levGAimpY= 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=d5DA/Fl5ClEu83sGIIuR cF5NlsiCmkw1JNd7iHMVBTgVONYm3OBtm97zVx8leqtQp8C60tOF65dO/cl2q4vo 5TcyuG4SLrDDhhTBc3IXB8Y1GVFQhAwlFb0Y8mSZpcPo9GlBs+fWRYso05t2nse1 hgnIa1zenxseWyYavjedDwA= 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); }