From d422df6711977adc9ae34702734395bd0acd9b5c Mon Sep 17 00:00:00 2001 From: Daniel Kiper Date: Tue, 19 Mar 2019 10:51:01 +0100 Subject: [PATCH] sparc: Enable __clzsi2() and __clzdi2() This patch is similiar to commit e795b9011 (RISC-V: Add libgcc helpers for clz) but for SPARC target. Signed-off-by: Daniel Kiper Reviewed-by: Ross Philipson --- grub-core/kern/compiler-rt.c | 4 ++-- include/grub/compiler-rt.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/compiler-rt.c b/grub-core/kern/compiler-rt.c index 33e08fe06..a464200c6 100644 --- a/grub-core/kern/compiler-rt.c +++ b/grub-core/kern/compiler-rt.c @@ -420,7 +420,7 @@ __aeabi_llsl (grub_uint64_t u, int b) #endif -#if defined(__mips__) || defined(__riscv) +#if defined(__mips__) || defined(__riscv) || defined(__sparc__) /* Based on libgcc from gcc suite. */ int __clzsi2 (grub_uint32_t val) @@ -448,7 +448,7 @@ __clzsi2 (grub_uint32_t val) } #endif -#ifdef __riscv +#if defined(__riscv) || defined(__sparc__) int __clzdi2 (grub_uint64_t val) { diff --git a/include/grub/compiler-rt.h b/include/grub/compiler-rt.h index 31c0fd750..7591980b4 100644 --- a/include/grub/compiler-rt.h +++ b/include/grub/compiler-rt.h @@ -110,12 +110,12 @@ EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b); #endif -#if defined(__mips__) || defined(__riscv) +#if defined(__mips__) || defined(__riscv) || defined(__sparc__) int EXPORT_FUNC (__clzsi2) (grub_uint32_t val); #endif -#ifdef __riscv +#if defined(__riscv) || defined(__sparc__) int EXPORT_FUNC (__clzdi2) (grub_uint64_t val); #endif