diff options
author | Damien George <damien.p.george@gmail.com> | 2017-06-14 17:18:23 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-06-14 17:18:23 +1000 |
commit | 3bedff0b3cbb5ae9bc499f8ec0108c54f26fc87c (patch) | |
tree | 0b90a5ea215b5beb8a68467d1e662afd99a42bcc /lib | |
parent | c064f0a36a69b7479e7b828b97fed40b60247188 (diff) | |
download | micropython-3bedff0b3cbb5ae9bc499f8ec0108c54f26fc87c.tar.gz micropython-3bedff0b3cbb5ae9bc499f8ec0108c54f26fc87c.zip |
lib/libm/math: Remove implementations of float conversion functions.
These implementations are incorrect (eg f2d and d2f don't handle special
values like 0.0) and proper versions can be provided by libgcc (or
equivalent depending on the toolchain).
libgcc is now linked with the stmhal port so that library will provide
these functions from now on.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libm/math.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/lib/libm/math.c b/lib/libm/math.c index 732049236d..d7e27e775b 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -36,56 +36,6 @@ typedef union { }; } float_s_t; -typedef union { - double d; - struct { - uint64_t m : 52; - uint64_t e : 11; - uint64_t s : 1; - }; -} double_s_t; - -#if defined(__thumb__) - -double __attribute__((pcs("aapcs"))) __aeabi_i2d(int32_t x) { - return (float)x; -} - -// TODO -long long __attribute__((pcs("aapcs"))) __aeabi_f2lz(float x) { - return (long)x; -} - -double __attribute__((pcs("aapcs"))) __aeabi_f2d(float x) { - float_s_t fx={0}; - double_s_t dx={0}; - - fx.f = x; - dx.s = (fx.s); - dx.e = (fx.e-127+1023) & 0x7FF; - dx.m = fx.m; - dx.m <<=(52-23); // left justify - return dx.d; -} - -float __attribute__((pcs("aapcs"))) __aeabi_d2f(double x) { - float_s_t fx={0}; - double_s_t dx={0}; - - dx.d = x; - fx.s = (dx.s); - fx.e = (dx.e-1023+127) & 0xFF; - fx.m = (dx.m>>(52-23)); // right justify - return fx.f; -} - -double __aeabi_dmul(double x , double y) { - return 0.0; - -} - -#endif // defined(__thumb__) - #ifndef NDEBUG float copysignf(float x, float y) { float_s_t fx={.f = x}; |