diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2017-08-28 13:59:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-28 13:59:26 -0700 |
| commit | 447a4b1ecd5655357c9daaace03b91355d2e2c6d (patch) | |
| tree | 46ca08a93e9870aab4fbb533843f3c99796cbdf4 /lib/libm/math.c | |
| parent | 4e63d55d8d0df6d7600bb684fa90a8cb54708ba8 (diff) | |
| parent | c679c80c710fd4a0e37ad87200d8a721e19727aa (diff) | |
Merge pull request #208 from adafruit/merge-v1.9.2
Merge MicroPython v1.9.2
Diffstat (limited to 'lib/libm/math.c')
| -rw-r--r-- | lib/libm/math.c | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/lib/libm/math.c b/lib/libm/math.c index 732049236..984636627 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -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}; |
