Runtime lib functions

Yesterday I felt the urge to change a few things in TinyCC.
This is the first and biggest change of all of them.

- use __aeabi_*divmod functions in ARM EABI to make binaries depend
  solely on standardized library functions

- refactor ARM floating point <-> integer conversion a bit

- rename long long->float and shift library functions to correspond to
  the names used by GCC

- compile more tokens conditionally to reduce the size of TinyCC

The intention is primarily to allow users of the ARM target to use
libgcc (which is usually available as a shared library) instead of
libtcc1 (which can't be compiled for ARM due to lack of an inline
assembler).

Changing the EABI target to use the divmod functions in theory allows
to use it without libtcc1 on any (not necessarily GCC based) ARM EABI
system.

  Daniel
This commit is contained in:
Daniel Glöckner
2008-09-05 21:07:46 +02:00
committed by grischka
parent 2c657f6608
commit 12265da6cd
4 changed files with 141 additions and 95 deletions

View File

@ -419,7 +419,7 @@ unsigned long long __umoddi3(unsigned long long u, unsigned long long v)
}
/* XXX: fix tcc's code generator to do this instead */
long long __sardi3(long long a, int b)
long long __ashrdi3(long long a, int b)
{
#ifdef __TINYC__
DWunion u;
@ -438,7 +438,7 @@ long long __sardi3(long long a, int b)
}
/* XXX: fix tcc's code generator to do this instead */
unsigned long long __shrdi3(unsigned long long a, int b)
unsigned long long __lshrdi3(unsigned long long a, int b)
{
#ifdef __TINYC__
DWunion u;
@ -457,7 +457,7 @@ unsigned long long __shrdi3(unsigned long long a, int b)
}
/* XXX: fix tcc's code generator to do this instead */
long long __shldi3(long long a, int b)
long long __ashldi3(long long a, int b)
{
#ifdef __TINYC__
DWunion u;
@ -483,7 +483,7 @@ unsigned short __tcc_int_fpu_control = 0x137f | 0x0c00;
#endif
/* XXX: fix tcc's code generator to do this instead */
float __ulltof(unsigned long long a)
float __floatundisf(unsigned long long a)
{
DWunion uu;
XFtype r;
@ -498,7 +498,7 @@ float __ulltof(unsigned long long a)
}
}
double __ulltod(unsigned long long a)
double __floatundidf(unsigned long long a)
{
DWunion uu;
XFtype r;
@ -513,7 +513,7 @@ double __ulltod(unsigned long long a)
}
}
long double __ulltold(unsigned long long a)
long double __floatundixf(unsigned long long a)
{
DWunion uu;
XFtype r;