From patchwork Fri Oct 19 21:22:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 987047 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-487914-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="nYXm7TPA"; 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 42cJmh34jrz9sDX for ; Sat, 20 Oct 2018 08:23:14 +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=cyOnn igolj3c5OgFP9wCQoruESxMhCimYND+ice7f7gHtCLyoP5b1PX5BpLU0/i9/nkj4 Ukp50tFdKai/xZpQVI6XBr6x8IIL0upHn6q07criEySK51tnDy+37cQNeXj/ZePu nBG94aVOTJqsXYBYam27BIUYJkShMCVONRWlEs= 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=Fc9Sz8OyD3r juv+x87L8sEt6ebo=; b=nYXm7TPA/ZhSxFPy8nV+xL6dxD3k6kTC4aHEmFHrFmJ 8W4bRJPg2DYV0NuEasNwD6dQYk2hJDCt60SJ5HUTQH7tL0+0m1oQMxarX8knn/fQ r87Fn1PcO8Fj+wRBdrvWnvgUaOw+ohu69hpLNYaTicEAbYXry7/W5eOedaGWgZGw = Received: (qmail 54779 invoked by alias); 19 Oct 2018 21:23:07 -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 54761 invoked by uid 89); 19 Oct 2018 21:23:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*wschmidt, emmintrin.h, xmmintrinh, UD:xmmintrin.h 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; Fri, 19 Oct 2018 21:23:04 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9JLJ0Hd055746 for ; Fri, 19 Oct 2018 17:23:02 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2n7kb8913r-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Oct 2018 17:23:02 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Oct 2018 15:23:01 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 19 Oct 2018 15:22:58 -0600 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9JLMwpt48824550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Oct 2018 14:22:58 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F20586A047; Fri, 19 Oct 2018 21:22:57 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 968DD6A04D; Fri, 19 Oct 2018 21:22:57 +0000 (GMT) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.17]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 19 Oct 2018 21:22:57 +0000 (GMT) To: GCC Patches Cc: Segher Boessenkool From: Bill Schmidt Subject: [PATCH, rs6000] Don't use __vector __m64 for compatibility reasons Date: Fri, 19 Oct 2018 16:22:56 -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: 18101921-0016-0000-0000-00000945C1F7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009903; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01105101; UDB=6.00572152; IPR=6.00885151; MB=3.00023828; MTD=3.00000008; XFM=3.00000015; UTC=2018-10-19 21:23:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18101921-0017-0000-0000-000040C4C2D3 Message-Id: <4c1cc0c7-7584-0b50-0145-e9d4e0b14807@linux.ibm.com> Hi, For historical reasons, there are different interpretations of whether a type "__vector " is allowed when is a typedef. For maximum compatibility between compilers, this patch removes some such cases from the x86 intrinsic compatibility headers. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this okay for trunk? Thanks! Bill 2018-10-19 Bill Schmidt Jinsong Ji * config/rs6000/emmintrin.h (_mm_movemask_pd): Replace __vector __m64 with __vector unsigned long long for compatibility. (_mm_movemask_epi8): Likewise. * config/rs6000/xmmintrin.h (_mm_cvtps_pi32): Likewise. (_mm_cvttps_pi32): Likewise. (_mm_cvtpi32_ps): Likewise. (_mm_cvtps_pi16): Likewise. (_mm_loadh_pi): Likewise. (_mm_storeh_pi): Likewise. (_mm_movehl_ps): Likewise. (_mm_movelh_ps): Likewise. (_mm_loadl_pi): Likewise. (_mm_storel_pi): Likewise. (_mm_movemask_ps): Likewise. (_mm_shuffle_pi16): Likewise. Index: gcc/config/rs6000/emmintrin.h =================================================================== --- gcc/config/rs6000/emmintrin.h (revision 265318) +++ gcc/config/rs6000/emmintrin.h (working copy) @@ -1228,7 +1228,7 @@ _mm_loadl_pd (__m128d __A, double const *__B) extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movemask_pd (__m128d __A) { - __vector __m64 result; + __vector unsigned long long result; static const __vector unsigned int perm_mask = { #ifdef __LITTLE_ENDIAN__ @@ -1238,8 +1238,9 @@ _mm_movemask_pd (__m128d __A) #endif }; - result = (__vector __m64) vec_vbpermq ((__vector unsigned char) __A, - (__vector unsigned char) perm_mask); + result = ((__vector unsigned long long) + vec_vbpermq ((__vector unsigned char) __A, + (__vector unsigned char) perm_mask)); #ifdef __LITTLE_ENDIAN__ return result[1]; @@ -2012,7 +2013,7 @@ _mm_min_epu8 (__m128i __A, __m128i __B) extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movemask_epi8 (__m128i __A) { - __vector __m64 result; + __vector unsigned long long result; static const __vector unsigned char perm_mask = { #ifdef __LITTLE_ENDIAN__ @@ -2024,8 +2025,9 @@ _mm_movemask_epi8 (__m128i __A) #endif }; - result = (__vector __m64) vec_vbpermq ((__vector unsigned char) __A, - (__vector unsigned char) perm_mask); + result = ((__vector unsigned long long) + vec_vbpermq ((__vector unsigned char) __A, + (__vector unsigned char) perm_mask)); #ifdef __LITTLE_ENDIAN__ return result[1]; Index: gcc/config/rs6000/xmmintrin.h =================================================================== --- gcc/config/rs6000/xmmintrin.h (revision 265318) +++ gcc/config/rs6000/xmmintrin.h (working copy) @@ -985,12 +985,12 @@ _mm_cvtps_pi32 (__m128 __A) { /* Splat two lower SPFP values to both halves. */ __v4sf temp, rounded; - __vector __m64 result; + __vector unsigned long long result; /* Splat two lower SPFP values to both halves. */ temp = (__v4sf) vec_splat ((__vector long long)__A, 0); rounded = vec_rint(temp); - result = (__vector __m64) vec_cts (rounded, 0); + result = (__vector unsigned long long) vec_cts (rounded, 0); return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)result, 0)); } @@ -1043,11 +1043,11 @@ extern __inline __m64 __attribute__((__gnu_inline_ _mm_cvttps_pi32 (__m128 __A) { __v4sf temp; - __vector __m64 result; + __vector unsigned long long result; /* Splat two lower SPFP values to both halves. */ temp = (__v4sf) vec_splat ((__vector long long)__A, 0); - result = (__vector __m64) vec_cts (temp, 0); + result = (__vector unsigned long long) vec_cts (temp, 0); return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)result, 0)); } @@ -1103,8 +1103,9 @@ _mm_cvtpi32_ps (__m128 __A, __m64 __ vm1 = (__vector signed int) __builtin_pack_vector_int128 (__B, __B); vf1 = (__vector float) vec_ctf (vm1, 0); - return ((__m128) (__vector __m64) - { ((__vector __m64)vf1) [0], ((__vector __m64)__A) [1]}); + return ((__m128) (__vector unsigned long long) + { ((__vector unsigned long long)vf1) [0], + ((__vector unsigned long long)__A) [1]}); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -1201,11 +1202,11 @@ _mm_cvtps_pi16(__m128 __A) { __v4sf rounded; __vector signed int temp; - __vector __m64 result; + __vector unsigned long long result; rounded = vec_rint(__A); temp = vec_cts (rounded, 0); - result = (__vector __m64) vec_pack (temp, temp); + result = (__vector unsigned long long) vec_pack (temp, temp); return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)result, 0)); } @@ -1282,8 +1283,8 @@ _mm_unpacklo_ps (__m128 __A, __m128 __B) extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadh_pi (__m128 __A, __m64 const *__P) { - __vector __m64 __a = (__vector __m64)__A; - __vector __m64 __p = vec_splats(*__P); + __vector unsigned long long __a = (__vector unsigned long long)__A; + __vector unsigned long long __p = vec_splats(*__P); __a [1] = __p [1]; return (__m128)__a; @@ -1293,7 +1294,7 @@ _mm_loadh_pi (__m128 __A, __m64 const *__P) extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storeh_pi (__m64 *__P, __m128 __A) { - __vector __m64 __a = (__vector __m64) __A; + __vector unsigned long long __a = (__vector unsigned long long) __A; *__P = __a[1]; } @@ -1302,7 +1303,8 @@ _mm_storeh_pi (__m64 *__P, __m128 __A) extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movehl_ps (__m128 __A, __m128 __B) { - return (__m128) vec_mergel ((__vector __m64)__B, (__vector __m64)__A); + return (__m128) vec_mergel ((__vector unsigned long long)__B, + (__vector unsigned long long)__A); } /* Moves the lower two values of B into the upper two values of A. */ @@ -1309,7 +1311,8 @@ _mm_movehl_ps (__m128 __A, __m128 __B) extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movelh_ps (__m128 __A, __m128 __B) { - return (__m128) vec_mergeh ((__vector __m64)__A, (__vector __m64)__B); + return (__m128) vec_mergeh ((__vector unsigned long long)__A, + (__vector unsigned long long)__B); } /* Sets the lower two SPFP values with 64-bits of data loaded from P; @@ -1317,8 +1320,8 @@ _mm_movelh_ps (__m128 __A, __m128 __B) extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_loadl_pi (__m128 __A, __m64 const *__P) { - __vector __m64 __a = (__vector __m64)__A; - __vector __m64 __p = vec_splats(*__P); + __vector unsigned long long __a = (__vector unsigned long long)__A; + __vector unsigned long long __p = vec_splats(*__P); __a [0] = __p [0]; return (__m128)__a; @@ -1328,7 +1331,7 @@ _mm_loadl_pi (__m128 __A, __m64 const *__P) extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_storel_pi (__m64 *__P, __m128 __A) { - __vector __m64 __a = (__vector __m64) __A; + __vector unsigned long long __a = (__vector unsigned long long) __A; *__P = __a[0]; } @@ -1340,7 +1343,7 @@ _mm_storel_pi (__m64 *__P, __m128 __A) extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movemask_ps (__m128 __A) { - __vector __m64 result; + __vector unsigned long long result; static const __vector unsigned int perm_mask = { #ifdef __LITTLE_ENDIAN__ @@ -1350,8 +1353,9 @@ _mm_movemask_ps (__m128 __A) #endif }; - result = (__vector __m64) vec_vbpermq ((__vector unsigned char) __A, - (__vector unsigned char) perm_mask); + result = ((__vector unsigned long long) + vec_vbpermq ((__vector unsigned char) __A, + (__vector unsigned char) perm_mask)); #ifdef __LITTLE_ENDIAN__ return result[1]; @@ -1619,7 +1623,7 @@ _mm_shuffle_pi16 (__m64 __A, int const __N) #endif }; __m64_union t; - __vector __m64 a, p, r; + __vector unsigned long long a, p, r; #ifdef __LITTLE_ENDIAN__ t.as_short[0] = permute_selectors[element_selector_10];