mirror of
https://github.com/urbit/shrub.git
synced 2025-01-02 09:32:29 +03:00
jets: add the direct atom optimization to +mod
+mod was going to libgmp when both operands fit in 31-bits.
This commit is contained in:
parent
17d895241d
commit
bc9c4b67d6
@ -10,15 +10,10 @@
|
|||||||
u3qa_mod(u3_atom a,
|
u3qa_mod(u3_atom a,
|
||||||
u3_atom b)
|
u3_atom b)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if ( b == 3 && a == 2684227708 ) {
|
|
||||||
printf("dword at 0x27ff84ff8 is %" PRIu64 "\r\n", *(c3_d *)0x27ff84ff8);
|
|
||||||
*(c3_d *)0x27ff84ff8 = 25;
|
|
||||||
printf("see, we modified it\r\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if ( 0 == b ) {
|
if ( 0 == b ) {
|
||||||
return u3m_bail(c3__exit);
|
return u3m_bail(c3__exit);
|
||||||
|
} else if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
|
||||||
|
return a % b;
|
||||||
} else {
|
} else {
|
||||||
mpz_t a_mp, b_mp;
|
mpz_t a_mp, b_mp;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user