From patchwork Sat Dec 9 23:06:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 121290 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1155392qgn; Sat, 9 Dec 2017 15:06:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMZfNevgejo0dq4UCE9qKrCVLFSa6KhOPQE1H5nC6+U0crqvDooFPEGJKsVwjAjFLpmbDm10 X-Received: by 10.101.66.11 with SMTP id c11mr33341311pgq.169.1512860806178; Sat, 09 Dec 2017 15:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512860806; cv=none; d=google.com; s=arc-20160816; b=aNelLFa9NP19ZoynQcV6AjlWXumAvhKAxFIXmqZSinq1kPBivr+jIT/cuHHznSX/Ro 51OV/zQCRgbcYGF4t8I5yvIAvd14tqcM+Cq9a7lIuu3QqZvcjMUJ8THC0ygBQ4dP3FEE 41442CgMG3wUUE8M2wkua4hO1iW4fvglJI7abrRreeXlyZqF9ZQ/iG6+V6cq9dYfdtHk izVKOQPqoktsLmyZSZaISHr5pYlrRRrgH0Ak2PMac2ATBcr/n3V1HYMWTGutH44yqqoY 6iNbHYTjfqz4RMpg966ZVik0DBiChZe3d23BsBnbObFE8oJu3O7jsF4trxkYoYzy5n9m CL4Q== 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=or5fP9p/60TDNA8Dg/b6OASBFvL6FaZ8MTBwQmiqVs8=; b=hv+9CcaMxGe96hmYdvrrhsKWKc6zMYxumM6LGIwzvyFxWYr1wxyF9BIVfolAsOP2U8 FdVFQmqamecU3t/kGbPOszRdwBunL4vycA4QN5KDp3Ru2IuzRokGpiICFhvWTGAIBtov tUsJZYrntjmBVLdHJozJS0hUu5YVU69VivCs9n3qQEOl3yvTDIsEk3o/UcLUUfU7I8/E RICp690O2yltoaoiQSH8LVM8vPF0oo3RJqkOjb2TEFFzHqzzgCLx2g+vQQ/TU2fZ/9tf PTejnL2RHMKgzC3fbb3tbVNK7YpXadkZTnJRSZSJBG/JNdhoo4gGhA9YMWkipklKfBYQ MO1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rFwVzHH2; spf=pass (google.com: domain of gcc-patches-return-468850-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-468850-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 a23si7640509pgd.478.2017.12.09.15.06.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 15:06:46 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-468850-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=rFwVzHH2; spf=pass (google.com: domain of gcc-patches-return-468850-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-468850-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=m2tB5esUdCzktEVbRhIoXT3jOnfjQakHdFs/ilyxHGvO/yZYU4fAU 1QDNORnbvxSVzyJtIINKuwm3PPTK5jUEXN5sbAopT87epzsbj5BjO2zgbc5e3jZW c7Gbrr4Nk7HpYQTSNAMTv7an2XOXckgk3U2pX2MTnCYSk0VhN62+uU= 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=66tUmv+wCJaJjQhpILondJY39jI=; b=rFwVzHH2DZgVmyGiqkST OXrRDGPnEKDtF5fSzsVyp8Aby/LQi4HjqHhXerEFC/mePM6Yb1Yv18j+auxl1Jy6 F9XFjNnsxZRoB4X+kxN77Ba7S1XFAYWgDhpk99ZC9GA/KwkNEDT3iUzgSGqYHsV5 bdABRy09h3Maj0Z5D9Ed6JM= Received: (qmail 69138 invoked by alias); 9 Dec 2017 23:06:33 -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 69119 invoked by uid 89); 9 Dec 2017 23:06:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=optab X-HELO: mail-wm0-f51.google.com Received: from mail-wm0-f51.google.com (HELO mail-wm0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Dec 2017 23:06:31 +0000 Received: by mail-wm0-f51.google.com with SMTP id g75so8547269wme.0 for ; Sat, 09 Dec 2017 15:06:30 -0800 (PST) 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=or5fP9p/60TDNA8Dg/b6OASBFvL6FaZ8MTBwQmiqVs8=; b=ZA95EET5ZQcl/NbrljSpWXi5//doWOv9pFS5NlRIS7phEank4fYAI7rsMz9RGcj4pN ZcTqHpDQLMYM68Bfq586QlPbOME70LZpoeVxCXnof+TSZQxb0s8uSoeulcZFUAvlyPnT d9Mt9ee5LbSt5YKpITxZ+wWVQi0KMq+MqBVtwMsFwKACikVP81P4pozGP2Jnx0uL0AM/ Czpz2eaM/SmgoJLTPfCW+hvw2BaAdbP/NbQLdtNoXso+ByZdyA/Vhtox1Ygf+SE63LAq 2FQB5QfNu0v2bafkS8P3nUKuekUFrSc4Vj33JaTX0C6EO7swjUVsg4U4RYUrpyhnwKw2 gd9w== X-Gm-Message-State: AKGB3mKCIgJLdAwxZgxRrNhrqGFxatt3GbrFmO3bhn28a8sbJYQ4Xg0T FVfWyqqnEuOSaPInUE7emlhWaPka00U= X-Received: by 10.28.147.84 with SMTP id v81mr7454034wmd.133.1512860788757; Sat, 09 Dec 2017 15:06:28 -0800 (PST) Received: from localhost ([2.25.234.120]) by smtp.gmail.com with ESMTPSA id m127sm5060472wmm.48.2017.12.09.15.06.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Dec 2017 15:06:27 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [00/13] Make VEC_PERM_EXPR work for variable-length vectors Date: Sat, 09 Dec 2017 23:06:26 +0000 Message-ID: <87indfmrgt.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 This series is a replacement for: https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00747.html based on the feedback that using VEC_PERM_EXPR would be better. The changes are: (1) Remove the restriction that the selector elements have to have the same width as the data elements, but only for constant selectors. This lets through the cases we need without also allowing potentially-expensive ops. Adding support for the variable case can be done later if it seems useful, but it's not trivial. (2) Encode the integer form of constant selectors (vec_perm_indices) in the same way as the new VECTOR_CST encoding, so that it can cope with variable-length vectors. (3) Remove the vec_perm_const optab and reuse the target hook to emit code. This avoids the need to create a CONST_VECTOR for the wide selectors, and hence the need to have a corresponding wide vector mode (which the target wouldn't otherwise need or support). (4) When handling the variable vec_perm optab, check that modes can store all element indices before using them. (5) Unconditionally use ssizetype selector elements in permutes created by the vectoriser. (6) Make the AArch64 vec_perm_const handling handle variable-length vectors. Tested directly on trunk on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. Also tested by comparing the before and after assembly output for: arm-linux-gnueabi arm-linux-gnueabihf aarch64-linux-gnu aarch64_be-linux-gnu ia64-linux-gnu i686-pc-linux-gnu mipsisa64-linux-gnu mipsel-linux-gnu powerpc64-linux-gnu powerpc64le-linux-gnu powerpc-eabispe x86_64-linux-gnu sparc64-linux-gnu at -O3, which should cover all the ports that defined vec_perm_const. The only difference was one instance of different RA for ia64-linux-gnu, caused by using force_reg on a SUBREG that was previously used directly. OK to install? Thanks, Richard