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 F40AF3938C36 for ; Mon, 9 Aug 2021 20:25:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F40AF3938C36 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 179KJhGD090942; Mon, 9 Aug 2021 16:25:29 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 3abb8x84h9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Aug 2021 16:25:28 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 179KOXKH016126; Mon, 9 Aug 2021 20:25:27 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma01dal.us.ibm.com with ESMTP id 3ab3y7mspa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Aug 2021 20:25:19 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 179KO6ae45482416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Aug 2021 20:24:06 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F5276E065; Mon, 9 Aug 2021 20:24:06 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 213716E05F; Mon, 9 Aug 2021 20:24:06 +0000 (GMT) Received: from localhost (unknown [9.65.70.190]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 9 Aug 2021 20:24:05 +0000 (GMT) From: "Paul A. Clarke" To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org Subject: [PATCH 3/6] rs6000: Simplify some SSE4.1 "test" intrinsics Date: Mon, 9 Aug 2021 15:23:52 -0500 Message-Id: <20210809202355.568303-4-pc@us.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210809202355.568303-1-pc@us.ibm.com> References: <20210809202355.568303-1-pc@us.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: X0s592mflWEK1X80oh7TE-hLlwF9-VhB X-Proofpoint-ORIG-GUID: X0s592mflWEK1X80oh7TE-hLlwF9-VhB X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-09_07:2021-08-06, 2021-08-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 phishscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108090143 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, 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, 09 Aug 2021 20:25:31 -0000 Copy some simple redirections from i386 , for: - _mm_test_all_zeros - _mm_test_all_ones - _mm_test_mix_ones_zeros 2021-08-09 Paul A. Clarke gcc * config/rs6000/smmintrin.h (_mm_test_all_zeros, _mm_test_all_ones, _mm_test_mix_ones_zeros): Replace. --- 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 f7f03d8d7782..5d345e3fd56b 100644 --- a/gcc/config/rs6000/smmintrin.h +++ b/gcc/config/rs6000/smmintrin.h @@ -385,34 +385,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)) __inline __m128i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -- 2.27.0