Changeset 516e780 in mainline for uspace/lib/softfloat


Ignore:
Timestamp:
2018-08-31T11:55:41Z (7 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fa86fff
Parents:
7f7d642
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-08-31 11:55:41)
git-committer:
GitHub <noreply@…> (2018-08-31 11:55:41)
Message:

Strip down libmath. (#45)

libmath is mostly unused (except for trunc(), sin() and cos()), and most functions in it are either very imprecise or downright broken. Additionally, it is implemented in manner that conflicts with C standard. Instead of trying to fix all the shortcomings while maintaining unused functionality, I'm opting to simply remove most of it and only keep the parts that are currently necessary.

Later readdition of the removed functions is possible, but there needs to be a reliable way to evaluate their quality first.

Location:
uspace/lib/softfloat
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/softfloat/Makefile

    r7f7d642 r516e780  
    3030USPACE_PREFIX = ../..
    3131LIBRARY = libsoftfloat
    32 EXTRA_CFLAGS += $(LIBMATH_INCLUDES_FLAGS)
    3332
    3433SOURCES = \
  • uspace/lib/softfloat/comparison.c

    r7f7d642 r516e780  
    681681}
    682682
     683int __aeabi_fcmpun(float32_t a, float32_t b)
     684{
     685        float32_u ua;
     686        ua.val = a;
     687
     688        float32_u ub;
     689        ub.val = b;
     690
     691        // TODO: sigNaNs
     692        return is_float32_nan(ua.data) || is_float32_nan(ub.data);
     693}
     694
    683695#endif
    684696
     
    920932}
    921933
     934int __aeabi_dcmpun(float64_t a, float64_t b)
     935{
     936        float64_u ua;
     937        ua.val = a;
     938
     939        float64_u ub;
     940        ub.val = b;
     941
     942        // TODO: sigNaNs
     943        return is_float64_nan(ua.data) || is_float64_nan(ub.data);
     944}
     945
    922946#endif
    923947
  • uspace/lib/softfloat/comparison.h

    r7f7d642 r516e780  
    9393extern int __aeabi_fcmple(float32_t, float32_t);
    9494extern int __aeabi_fcmpeq(float32_t, float32_t);
     95extern int __aeabi_fcmpun(float32_t, float32_t);
    9596#endif
    9697
     
    109110extern int __aeabi_dcmpge(float64_t, float64_t);
    110111extern int __aeabi_dcmple(float64_t, float64_t);
     112extern int __aeabi_dcmpun(float64_t, float64_t);
    111113#endif
    112114
Note: See TracChangeset for help on using the changeset viewer.