grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/5] mips: Enable __clzsi2()


From: Daniel Kiper
Subject: [PATCH 4/5] mips: Enable __clzsi2()
Date: Tue, 19 Mar 2019 13:39:17 +0100

This patch is similiar to commit e795b9011 (RISC-V: Add libgcc helpers
for clz) but for MIPS target.

Signed-off-by: Daniel Kiper <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]