From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 50D9B3858404 for ; Mon, 23 Aug 2021 19:03:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50D9B3858404 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17NIYWMf045076; Mon, 23 Aug 2021 15:03:18 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 3amgjw1djq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Aug 2021 15:03:17 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 17NIvFDl018572; Mon, 23 Aug 2021 19:03:16 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma05wdc.us.ibm.com with ESMTP id 3ajs4b8vjx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Aug 2021 19:03:16 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 17NJ3GFl13828590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Aug 2021 19:03:16 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03CF1B2066; Mon, 23 Aug 2021 19:03:16 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4BE6B2064; Mon, 23 Aug 2021 19:03:15 +0000 (GMT) Received: from localhost (unknown [9.160.136.65]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 23 Aug 2021 19:03:15 +0000 (GMT) From: "Paul A. Clarke" To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org, wschmidt@linux.ibm.com Subject: [PATCH v3 3/6] rs6000: Simplify some SSE4.1 "test" intrinsics Date: Mon, 23 Aug 2021 14:03:07 -0500 Message-Id: <20210823190310.1679905-4-pc@us.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210823190310.1679905-1-pc@us.ibm.com> References: <20210823190310.1679905-1-pc@us.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: AQVp7RfDqyDcLNK5Cz2PyOVYWf3IJiE6 X-Proofpoint-ORIG-GUID: AQVp7RfDqyDcLNK5Cz2PyOVYWf3IJiE6 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-23_04:2021-08-23, 2021-08-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 priorityscore=1501 adultscore=0 phishscore=0 suspectscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 mlxlogscore=890 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108230126 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2021 19:03:21 -0000 Copy some simple redirections from i386 , for: - _mm_test_all_zeros - _mm_test_all_ones - _mm_test_mix_ones_zeros 2021-08-20 Paul A. Clarke gcc * config/rs6000/smmintrin.h (_mm_test_all_zeros, _mm_test_all_ones, _mm_test_mix_ones_zeros): Replace. --- v3: No change. v2: - Removed "-Wno-psabi" from tests as unnecessary, per v1 review. - Noted testing in patch series cover letter. gcc/config/rs6000/smmintrin.h | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/gcc/config/rs6000/smmintrin.h b/gcc/config/rs6000/smmintrin.h index 505fe4ce22a8..363534cb06a2 100644 --- a/gcc/config/rs6000/smmintrin.h +++ b/gcc/config/rs6000/smmintrin.h @@ -379,34 +379,12 @@ _mm_testnzc_si128 (__m128i __A, __m128i __B) return _mm_testz_si128 (__A, __B) == 0 && _mm_testc_si128 (__A, __B) == 0; } -__inline int -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm_test_all_zeros (__m128i __A, __m128i __mask) -{ - const __v16qu __zero = {0}; - return vec_all_eq (vec_and ((__v16qu) __A, (__v16qu) __mask), __zero); -} +#define _mm_test_all_zeros(M, V) _mm_testz_si128 ((M), (V)) -__inline int -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm_test_all_ones (__m128i __A) -{ - const __v16qu __ones = vec_splats ((unsigned char) 0xff); - return vec_all_eq ((__v16qu) __A, __ones); -} +#define _mm_test_all_ones(V) \ + _mm_testc_si128 ((V), _mm_cmpeq_epi32 ((V), (V))) -__inline int -__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm_test_mix_ones_zeros (__m128i __A, __m128i __mask) -{ - const __v16qu __zero = {0}; - const __v16qu __Amasked = vec_and ((__v16qu) __A, (__v16qu) __mask); - const int any_ones = vec_any_ne (__Amasked, __zero); - const __v16qu __notA = vec_nor ((__v16qu) __A, (__v16qu) __A); - const __v16qu __notAmasked = vec_and ((__v16qu) __notA, (__v16qu) __mask); - const int any_zeros = vec_any_ne (__notAmasked, __zero); - return any_ones * any_zeros; -} +#define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128 ((M), (V)) extern __inline __m128i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -- 2.27.0