From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1h6E24-0007uo-Pp for mharc-grub-devel@gnu.org; Tue, 19 Mar 2019 08:39:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6E20-0007sZ-BT for grub-devel@gnu.org; Tue, 19 Mar 2019 08:39:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6E1z-0007Nr-Hn for grub-devel@gnu.org; Tue, 19 Mar 2019 08:39:48 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:50750) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h6E1z-0007M5-4V for grub-devel@gnu.org; Tue, 19 Mar 2019 08:39:47 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2JCYbr4127488; Tue, 19 Mar 2019 12:39:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=gPP6vAT2mKXQQ0jcqHGlTIQoDtVDVf5vW88BVHV8Ghk=; b=PqFDcFdeP69ByM7NtIy+4zpaWOmSSoct/dxmDDXhKpa63vp+h8dkhQPNdKmcdoCFmiWj DFEGSpe1ONXoSsca/NNakfcIPGPjbVKtn4vKQKof1z80/UepQhyz837b8n6uydu/nioT wLRHiBbzJLzg/cKLK+vBKW/Yma5BCY+UWCmy+rllYDCKulaopXLaqD1IX14tcDGwI8dJ +BI5mvCj5leJ7L7/O7tQxeNDOpvQdQFPUWxFFAAQOgAnKaB/WkREZwIpFOt4geypzCho ZMMluBFOUH4qY/24eK+W1DV4L2ldbDpxrlTK0G07tyxqCfd+b1C9Hae/AxuI89Ub9jSL pQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2r8ssrc7yy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 12:39:45 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2JCdime021616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 12:39:44 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2JCdia4023030; Tue, 19 Mar 2019 12:39:44 GMT Received: from tomti.i.net-space.pl (/10.175.211.126) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 05:39:44 -0700 From: Daniel Kiper To: grub-devel@gnu.org Cc: alexander.burmashev@oracle.com, eric.snowberg@oracle.com, leif.lindholm@linaro.org, phcoder@gmail.com, ross.philipson@oracle.com Subject: [PATCH 4/5] mips: Enable __clzsi2() Date: Tue, 19 Mar 2019 13:39:17 +0100 Message-Id: <20190319123918.19267-5-daniel.kiper@oracle.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190319123918.19267-1-daniel.kiper@oracle.com> References: <20190319123918.19267-1-daniel.kiper@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9199 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=982 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903190093 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 12:39:50 -0000 This patch is similiar to commit e795b9011 (RISC-V: Add libgcc helpers for clz) but for MIPS target. Signed-off-by: Daniel Kiper --- grub-core/kern/compiler-rt.c | 5 +++-- include/grub/compiler-rt.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/grub-core/kern/compiler-rt.c b/grub-core/kern/compiler-rt.c index e10b6668c..33e08fe06 100644 --- a/grub-core/kern/compiler-rt.c +++ b/grub-core/kern/compiler-rt.c @@ -420,8 +420,7 @@ __aeabi_llsl (grub_uint64_t u, int b) #endif -#ifdef __riscv - +#if defined(__mips__) || defined(__riscv) /* Based on libgcc from gcc suite. */ int __clzsi2 (grub_uint32_t val) @@ -447,7 +446,9 @@ __clzsi2 (grub_uint32_t val) } return (i - val); } +#endif +#ifdef __riscv int __clzdi2 (grub_uint64_t val) { diff --git a/include/grub/compiler-rt.h b/include/grub/compiler-rt.h index e6a25c6ea..31c0fd750 100644 --- a/include/grub/compiler-rt.h +++ b/include/grub/compiler-rt.h @@ -110,10 +110,12 @@ EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b); #endif -#ifdef __riscv +#if defined(__mips__) || defined(__riscv) int EXPORT_FUNC (__clzsi2) (grub_uint32_t val); +#endif +#ifdef __riscv int EXPORT_FUNC (__clzdi2) (grub_uint64_t val); #endif -- 2.11.0