From patchwork Thu Sep 18 12:45:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Lawrence X-Patchwork-Id: 390801 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 12843140077 for ; Thu, 18 Sep 2014 22:45:36 +1000 (EST) 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:subject:references :in-reply-to:content-type; q=dns; s=default; b=IXwqRg3fYl7yNSzIU bmHIsDEt1auN7ekNOYGgxWvH+btDjKF25TWEqSaHuYkKccySLahasqwcywrTL+28 4W8H2PdRiJUqo3xQfUC+TUkdoP8bPRerUxrm13HuMH55DCI+5PsqsH6KQKPBXUIy O0RlqZxsPBx8Ty7qcQot9m8b4I= 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:subject:references :in-reply-to:content-type; s=default; bh=n10Dta5zcIAbSWQYon/Y1JI yimc=; b=BUZHpj22Zf+VSAQd0IEPnHqN57abpubj7dib1X5yqEGRhfgKS9my2c/ nDfUVgO068v/Sya09jh4AdSGaH5I55zlnEh0KLNCUUw66BqzUgcCNq9Z9FhGm8mB 2qSL7wjz2oj9t2xQJw6WcX5vGoS1SFMgdztSQccuMW8Yrwz4BPXs= Received: (qmail 7855 invoked by alias); 18 Sep 2014 12:45:30 -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 7844 invoked by uid 89); 18 Sep 2014 12:45:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Sep 2014 12:45:29 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 18 Sep 2014 13:45:27 +0100 Received: from [10.1.209.51] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 18 Sep 2014 13:45:24 +0100 Message-ID: <541AD3E4.2030200@arm.com> Date: Thu, 18 Sep 2014 13:45:24 +0100 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH 13/14][AArch64_be] Fix vec_shr pattern to correctly implement endianness-neutral optab References: <541AC4D2.9040901@arm.com> In-Reply-To: <541AC4D2.9040901@arm.com> X-MC-Unique: 114091813452700201 X-IsSubscribed: yes The previous patch broke aarch64_be by redefining VEC_RSHIFT_EXPR / vec_shr_optab to always shift the vector towards gcc's element 0. This fixes aarch64_be to do that. check-gcc on aarch64-none-elf (no changes) and aarch64_be-none-elf (fixes all regressions produced by previous patch, i.e. no regressions from before redefining vec_shr). gcc/ChangeLog: * config/aarch64/aarch64-simd.md (vec_shr_ *2): Fix bigendian. diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 3fcf809113d73b37a95653b8c2be432478d2bc1e..e45eddbda7528cfbb4b0953b2c9934c5408d2f6d 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -776,7 +776,12 @@ (lshiftrt:VD (match_operand:VD 1 "register_operand" "w") (match_operand:SI 2 "immediate_operand" "i")))] "TARGET_SIMD" - "ushr %d0, %d1, %2" + { + if (BYTES_BIG_ENDIAN) + return "ushl %d0, %d1, %2"; + else + return "ushr %d0, %d1, %2"; + } [(set_attr "type" "neon_shift_imm")] ) @@ -804,6 +809,14 @@ DONE; } + if (BYTES_BIG_ENDIAN) + { + rtx temp = operands[1]; + operands[1] = zero_reg; + zero_reg = temp; + num_bits = 128 - num_bits; + } + emit_insn (gen_aarch64_ext (operands[0], operands[1], zero_reg, GEN_INT (num_bits / elem_bits))); DONE;