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 D80D13858CDB for ; Mon, 28 Aug 2023 09:19:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D80D13858CDB 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 (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37S8aBRX019877; Mon, 28 Aug 2023 09:19:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=S609txQVvC7WlZIrPDOuuJwmtYgCcgRHi83t5ARj9Ko=; b=SDEkgykKxMwFKxpuGNSdZvQZNuEatys8ZUYO1rKvMlN003qpvDh1YFn+8TntIL+VQEu9 V6+swM90UUaIY3tuaOY17vsEx/8Aab9PBbHDyPuInsLeqvUuOJS4dbpNhGlOPBsNtBjD b7EFKs/eJZIgipmQo4HXI8dz80+RCHYGsToFTn4a2nfVzZcfVuKcaSFfqL/09WHSNnq/ jAawp+hndrPFOXob5LHf2YfLi9MjJdC8e9EGCLjCIr+AyARhvkWFMO1bJxqSP/JXsmer asx42jBVBa5xbwDSDlcqBrdYCpfTifNkTJdhZulr0GzOxQbUtUfR/pmw82agnP4BoZzf fQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sr8s681k9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 09:19:57 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 37S8skQV022584; Mon, 28 Aug 2023 09:19:57 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sr8s681k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 09:19:57 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 37S8KAoI014209; Mon, 28 Aug 2023 09:19:56 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3sqwxjh47v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 09:19:56 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 37S9JrSW24380010 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Aug 2023 09:19:53 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2CCC920040; Mon, 28 Aug 2023 09:19:53 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0828420043; Mon, 28 Aug 2023 09:19:51 +0000 (GMT) Received: from [9.197.250.29] (unknown [9.197.250.29]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 28 Aug 2023 09:19:50 +0000 (GMT) Message-ID: <30be66e3-d2a9-0e99-c0a1-579a3f30d7af@linux.ibm.com> Date: Mon, 28 Aug 2023 17:19:49 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH-1, rs6000] Enable SImode in FP register on P7 [PR88558] Content-Language: en-US To: HAO CHEN GUI Cc: Segher Boessenkool , David , Peter Bergner , gcc-patches , Michael Meissner References: <68d731d8-5dda-526b-8dbb-d08bde31d25b@linux.ibm.com> From: "Kewen.Lin" In-Reply-To: <68d731d8-5dda-526b-8dbb-d08bde31d25b@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: VJkQ_IQbEAqDO-gZ0rc8By5mq27Wdbe5 X-Proofpoint-ORIG-GUID: w1B6LYnBdaenKuSb65klg6j-2k_o_66N Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-28_06,2023-08-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308280082 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP 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 Haochen, on 2023/8/25 14:44, HAO CHEN GUI wrote: > Hi, > This patch enables SImode in FP register on P7. Instruction "fctiw" > stores its integer output in an FP register. So SImode in FP register > needs be enabled on P7 if we want support "fctiw" on P7. > It sounds reasonable to support SImode in fpr with lfiwzx and stfiwx supports, I'd like to hear from Segher/David/Mike/Peter on what they think of this. > The test case is in the second patch which implements 32bit inline > lrint. > > Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. > > Thanks > Gui Haochen > > ChangeLog > rs6000: enable SImode in FP register on P7 > > gcc/ > PR target/88558 > * config/rs6000/rs6000.cc (rs6000_hard_regno_mode_ok_uncached): > Enable Simode in FP register for P7. Nit: s/Simode/SImode/ > * config/rs6000/rs6000.md (*movsi_internal1): Add fmr for SImode > move between FP register. Set attribute isa of stfiwx to "*" ... "between FP register", s/register/registers/. > and attribute of stxsiwx to "p7". > > patch.diff > diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc > index 44b448d2ba6..99085c2cdd7 100644 > --- a/gcc/config/rs6000/rs6000.cc > +++ b/gcc/config/rs6000/rs6000.cc > @@ -1903,7 +1903,7 @@ rs6000_hard_regno_mode_ok_uncached (int regno, machine_mode mode) > if(GET_MODE_SIZE (mode) == UNITS_PER_FP_WORD) > return 1; > > - if (TARGET_P8_VECTOR && (mode == SImode)) > + if (TARGET_POPCNTD && mode == SImode) > return 1; > > if (TARGET_P9_VECTOR && (mode == QImode || mode == HImode)) > diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md > index cdab49fbb91..ac5d29a2cf8 100644 > --- a/gcc/config/rs6000/rs6000.md > +++ b/gcc/config/rs6000/rs6000.md > @@ -7566,7 +7566,7 @@ (define_split > > (define_insn "*movsi_internal1" > [(set (match_operand:SI 0 "nonimmediate_operand" > - "=r, r, > + "=r, r, ^d, One justification is needed on why we need this disparaging, I guess you want it prefer xxlor over fmr when the former is supported? There is a related discussion on fmr vs. xxlor, the original thread is: https://gcc.gnu.org/pipermail/gcc-patches/2023-February/612821.html > r, d, v, > m, ?Z, ?Z, > r, r, r, r, > @@ -7575,7 +7575,7 @@ (define_insn "*movsi_internal1" > wa, r, > r, *h, *h") > (match_operand:SI 1 "input_operand" > - "r, U, > + "r, U, ^d, This seems to have the effect that double disparaging on this alternative, it also needs a justification why one time isn't enough. BR, Kewen > m, ?Z, ?Z, > r, d, v, > I, L, eI, n, > @@ -7588,6 +7588,7 @@ (define_insn "*movsi_internal1" > "@ > mr %0,%1 > la %0,%a1 > + fmr %0,%1 > lwz%U1%X1 %0,%1 > lfiwzx %0,%y1 > lxsiwzx %x0,%y1 > @@ -7611,7 +7612,7 @@ (define_insn "*movsi_internal1" > mt%0 %1 > nop" > [(set_attr "type" > - "*, *, > + "*, *, fpsimple, > load, fpload, fpload, > store, fpstore, fpstore, > *, *, *, *, > @@ -7620,7 +7621,7 @@ (define_insn "*movsi_internal1" > mtvsr, mfvsr, > *, *, *") > (set_attr "length" > - "*, *, > + "*, *, *, > *, *, *, > *, *, *, > *, *, *, 8, > @@ -7629,9 +7630,9 @@ (define_insn "*movsi_internal1" > *, *, > *, *, *") > (set_attr "isa" > - "*, *, > - *, p8v, p8v, > - *, p8v, p8v, > + "*, *, *, > + *, p7, p8v, > + *, *, p8v, > *, *, p10, *, > p8v, p9v, p9v, p8v, > p9v, p8v, p9v,