From patchwork Thu Aug 15 08:58:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1147501 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-507027-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qBxZcQFr"; 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 468L2p6SgTz9sND for ; Thu, 15 Aug 2019 18:58:25 +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=PcBDovxpcHgQ8La4dUhypruCV7OD8xfRr02ZbnKEZG4Fp8VnmxbEC Yk6rnGPjUVV8i7Z1wuU20BAftqLhIhr8PIMFmLahN0xnprxnCIP8RId7IIe2Zrgh JVkQ13iiGOCT7jNoY9zWzMyzxu0ezB+Qn46GQmfEVKuEBAhm2CezB0= 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=JlP1kuQjPrUkERNOcmSs1kSI3J4=; b=qBxZcQFr4vmz1Y9LZVjk S6TwGbcoyoXiG/xAgiz9SwHUCviyvGakVHyS04f5t3EGBf+HogZeUCLbVl7nMge8 Eyg9hO31My1Z4+lS6DiJJhh3EbOqgg29VjbiNXS+QdtlxKXcfdO+r0ubmdQdRA4/ rsjH93bZIpU0jsaL2mMsZes= Received: (qmail 20936 invoked by alias); 15 Aug 2019 08:58:18 -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 20788 invoked by uid 89); 15 Aug 2019 08:58:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=vls X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Aug 2019 08:58:15 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5392C28 for ; Thu, 15 Aug 2019 01:58:14 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.99.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EFD6E3F706 for ; Thu, 15 Aug 2019 01:58:13 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [committed][AArch64] Fix predicate alignment for fixed-length SVE Date: Thu, 15 Aug 2019 09:58:12 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes aarch64_simd_vector_alignment was only giving predicates 16-bit alignment in VLA mode, not VLS mode. I think the problem is latent because we can't yet create an ABI predicate type, but it seemed worth fixing in a standalone patch rather than as part of the main ACLE series. The ACLE patches have tests for this. Tested on aarch64-linux-gnu (with and without SVE) and aarch64_be-elf. Applied as r274522. Richard 2019-08-15 Richard Sandiford gcc/ * config/aarch64/aarch64.c (aarch64_simd_vector_alignment): Return 16 for SVE predicates even if they are fixed-length. Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c 2019-08-15 09:52:24.842110687 +0100 +++ gcc/config/aarch64/aarch64.c 2019-08-15 09:56:41.816215015 +0100 @@ -15915,11 +15915,13 @@ aarch64_simd_attr_length_rglist (machine static HOST_WIDE_INT aarch64_simd_vector_alignment (const_tree type) { + /* ??? Checking the mode isn't ideal, but VECTOR_BOOLEAN_TYPE_P can + be set for non-predicate vectors of booleans. Modes are the most + direct way we have of identifying real SVE predicate types. */ + if (GET_MODE_CLASS (TYPE_MODE (type)) == MODE_VECTOR_BOOL) + return 16; if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) - /* ??? Checking the mode isn't ideal, but VECTOR_BOOLEAN_TYPE_P can - be set for non-predicate vectors of booleans. Modes are the most - direct way we have of identifying real SVE predicate types. */ - return GET_MODE_CLASS (TYPE_MODE (type)) == MODE_VECTOR_BOOL ? 16 : 128; + return 128; return wi::umin (wi::to_wide (TYPE_SIZE (type)), 128).to_uhwi (); }