From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 4C8953858D1E for ; Tue, 20 Jun 2023 03:03:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C8953858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35K2HRtW020518; Tue, 20 Jun 2023 03:03:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=C9EjKx8D93wop1IhRH+mR1lIApIEtP8OzYGcc5/7/g4=; b=Isvy9+5o04Sj/YKtyclT8Q1f0FnVpDxMF782x/AEstsIy4CjqMjDu525GHnFtFVMtVuA wi9PHaDz+ZUub1HEhiZJEtqHmq29pH8P8/YG8HGqBXJTNiRWPT02CCjwnGD9ZElBcZLU R4cUCfpyXu5wkcOcddvOAWw+kQqlsc2hMD5TKUOVHxyoStmN00M0Q5OTBWz7E00P/vfy 3GjU6UHj+/1gmVL4nm6zrvsUka6Cc8/qPrB2EFeNK821Wr+BxfBO8ETmOj9htQ8hopfJ mSl259R5r/QP2i0Zkh6J37WcSNrzdp6caZgpjQnPdGBIIRseY7MAPWPyeRr70nKnJ+Xo fg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rb36jgq1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jun 2023 03:03:21 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35K2aVYB003451; Tue, 20 Jun 2023 03:03:21 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rb36jgq17-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jun 2023 03:03:20 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35K1qW0o016820; Tue, 20 Jun 2023 03:03:19 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3r94f51arq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jun 2023 03:03:18 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35K33GK322872682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Jun 2023 03:03:16 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9900520043; Tue, 20 Jun 2023 03:03:16 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B5A3120040; Tue, 20 Jun 2023 03:03:14 +0000 (GMT) Received: from [9.197.252.125] (unknown [9.197.252.125]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 20 Jun 2023 03:03:14 +0000 (GMT) Message-ID: <106a609a-b229-b83c-ea6e-8d5f5f47ad68@linux.ibm.com> Date: Tue, 20 Jun 2023 11:03:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH ver 6] rs6000: Add builtins for IEEE 128-bit floating point values Content-Language: en-US To: Carl Love Cc: Peter Bergner , dje.gcc@gmail.com, gcc-patches@gcc.gnu.org, Segher Boessenkool References: <35552b6539d3469d7f74dbd9ec75061515a1d61c.camel@us.ibm.com> From: "Kewen.Lin" In-Reply-To: <35552b6539d3469d7f74dbd9ec75061515a1d61c.camel@us.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 2yNk5nLrGDsuECUgNcuvVJUBv4mZiyCF X-Proofpoint-ORIG-GUID: FL6M68IpABQa0Di7mHtm3BSe6slXJf2J X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-19_15,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 mlxlogscore=999 adultscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306200026 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Carl, on 2023/6/20 02:54, Carl Love wrote: > > Kewen, GCC maintainers: > > Version 6, Fixed missing change log entry. Changed builtin id names as > requested. Missed making the change on the last version. Fixed > comment in the three test cases. Reran regression suite on Power 10, > no regressions. > > Version 5, Tested the patch on P9 BE per request. Fixed up test case > to get the correct expected values for BE and LE. Fixed typos. > Updated the doc/extend.texi to clarify the vector arguments. Changed > test file names per request. Moved builtin defs next to related > definitions. Renamed new mode_attr. Removed new mode_iterator, used > existing iterator instead. Renamed mode_iterator VSEEQP_DI to V2DI_DI. > Fixed up overloaded definitions per request. > > Version 4, added missing cases for new xxexpqp, xsxexpdp and xsxsigqp > cases to rs6000_expand_builtin. Merged the new define_insn definitions > with the existing definitions. Renamed the builtins by removing the > __builtin_ prefix from the names. Fixed the documentation for the > builtins. Updated the test files to check the desired instructions > were generated. Retested patch on Power 10 with no regressions. > > Version 3, was able to get the overloaded version of scalar_insert_exp > to work and the change to xsxexpqp_f128_ define instruction to > work with the suggestions from Kewen. > > Version 2, I have addressed the various comments from Kewen. I had > issues with adding an additional overloaded version of > scalar_insert_exp with vector arguments. The overload infrastructure > didn't work with a mix of scalar and vector arguments. I did rename > the __builtin_insertf128_exp to __builtin_vsx_scalar_insert_exp_qp make > it similar to the existing builtin. I also wasn't able to get the > suggested merge of xsxexpqp_f128_ with xsxexpqp_ to work so > I left the two simpler definitiions. > > The patch add three new builtins to extract the significand and > exponent of an IEEE float 128-bit value where the builtin argument is a > vector. Additionally, a builtin to insert the exponent into an IEEE > float 128-bit vector argument is added. These builtins were requested > since there is no clean and optimal way to transfer between a vector > and a scalar IEEE 128 bit value. > > The patch has been tested on Power 9 BE and Power 10 LE with no > regressions. Please let me know if the patch is acceptable or not. > Thanks. OK for trunk with some nits fixed in changelog (sorry that I didn't catch all of them in previous review, but I don't think you need to post a new version). Thanks! > > Carl > > -------------------------------------------- > rs6000: Add builtins for IEEE 128-bit floating point values > > Add support for the following builtins: > > __vector unsigned long long int scalar_extract_exp_to_vec (__ieee128); > __vector unsigned __int128 scalar_extract_sig_to_vec (__ieee128); > __ieee128 scalar_insert_exp (__vector unsigned __int128, > __vector unsigned long long); > > The instructions used in the builtins operate on vector registers. Thus > the result must be moved to a scalar type. There is no clean, performant > way to do this. The user code typically needs the result as a vector > anyway. > > gcc/ > * config/rs6000/rs6000-builtin.cc (rs6000_expand_builtin): > Rename CCDE_FOR_xsxexpqp_tf to CODE_FOR_xsxexpqp_tf_di. > Rename CODE_FOR_xsxexpqp_kf to CODE_FOR_xsxexpqp_kf_di. Miss "Rename CODE_FOR_xsxsigqp_tf to CODE_FOR_xsxsigqp_tf_ti." "Rename CODE_FOR_xsxsigqp_kf to CODE_FOR_xsxsigqp_kf_ti." "Rename CODE_FOR_xsiexpqp_tf to CODE_FOR_xsiexpqp_tf_di." "Rename CODE_FOR_xsiexpqp_kf to CODE_FOR_xsiexpqp_kf_di." > (CODE_FOR_xsxexpqp_kf_v2di, CODE_FOR_xsxsigqp_kf_v1ti, > CODE_FOR_xsiexpqp_kf_v2di): Add case statements. > * config/rs6000/rs6000-buildin.def (__builtin_extractf128_exp, > __builtin_extractf128_sig, __builtin_insertf128_exp): Add new > builtin definitions. Should be with correct names: (__builtin_vsx_scalar_extract_exp_to_vec, __builtin_vsx_scalar_extract_sig_to_vec, __builtin_vsx_scalar_insert_exp_vqp): > Rename xsxexpqp_kf, xsxsigqp_kf, xsiexpqp_kf to xsexpqp_kf_di, > xsxsigqp_kf_ti, xsiexpqp_kf_di respectively. > * config/rs6000/rs6000-c.cc (altivec_resolve_overloaded_builtin): > Update case RS6000_OVLD_VEC_VSIE to handle MODE_VECTOR_INT for new > overloaded instance. Update comments. > * config/rs6000/rs6000-overload.def > (__builtin_vec_scalar_insert_exp): Add new overload definition with > vector arguments. > (scalar_extract_exp_to_vec, scalar_extract_sig_to_vec): New > overloaded definitions. > * config/vsx.md (V2DI_DI): New mode iterator. > (DI_to_TI): New mode attribute. > Rename xsxexpqp_ to sxexpqp__. > Rename xsxsigqp_ to xsxsigqp__. > Rename xsiexpqp_ to xsiexpqp__. > * doc/extend.texi (__builtin_extractf128_exp, > __builtin_extractf128_sig): Add documentation for new builtins. Should be with correct names: (scalar_extract_exp_to_vec, scalar_extract_sig_to_vec): BR, Kewen