libc.obj: added log2, log10, round functions

git-svn-id: svn://kolibrios.org@9772 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
vitalkrilov 2022-04-20 17:08:10 +00:00
parent e7935a8fbd
commit fda5ad66db
5 changed files with 32 additions and 2 deletions

View File

@ -20,9 +20,11 @@ extern double _FUNC(fmod)(double _x, double _y);
extern double _FUNC(frexp)(double _x, int* _pexp);
extern double _FUNC(ldexp)(double _x, int _exp);
extern double _FUNC(log)(double _y);
extern double _FUNC(log2)(double _x);
extern double _FUNC(log10)(double _x);
extern double _FUNC(modf)(double _x, double* _pint);
extern double _FUNC(pow)(double _x, double _y);
extern double _FUNC(round)(double _x);
extern double _FUNC(sin)(double _x);
extern double _FUNC(sinh)(double _x);
extern double _FUNC(sqrt)(double _x);
@ -61,4 +63,4 @@ struct exception {
int err;
};
#endif /* _MATH_H_ */
#endif /* _MATH_H_ */

View File

@ -131,11 +131,14 @@ __asm__(
".include \"math/floor.s\"\n\t"
".include \"math/fmod.s\"\n\t"
".include \"math/log.s\"\n\t"
".include \"math/log2.s\"\n\t"
".include \"math/log10.s\"\n\t"
".include \"math/modf.s\"\n\t"
".include \"math/modfl.s\"\n\t"
".include \"math/pow.s\"\n\t"
".include \"math/pow2.s\"\n\t"
".include \"math/pow10.s\"\n\t"
".include \"math/round.s\"\n\t"
".include \"math/sqrt.s\"\n\t"
".include \"math/sin.s\"\n\t"
".include \"math/tan.s\"\n\t");
@ -258,7 +261,6 @@ ksys_dll_t EXPORTS[] = {
{ "acosh", &acosh },
{ "asinh", &asinh },
{ "atanh", &atanh },
{ "acosh", &acosh },
{ "frexp", &frexp },
{ "hypot", &hypot },
{ "ldexp", &ldexp },
@ -279,6 +281,9 @@ ksys_dll_t EXPORTS[] = {
{ "floor", &floor },
{ "fmod", &fmod },
{ "log", &log },
{ "log2", &log2 },
{ "log10", &log10 },
{ "round", &round },
{ "modf", &modf },
{ "modfl", &modfl },
{ "pow", &pow },

View File

@ -0,0 +1,9 @@
.global log10;
log10:
fld1
fldl 4(%esp)
fyl2x
fldl2t
fdivp
ret

View File

@ -0,0 +1,7 @@
.global log2;
log2:
fld1
fldl 4(%esp)
fyl2x
ret

View File

@ -0,0 +1,7 @@
.global round;
round:
fldl 4(%esp)
fistp 4(%esp)
fild 4(%esp)
ret