From patchwork Thu Oct 25 00:55:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 988855 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-488252-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="WWdetEdk"; 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 42gTFr70rXz9sBk for ; Thu, 25 Oct 2018 11:56:00 +1100 (AEDT) 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:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=OWsmt FDaAwROQuLkOVnaHXnkgT+50GCvZHjCLaoz3oMVBlwJ9VOx/MsSlUTdWk3YBV4xa /fYNi201QxdOMMOJXPHtfyPlvlRlK5hRcb4v/VbxP5Z69pJq2rwj+/KoAKKHgz6e P4s/Ce9CeDh8KTauxV5dBiXhsomhMPWEhlilE8= 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:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=9iAV/k0m1al VN876Ex1n+thKOSI=; b=WWdetEdkz2hXJQoTSut+OaZPE4xLX2esURm1cT77ocf QT5ebdWakQ+hb18wM3bnuOsGpmLRJ2kiiZ5OVzJ9c9i1jolDaVqYX5rEVlwDHGwQ vgipRg53gOR+8LtY5oX2EWOe+fCzA/GeBM0WTswUV9lG5gX5G/xDqEtb/XECcjAI = Received: (qmail 86502 invoked by alias); 25 Oct 2018 00:55:52 -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 86337 invoked by uid 89); 25 Oct 2018 00:55:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=__v2di X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Oct 2018 00:55:50 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9P0nVAx010840 for ; Wed, 24 Oct 2018 20:55:48 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2nay889nbn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 24 Oct 2018 20:55:48 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Oct 2018 18:55:47 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 24 Oct 2018 18:55:45 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9P0tjPX15663214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Oct 2018 00:55:45 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E4168C6057; Thu, 25 Oct 2018 00:55:44 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0EA7C605D; Thu, 25 Oct 2018 00:55:44 +0000 (GMT) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.17]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 25 Oct 2018 00:55:44 +0000 (GMT) To: GCC Patches Cc: Segher Boessenkool From: Bill Schmidt Subject: [PATCH, rs6000] Don't use deprecated vector shift instructions Date: Wed, 24 Oct 2018 19:55:44 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 x-cbid: 18102500-0020-0000-0000-00000E7F0BAD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009929; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01107532; UDB=6.00573630; IPR=6.00887617; MB=3.00023896; MTD=3.00000008; XFM=3.00000015; UTC=2018-10-25 00:55:47 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18102500-0021-0000-0000-0000637D69B1 Message-Id: <1e7569e5-78d1-6349-9c04-c23ec9d6081e@linux.ibm.com> Hi, The intrinsic compatibility headers make use of some deprecated functions for vector shifts, which are not available in some compilers. For compatibility reasons, this patch, replaces those with intrinsics guaranteed to be portable. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this okay for trunk? Thanks, Bill 2018-10-24 Bill Schmidt Jinsong Ji * config/rs6000/emmintrin.h (_mm_slli_epi16): Replace deprecated function with vec_sl. (_mm_slli_epi32): Likewise. (_mm_slli_epi64): Likewise. (_mm_srai_epi16): Replace deprecated function with vec_sra. (_mm_srai_epi32): Likewise. (_mm_srli_epi16): Replace deprecated function with vec_sr. (_mm_srli_epi32): Likewise. (_mm_srli_epi64): Likewise. (_mm_sll_epi16): Replace deprecated function with vec_sl. (_mm_sll_epi32): Likewise. (_mm_sll_epi64): Likewise. (_mm_sra_epi16): Replace deprecated function with vec_sra. (_mm_sra_epi32): Likewise. (_mm_srl_epi16): Replace deprecated function with vec_sr. (_mm_srl_epi32): Likewise. (_mm_srl_epi64): Likewise. Index: gcc/config/rs6000/emmintrin.h =================================================================== --- gcc/config/rs6000/emmintrin.h (revision 265464) +++ gcc/config/rs6000/emmintrin.h (working copy) @@ -1504,7 +1504,7 @@ _mm_slli_epi16 (__m128i __A, int __B) else lshift = vec_splats ((unsigned short) __B); - result = vec_vslh ((__v8hi) __A, lshift); + result = vec_sl ((__v8hi) __A, lshift); } return (__m128i) result; @@ -1523,7 +1523,7 @@ _mm_slli_epi32 (__m128i __A, int __B) else lshift = vec_splats ((unsigned int) __B); - result = vec_vslw ((__v4si) __A, lshift); + result = vec_sl ((__v4si) __A, lshift); } return (__m128i) result; @@ -1543,7 +1543,7 @@ _mm_slli_epi64 (__m128i __A, int __B) else lshift = (__v2du) vec_splats ((unsigned int) __B); - result = vec_vsld ((__v2di) __A, lshift); + result = vec_sl ((__v2di) __A, lshift); } return (__m128i) result; @@ -1563,7 +1563,7 @@ _mm_srai_epi16 (__m128i __A, int __B) else rshift = vec_splats ((unsigned short) __B); } - result = vec_vsrah ((__v8hi) __A, rshift); + result = vec_sra ((__v8hi) __A, rshift); return (__m128i) result; } @@ -1586,7 +1586,7 @@ _mm_srai_epi32 (__m128i __A, int __B) else rshift = vec_splats ((unsigned int) __B); } - result = vec_vsraw ((__v4si) __A, rshift); + result = vec_sra ((__v4si) __A, rshift); return (__m128i) result; } @@ -1666,7 +1666,7 @@ _mm_srli_epi16 (__m128i __A, int __B) else rshift = vec_splats ((unsigned short) __B); - result = vec_vsrh ((__v8hi) __A, rshift); + result = vec_sr ((__v8hi) __A, rshift); } return (__m128i) result; @@ -1690,7 +1690,7 @@ _mm_srli_epi32 (__m128i __A, int __B) else rshift = vec_splats ((unsigned int) __B); - result = vec_vsrw ((__v4si) __A, rshift); + result = vec_sr ((__v4si) __A, rshift); } return (__m128i) result; @@ -1715,7 +1715,7 @@ _mm_srli_epi64 (__m128i __A, int __B) else rshift = (__v2du) vec_splats ((unsigned int) __B); - result = vec_vsrd ((__v2di) __A, rshift); + result = vec_sr ((__v2di) __A, rshift); } return (__m128i) result; @@ -1735,7 +1735,7 @@ _mm_sll_epi16 (__m128i __A, __m128i __B) lshift = vec_splat ((__v8hu)__B, 3); #endif shmask = lshift <= shmax; - result = vec_vslh ((__v8hu) __A, lshift); + result = vec_sl ((__v8hu) __A, lshift); result = vec_sel (shmask, result, shmask); return (__m128i) result; @@ -1753,7 +1753,7 @@ _mm_sll_epi32 (__m128i __A, __m128i __B) lshift = vec_splat ((__v4su)__B, 1); #endif shmask = lshift < shmax; - result = vec_vslw ((__v4su) __A, lshift); + result = vec_sl ((__v4su) __A, lshift); result = vec_sel (shmask, result, shmask); return (__m128i) result; @@ -1769,7 +1769,7 @@ _mm_sll_epi64 (__m128i __A, __m128i __B) lshift = (__v2du) vec_splat ((__v2du)__B, 0); shmask = lshift < shmax; - result = vec_vsld ((__v2du) __A, lshift); + result = vec_sl ((__v2du) __A, lshift); result = (__v2du) vec_sel ((__v2df) shmask, (__v2df) result, (__v2df) shmask); @@ -1790,7 +1790,7 @@ _mm_sra_epi16 (__m128i __A, __m128i __B) rshift = vec_splat ((__v8hu)__B, 3); #endif rshift = vec_min (rshift, rshmax); - result = vec_vsrah ((__v8hi) __A, rshift); + result = vec_sra ((__v8hi) __A, rshift); return (__m128i) result; } @@ -1808,7 +1808,7 @@ _mm_sra_epi32 (__m128i __A, __m128i __B) rshift = vec_splat ((__v4su)__B, 1); #endif rshift = vec_min (rshift, rshmax); - result = vec_vsraw ((__v4si) __A, rshift); + result = vec_sra ((__v4si) __A, rshift); return (__m128i) result; } @@ -1826,7 +1826,7 @@ _mm_srl_epi16 (__m128i __A, __m128i __B) rshift = vec_splat ((__v8hu)__B, 3); #endif shmask = rshift <= shmax; - result = vec_vsrh ((__v8hu) __A, rshift); + result = vec_sr ((__v8hu) __A, rshift); result = vec_sel (shmask, result, shmask); return (__m128i) result; @@ -1845,7 +1845,7 @@ _mm_srl_epi32 (__m128i __A, __m128i __B) rshift = vec_splat ((__v4su)__B, 1); #endif shmask = rshift < shmax; - result = vec_vsrw ((__v4su) __A, rshift); + result = vec_sr ((__v4su) __A, rshift); result = vec_sel (shmask, result, shmask); return (__m128i) result; @@ -1861,7 +1861,7 @@ _mm_srl_epi64 (__m128i __A, __m128i __B) rshift = (__v2du) vec_splat ((__v2du)__B, 0); shmask = rshift < shmax; - result = vec_vsrd ((__v2du) __A, rshift); + result = vec_sr ((__v2du) __A, rshift); result = (__v2du)vec_sel ((__v2du)shmask, (__v2du)result, (__v2du)shmask); return (__m128i) result;