From patchwork Fri Jul 20 09:37:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Lazar X-Patchwork-Id: 946800 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-481952-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="jnte0pnt"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="minkhRZx"; 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 41X5Qk4WnHz9s3Z for ; Fri, 20 Jul 2018 19:37:49 +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:to:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=cOrM0TTKQ5gsXphc gQbGouyFxjSOpx41cVyk0732BY9Yn+e/kt0jr1N6Wj6gsILgOb0hM0Q0xiOgPSYc xW1cEk/qhY+GxfsMFwsw24gAsz6WggP9Om2a0FFH0fergIinPyugFVYhP56hgG+9 2ZnXN4YhSSxxdV9nTe/dVMQZxek= 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:to:cc :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=Nq3SwyHZS/aj95Vp2eY2zR us8bA=; b=jnte0pnt+X1SDYCwQSOec07w9cu+fXpfQt9PwFZ80pQWtNNmxkJthR adg7ESiOdna38LHrGR2p6PT9XGZk2ZtO5Q3ENb1SaE22STz5jaDEFsqtNVLJq37H AQSt3hoc+xXfJzLN7LX6T62RH/z7T6k5T3KQ0rOXWgXaivWiODBGQ= Received: (qmail 120277 invoked by alias); 20 Jul 2018 09:37:42 -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 120268 invoked by uid 89); 20 Jul 2018 09:37:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=aprofile, sk:arm-neo, a-profile, armneonintrinsicsreferencearchitecturespecification X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr30045.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Jul 2018 09:37:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p44Rk9IEIU8G6RAuu6jshIj4JoA9TQ307TwOTzzMOoE=; b=minkhRZxQCfaccTXJoUpru5wkkwK8YgwXRqi28rG9DOQroLpbyhR3tAqCXsl6AuM9I6Mms0wjjy7V4sXAm+2VFD/xAaMAI7KuG/SQjeoscEimmDzxQBSUduhLXMZTG7/rFbDNeXo32GPbAYYTb83X3Ga14eUipWAAnUc7iTyQgo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vlad.Lazar@arm.com; Received: from [10.2.206.48] (217.140.96.140) by AM5PR0801MB1635.eurprd08.prod.outlook.com (2603:10a6:203:39::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Fri, 20 Jul 2018 09:37:37 +0000 To: "gcc-patches@gcc.gnu.org" Cc: nd@arm.com, Richard Earnshaw , James Greenhalgh From: Vlad Lazar Subject: [PATCH][AArch64] Implement new intrinsics vabsd_s64 and vnegd_s64 Message-ID: Date: Fri, 20 Jul 2018 10:37:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-IsSubscribed: yes Hi, The patch adds implementations for the NEON intrinsics vabsd_s64 and vnegd_s64. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ihi0073/latest/arm-neon-intrinsics-reference-architecture-specification) Bootstrapped and regtested on aarch64-none-linux-gnu and there are no regressions. OK for trunk? Thanks, Vlad gcc/ 2018-07-02 Vlad Lazar * config/aarch64/arm_neon.h (vabsd_s64, vnegd_s64): New. gcc/testsuite/ 2018-07-02 Vlad Lazar * gcc.target/aarch64/scalar_intrinsics.c (test_vabsd_s64, test_vabsd_s64): New. diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 2d18400040f031dfcdaf60269ad484647804e1be..19e22431a85bcd09d0ea759b42b0a52420b6c43c 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -11822,6 +11822,13 @@ vabsq_s64 (int64x2_t __a) return __builtin_aarch64_absv2di (__a); } +__extension__ extern __inline int64_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vabsd_s64 (int64_t __a) +{ + return __builtin_aarch64_absdi (__a); +} + /* vadd */ __extension__ extern __inline int64_t @@ -22907,6 +22914,12 @@ vneg_s64 (int64x1_t __a) return -__a; } +__extension__ extern __inline int64_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vnegd_s64 (int64_t __a) +{ + return -__a; +} __extension__ extern __inline float32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vnegq_f32 (float32x4_t __a) diff --git a/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c b/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c index ea29066e369b967d0781d31c8a5208bda9e4f685..45afeec373971838e0cd107038b4aa51a2d4998f 100644 --- a/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c +++ b/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c @@ -603,6 +603,14 @@ test_vsqaddd_u64 (uint64_t a, int64_t b) return vsqaddd_u64 (a, b); } +/* { dg-final { scan-assembler-times "\\tabs\\td\[0-9\]+" 1 } } */ + +int64_t +test_vabsd_s64 (int64_t a) +{ + return vabsd_s64 (a); +} + /* { dg-final { scan-assembler-times "\\tsqabs\\tb\[0-9\]+" 1 } } */ int8_t @@ -627,6 +635,14 @@ test_vqabss_s32 (int32_t a) return vqabss_s32 (a); } +/* { dg-final { scan-assembler-times "\\tneg\\tx\[0-9\]+" 1 } } */ + +int64_t +test_vnegd_s64 (int64_t a) +{ + return vnegd_s64 (a); +} + /* { dg-final { scan-assembler-times "\\tsqneg\\tb\[0-9\]+" 1 } } */ int8_t