From patchwork Mon Nov 9 11:34:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 541727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 9A1771402CC for ; Mon, 9 Nov 2015 22:34:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=hfYGyVOs; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=pQ8vhkkdAMuxw3XucyesxWbhssQhs83wzRqcXLFv4hq t/CQ3od6K7+vV95tRE937Oh08k35mqI+JioWKZn9RrKddVidAAw8ryC6WhZL4mwN 2Zb6qG5SDC674xyVKM2eYYJfY5AeNgVYHe2j/Y0iSZPE9abbK6PzdmffrV9Bs5lA = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=5CII3H91dxvnbjkOiJ8E5j7FsVo=; b=hfYGyVOsj5FM6Wl/u NZxYcx7D9fuICsrhMxS9ByFPabyAfX4LmTxVcYwWNK2Do72HbxfH8hFOMVVady1w fzbOm4TtXPs7I9DopChUoOM1OZFZ8Jq2XesnweCMlhsKT5sgh6cNebU20Mm4bBkX YMAdJDvW8aoCzrjM3nlEKCKMgM= Received: (qmail 39274 invoked by alias); 9 Nov 2015 11:34:34 -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 39180 invoked by uid 89); 9 Nov 2015 11:34:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Nov 2015 11:34:31 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-24-6nBGpF8DTue-GFDhD3Enpw-1; Mon, 09 Nov 2015 11:34:26 +0000 Received: from [10.2.206.200] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Nov 2015 11:34:26 +0000 Message-ID: <564084C2.7050806@arm.com> Date: Mon, 09 Nov 2015 11:34:26 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Marcus Shawcroft , Richard Earnshaw , James Greenhalgh Subject: [PATCH][AArch64][cleanup] Remove uses of CONST_DOUBLE_HIGH, CONST_DOUBLE_LOW X-MC-Unique: 6nBGpF8DTue-GFDhD3Enpw-1 X-IsSubscribed: yes Hi all, From what I understand, we shouldn't encounter the case where CONST_DOUBLE is used to hold a large integer value, accessed through CONST_DOUBLE_LOW and CONST_DOUBLE_HIGH. The aarch64 backend doesn't generate any such rtxes and the midend shouldn't be passing any such rtxes either. This allows for a bit of cleanup in aarch64_simd_valid_immediate. Bootstrapped and tested on aarch64. Ok for trunk? Thanks, Kyrill P.S. I propose this patch separate from my other patch that defines TARGET_SUPPORTS_WIDE_INT for aarch64 (https://gcc.gnu.org/ml/gcc-patches/2015-11/msg00934.html) as this is not needed to fix the ICE in that case and just removes some dead code and is thus not appropriate for backporting in my opinion. 2015-11-09 Kyrylo Tkachov * config/aarch64/aarch64.c (aarch64_simd_valid_immediate): Remove integer CONST_DOUBLE handling. It should never occur. commit 4b6c35c0f171a4841cb219e86b9d9ea752e2e849 Author: Kyrylo Tkachov Date: Thu Oct 29 10:28:12 2015 +0000 [AArch64][cleanup] Remove uses of CONST_DOUBLE_HIGH, CONST_DOUBLE_LOW diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 389bfc0..cbdff44 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -10080,32 +10080,16 @@ aarch64_simd_valid_immediate (rtx op, machine_mode mode, bool inverse, it must be laid out in the vector register in reverse order. */ rtx el = CONST_VECTOR_ELT (op, BYTES_BIG_ENDIAN ? (n_elts - 1 - i) : i); unsigned HOST_WIDE_INT elpart; - unsigned int part, parts; - if (CONST_INT_P (el)) - { - elpart = INTVAL (el); - parts = 1; - } - else if (GET_CODE (el) == CONST_DOUBLE) - { - elpart = CONST_DOUBLE_LOW (el); - parts = 2; - } - else - gcc_unreachable (); + gcc_assert (CONST_INT_P (el)); + elpart = INTVAL (el); + + for (unsigned int byte = 0; byte < innersize; byte++) + { + bytes[idx++] = (elpart & 0xff) ^ invmask; + elpart >>= BITS_PER_UNIT; + } - for (part = 0; part < parts; part++) - { - unsigned int byte; - for (byte = 0; byte < innersize; byte++) - { - bytes[idx++] = (elpart & 0xff) ^ invmask; - elpart >>= BITS_PER_UNIT; - } - if (GET_CODE (el) == CONST_DOUBLE) - elpart = CONST_DOUBLE_HIGH (el); - } } /* Sanity check. */