ARM: libtcc1: Add support for TinyCC.
* lib/libtcc1.c: (__udivdi3, __umoddi3, __lshrdi3, __ashldi3, __fixunsxfdi)[__arm__ && __TINYC__]: Use __mesabi functions.
This commit is contained in:
parent
553539ad75
commit
8c53e22434
|
@ -29,7 +29,13 @@ __divdi3 (double a, double b)
|
||||||
eputs ("__divdi3 stub\n");
|
eputs ("__divdi3 stub\n");
|
||||||
stub = 1;
|
stub = 1;
|
||||||
#endif
|
#endif
|
||||||
return ((long) a / (long) b);
|
long ai = a;
|
||||||
|
long bi = b;
|
||||||
|
#if __arm__ && __TINYC__
|
||||||
|
return __mesabi_idiv (ai, bi);
|
||||||
|
#else
|
||||||
|
return ai / bi;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
|
@ -41,7 +47,13 @@ __moddi3 (double a, double b)
|
||||||
eputs ("__moddi3 stub\n");
|
eputs ("__moddi3 stub\n");
|
||||||
stub = 1;
|
stub = 1;
|
||||||
#endif
|
#endif
|
||||||
return ((long) a % (long) b);
|
long ai = a;
|
||||||
|
long bi = b;
|
||||||
|
#if __arm__ && __TINYC__
|
||||||
|
return __mesabi_imod (ai, bi);
|
||||||
|
#else
|
||||||
|
return ai % bi;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_LONG_LONG
|
#if HAVE_LONG_LONG
|
||||||
|
@ -62,7 +74,11 @@ __udivdi3 (unsigned long a, long ah, unsigned long b)
|
||||||
unsigned long bi = b;
|
unsigned long bi = b;
|
||||||
if (!b)
|
if (!b)
|
||||||
return 0;
|
return 0;
|
||||||
|
#if __arm__ && __TINYC__
|
||||||
|
return __mesabi_idiv (ai, bi);
|
||||||
|
#else
|
||||||
return ai / bi;
|
return ai / bi;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_LONG_LONG
|
#if HAVE_LONG_LONG
|
||||||
|
@ -81,7 +97,11 @@ __umoddi3 (unsigned long a, long ah, unsigned long b)
|
||||||
#endif
|
#endif
|
||||||
unsigned long ai = a;
|
unsigned long ai = a;
|
||||||
unsigned long bi = b;
|
unsigned long bi = b;
|
||||||
|
#if __arm__ && __TINYC__
|
||||||
|
return __mesabi_imod (ai, bi);
|
||||||
|
#else
|
||||||
return ai % bi;
|
return ai % bi;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_LONG_LONG
|
#if HAVE_LONG_LONG
|
||||||
|
@ -100,7 +120,12 @@ __lshrdi3 (unsigned long a, long ah, long b)
|
||||||
return a >> b;
|
return a >> b;
|
||||||
#else // __TINYC__
|
#else // __TINYC__
|
||||||
for (int i = 0; i < b; i++)
|
for (int i = 0; i < b; i++)
|
||||||
|
#if __arm__
|
||||||
|
a = __mesabi_idiv (a, 2);
|
||||||
|
#else // !__arm__
|
||||||
a /= 2;
|
a /= 2;
|
||||||
|
#endif // !__arm__
|
||||||
|
return a;
|
||||||
#endif // __TINYC__
|
#endif // __TINYC__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +166,11 @@ __ashrdi3 (long a, long ah, long b)
|
||||||
return a >> b;
|
return a >> b;
|
||||||
#else // __TINYC__
|
#else // __TINYC__
|
||||||
for (int i = 0; i < b; i++)
|
for (int i = 0; i < b; i++)
|
||||||
|
#if __arm__
|
||||||
|
a = __mesabi_idiv (a, 2);
|
||||||
|
#else // !__arm__
|
||||||
a /= 2;
|
a /= 2;
|
||||||
|
#endif // !__arm__
|
||||||
return a;
|
return a;
|
||||||
#endif // __TINYC__
|
#endif // __TINYC__
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue