Commit aaab1542 authored by Adam Wujek's avatar Adam Wujek

lib/util: use a special function for 64bit modulo

Don't use 64bit modulo function from libgcc

This saves ~1.2KB
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 4ecfbddf
......@@ -38,11 +38,6 @@ int mprintf(const char *fmt, ...)
#ifdef CONFIG_DISALLOW_LONG_DIVISION /* with ppsi we can avoid libgcc code for division */
/* was used twice in picos_to_ts */
long long __moddi3 (long long A, long long B)
{
__you_should_not_divide_ll_in_wrpc_sw();
return 0;
}
/* picos_to_ts again */
long long __udivdi3 (long long A, long long B)
......@@ -52,3 +47,10 @@ long long __udivdi3 (long long A, long long B)
}
#endif
long long __moddi3 (long long A, long long B)
{
__you_should_not_divide_ll_in_wrpc_sw();
/* use unsigned modulo instead */
return 0;
}
......@@ -288,3 +288,10 @@ long long __divdi3 (long long A, long long B)
return sign_a * sign_b * (long long) (a_u / b_u);
}
/* To save code, at the 64bit modulo use division and multiplication instead of
* modulo function from the standard library */
unsigned long long __umoddi3 (unsigned long long A, unsigned long long B)
{
volatile uint64_t x = A/B;
return A - (x)*B;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment