From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 39A943858D28 for ; Tue, 14 Dec 2021 15:17:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 39A943858D28 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BEEl8o3017765; Tue, 14 Dec 2021 15:17:12 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cx9r90f1u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Dec 2021 15:17:12 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BEEltnu024213; Tue, 14 Dec 2021 15:17:12 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cx9r90f1a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Dec 2021 15:17:12 +0000 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 1BEF2D3S011341; Tue, 14 Dec 2021 15:17:11 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma05wdc.us.ibm.com with ESMTP id 3cvkmagu9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Dec 2021 15:17:11 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BEFHAAK51577104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Dec 2021 15:17:10 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F478AC062; Tue, 14 Dec 2021 15:17:10 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A820AC068; Tue, 14 Dec 2021 15:17:09 +0000 (GMT) Received: from [9.211.120.142] (unknown [9.211.120.142]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 14 Dec 2021 15:17:09 +0000 (GMT) Message-ID: Date: Tue, 14 Dec 2021 09:17:08 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Reply-To: wschmidt@linux.ibm.com Subject: Re: [PATCH] rs6000: __builtin_darn[_raw] should be in [power9-64] (PR103624) From: Bill Schmidt To: Segher Boessenkool Cc: David Edelsohn , GCC Patches References: <21f6c411-8aed-6042-2e76-5649ac95d259@linux.ibm.com> <20211213165459.GF614@gate.crashing.org> <6d9f439c-c8a7-605d-e494-b20125837355@linux.ibm.com> <20211214002208.GH614@gate.crashing.org> <1e31830f-073f-6f61-ef3b-54b384b52baf@linux.ibm.com> In-Reply-To: <1e31830f-073f-6f61-ef3b-54b384b52baf@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ocayeLu_ojkVduGXwCt_xoA1nzkMYKUl X-Proofpoint-GUID: NQq6je1qUe11mjRW78dxZu6A8yIb1Kys X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-14_07,2021-12-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 clxscore=1015 spamscore=0 mlxlogscore=833 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112140087 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, 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.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, 14 Dec 2021 15:17:14 -0000 On 12/14/21 7:32 AM, Bill Schmidt wrote: > Hi! > > On 12/13/21 6:22 PM, Segher Boessenkool wrote: >> >> These builtins should just return a "long", just like __builtin_ppc_mftb >> does. All three of them. > Well, that seems wrong for __builtin_darn_32, which maps to an SImode pattern. > > So, I assume what you'd like to see is for the other two built-ins to return > long, and for the "&& TARGET_64BIT" to be removed from the darn_raw and darn > patterns? > For the record, I don't see how this can work. WHen I compile: #include long get_raw_random () { return __builtin_darn_raw (); } with these changes, the compiler thinks that __builtin_darn_raw returns a register pair, presumably due to it being a DImode pattern. It then pulls the second register of the pair as the actual result. get_raw_random: .LFB0: darn 10,2 mr 3,11 blr The vregs dump shows: (insn 5 2 6 2 (set (reg:DI 118) (unspec_volatile:DI [ (const_int 0 [0]) ] UNSPECV_DARN_RAW)) "darn-thing.c":11:10 1043 {darn_raw} (nil)) (insn 6 5 10 2 (set (reg:SI 117 [ ]) (subreg:SI (reg:DI 118) 4)) "darn-thing.c":11:10 543 {*movsi_internal1} (nil)) (insn 10 6 11 2 (set (reg/i:SI 3 3) (reg:SI 117 [ ])) "darn-thing.c":12:1 543 {*movsi_internal1} (nil)) (insn 11 10 0 2 (use (reg/i:SI 3 3)) "darn-thing.c":12:1 -1 (nil)) So if you want to support these patterns for 32-bit mode, there's more work required. Given this, I'd like to ask you to reconsider the original submitted patch for now. Thanks, Bill