From patchwork Mon Sep 8 10:29:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 386853 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 163441400D5 for ; Mon, 8 Sep 2014 20:29:18 +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:cc:subject:content-type; q=dns; s=default; b=YlbUy0u6OAOigdJqE+61XkKhZuPn85xvGDM3vGe/Cof 8zZgxT9pW2w6a55/L7BWymptGMKzextFOO0Wiau9ipmlhJSs2VKIzMHo7ckJlK+B nPbMzSksZJWjshxxo/ZtcwGPxQUa1YkOICzLBuVZdrKPoCR3fzwrsjAT+kbD4fpM = 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=Kva5CU6/y0hAIyVVLgiGwEeztEM=; b=FxQmfdY18nL1e4Ub/ OCd92gFyzU66qC+7yEOVmDtaWpk8Asuf0Gn81UcHfDHs52uqdLIYiyHwWgzoos68 wnsIrRtnzPrBNvw5UgHxErIMO9eI5+lYz/JNF0iweTYTU1cdsbVIs+JDuYaFCt6D JxoM+SJnI2FFxhhK2UW9qBHE2A= Received: (qmail 1928 invoked by alias); 8 Sep 2014 10:29:12 -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 1916 invoked by uid 89); 8 Sep 2014 10:29:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 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; Mon, 08 Sep 2014 10:29:08 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 08 Sep 2014 11:29:04 +0100 Received: from [10.1.208.24] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Sep 2014 11:29:02 +0100 Message-ID: <540D84ED.2030002@arm.com> Date: Mon, 08 Sep 2014 11:29:01 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: GCC Patches CC: Marcus Shawcroft , Richard Earnshaw Subject: [PATCH][AArch64] Use __aarch64_vget_lane* macros for getting the lane in some lane multiply intrinsics X-MC-Unique: 114090811290402201 X-IsSubscribed: yes Hi all, The included testcase currently ICEs at -O0 because vget_lane_f64 is a function, so if it's properly called with a constant argument but without constant propagation it will not be recognised as constant, causing an ICE. This patch changes it to use the macro version directly. I think there is work being done to fix this issue up as part of a more general rework, but until that comes this patch implements the concerned intrinsics using the __aarch64_vget_lane* macros like the other lane intrinsics around them. Tested aarch64-none-elf. Ok for trunk? Thanks, Kyrill 2014-09-08 Kyrylo Tkachov * config/aarch64/arm_neon.h (vmuld_lane_f64): Use macro for getting the lane. (vmuld_laneq_f64): Likewise. (vmuls_lane_f32): Likewise. (vmuls_laneq_f32): Likewise. 2014-09-08 Kyrylo Tkachov * gcc.target/aarch64/simd/vmul_lane_const_lane_1.c: New test. diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 0a86172..cf2b0b6 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -18970,13 +18970,13 @@ vmul_lane_u32 (uint32x2_t __a, uint32x2_t __b, const int __lane) __extension__ static __inline float64_t __attribute__ ((__always_inline__)) vmuld_lane_f64 (float64_t __a, float64x1_t __b, const int __lane) { - return __a * vget_lane_f64 (__b, __lane); + return __a * __aarch64_vget_lane_f64 (__b, __lane); } __extension__ static __inline float64_t __attribute__ ((__always_inline__)) vmuld_laneq_f64 (float64_t __a, float64x2_t __b, const int __lane) { - return __a * vgetq_lane_f64 (__b, __lane); + return __a * __aarch64_vgetq_lane_f64 (__b, __lane); } /* vmuls_lane */ @@ -18984,13 +18984,13 @@ vmuld_laneq_f64 (float64_t __a, float64x2_t __b, const int __lane) __extension__ static __inline float32_t __attribute__ ((__always_inline__)) vmuls_lane_f32 (float32_t __a, float32x2_t __b, const int __lane) { - return __a * vget_lane_f32 (__b, __lane); + return __a * __aarch64_vget_lane_f32 (__b, __lane); } __extension__ static __inline float32_t __attribute__ ((__always_inline__)) vmuls_laneq_f32 (float32_t __a, float32x4_t __b, const int __lane) { - return __a * vgetq_lane_f32 (__b, __lane); + return __a * __aarch64_vgetq_lane_f32 (__b, __lane); } /* vmul_laneq */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vmul_lane_const_lane_1.c b/gcc/testsuite/gcc.target/aarch64/simd/vmul_lane_const_lane_1.c new file mode 100644 index 0000000..2455181 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vmul_lane_const_lane_1.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +#include "arm_neon.h" + +float64_t +wrap_vmuld_lane_f64 (float64_t a, float64x1_t b) +{ + return vmuld_lane_f64 (a, b, 0); +} + +float64_t +wrap_vmuld_laneq_f64 (float64_t a, float64x2_t b) +{ + return vmuld_laneq_f64 (a, b, 0); +} + +float32_t +wrap_vmuls_lane_f32 (float32_t a, float32x2_t b) +{ + return vmuls_lane_f32 (a, b, 0); +} + +float32_t +wrap_vmuls_laneq_f32 (float32_t a, float32x4_t b) +{ + return vmuls_laneq_f32 (a, b, 0); +}