klib,int64: fix dead recursion for riscv64-mycpu

* symbols inside int64.c are local to __udivmoddi4
This commit is contained in:
Zihao Yu 2021-07-17 21:53:21 +08:00
parent 96f2923137
commit 3364f57d0b

View file

@ -363,6 +363,7 @@ uint32_t __inline __builtin_clzll(uint64_t value) {
#include <am.h>
#if !defined(__riscv) || defined(__riscv_m)
/* Returns: a / b */
COMPILER_RT_ABI di_int
@ -410,6 +411,17 @@ __udivdi3(du_int a, du_int b)
return __udivmoddi4(a, b, 0);
}
/* Returns: a % b */
COMPILER_RT_ABI du_int
__umoddi3(du_int a, du_int b)
{
du_int r;
__udivmoddi4(a, b, &r);
return r;
}
#endif
COMPILER_RT_ABI du_int
__udivmoddi4(du_int a, du_int b, du_int* rem)
@ -621,16 +633,6 @@ __udivmoddi4(du_int a, du_int b, du_int* rem)
return q.all;
}
/* Returns: a % b */
COMPILER_RT_ABI du_int
__umoddi3(du_int a, du_int b)
{
du_int r;
__udivmoddi4(a, b, &r);
return r;
}
// Returns: the number of leading 0-bits
// Precondition: a != 0