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 1E30C3858C3A for ; Tue, 12 Oct 2021 01:47:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E30C3858C3A Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19BMfuEY026460; Mon, 11 Oct 2021 21:47:51 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3bmx9pamn8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Oct 2021 21:47:51 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19C1ais5030351; Tue, 12 Oct 2021 01:47:50 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02dal.us.ibm.com with ESMTP id 3bk2qauhsp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Oct 2021 01:47:50 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19C1ln9r46727434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Oct 2021 01:47:49 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E77316E058; Tue, 12 Oct 2021 01:47:48 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 544FE6E054; Tue, 12 Oct 2021 01:47:48 +0000 (GMT) Received: from li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com (unknown [9.160.31.192]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTPS; Tue, 12 Oct 2021 01:47:48 +0000 (GMT) Date: Mon, 11 Oct 2021 20:47:46 -0500 From: "Paul A. Clarke" To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org, wschmidt@linux.ibm.com Subject: Re: [COMMITTED v4 3/6] rs6000: Simplify some SSE4.1 "test" intrinsics Message-ID: <20211012014746.GJ243632@li-24c3614c-2adc-11b2-a85c-85f334518bdb.ibm.com> References: <20210823190310.1679905-1-pc@us.ibm.com> <20210823190310.1679905-4-pc@us.ibm.com> <20211011205031.GB10333@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211011205031.GB10333@gate.crashing.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ciw7qNdLlF5pxS69apwZJsfJM364DQ-k X-Proofpoint-ORIG-GUID: ciw7qNdLlF5pxS69apwZJsfJM364DQ-k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-11_11,2021-10-11_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 impostorscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110120004 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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: Tue, 12 Oct 2021 01:47:54 -0000 On Mon, Oct 11, 2021 at 03:50:31PM -0500, Segher Boessenkool wrote: > On Mon, Aug 23, 2021 at 02:03:07PM -0500, Paul A. Clarke wrote: > > gcc > > * config/rs6000/smmintrin.h (_mm_test_all_zeros, > > _mm_test_all_ones, _mm_test_mix_ones_zeros): Replace. > > "Replace" does not say what it is replaced with. "Rewrite" maybe? > > Okay for trunk either way. Thanks! This was committed: Copy some simple redirections from i386 , for: - _mm_test_all_zeros - _mm_test_all_ones - _mm_test_mix_ones_zeros 2021-10-11 Paul A. Clarke gcc * config/rs6000/smmintrin.h (_mm_test_all_zeros, _mm_test_all_ones, _mm_test_mix_ones_zeros): Rewrite as macro. -- v4: tweak commit message. diff --git a/gcc/config/rs6000/smmintrin.h b/gcc/config/rs6000/smmintrin.h index af782079cbcb..f935ab060abc 100644 --- a/gcc/config/rs6000/smmintrin.h +++ b/gcc/config/rs6000/smmintrin.h @@ -203,34 +203,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 __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))