Changeset d9be488 in mainline for uspace/lib/math


Ignore:
Timestamp:
2014-03-01T23:03:21Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
071fefec
Parents:
75baf6e
Message:

refactor floating point support

  • implement IA-32 and AMD64 specific trunc(), sin(), cos() using x87
  • implement generic trunc() (generic sin(), cos() still missing)
  • trunc(), sin(), cos() tests
Location:
uspace/lib/math
Files:
31 added
1 deleted
1 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/math/Makefile

    r75baf6e rd9be488  
    2828
    2929USPACE_PREFIX = ../..
     30ROOT_PATH = $(USPACE_PREFIX)/..
     31
     32CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     33
    3034LIBRARY = libmath
     35SLIBRARY = libmath.so.0.0
     36LSONAME = libmath.so0
     37MATH = y
     38
     39-include $(CONFIG_MAKEFILE)
     40-include arch/$(UARCH)/Makefile.inc
     41
     42GENERIC_SOURCES = \
     43        generic/trunc.c
    3144
    3245SOURCES = \
    33         src/dummy.c
     46        $(GENERIC_SOURCES) \
     47        $(ARCH_SOURCES)
    3448
    3549include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/math/arch/amd64/include/libarch/math.h

    r75baf6e rd9be488  
    11/*
    2  * Copyright (c) 2011 Petr Koupy
     2 * Copyright (c) 2014 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libposix
     29/** @addtogroup libmathamd64
    3030 * @{
    3131 */
    32 /** @file Mathematical operations.
    33  *
    34  * The implementation is provided by a separate library to allow
    35  * switching of the implementations.
     32/** @file
    3633 */
    3734
    38 #ifndef LIBC_MATH_H_
    39 #define LIBC_MATH_H_
     35#ifndef LIBMATH_amd64_MATH_H_
     36#define LIBMATH_amd64_MATH_H_
    4037
    41 #ifdef __GNUC__
    42         #define HUGE_VAL (__builtin_huge_val())
    43 #endif
    44 
    45 extern double ldexp(double, int);
    46 extern double frexp(double, int *);
    47 
    48 extern double fabs(double);
    49 extern double floor(double);
    50 extern double ceil(double);
    51 extern double modf(double, double *);
    52 extern double fmod(double, double);
    53 extern double pow(double, double);
    54 extern double exp(double);
    55 extern double expm1(double);
    56 extern double sqrt(double);
    57 extern double log(double);
    58 extern double log10(double);
    5938extern double sin(double);
    60 extern double sinh(double);
    61 extern double asin(double);
    62 extern double asinh(double);
    6339extern double cos(double);
    64 extern double cosh(double);
    65 extern double acos(double);
    66 extern double acosh(double);
    67 extern double tan(double);
    68 extern double tanh(double);
    69 extern double atan(double);
    70 extern double atanh(double);
    71 extern double atan2(double, double);
    72 
    73 double copysign(double, double);
     40extern double trunc(double);
    7441
    7542#endif
  • uspace/lib/math/include/math.h

    r75baf6e rd9be488  
    11/*
    2  * Copyright (c) 2005 Josef Cejka
     2 * Copyright (c) 2011 Petr Koupy
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup softfloat
     29/** @addtogroup libmath
    3030 * @{
    3131 */
    32 /** @file Other functions (power, complex).
     32/** @file Mathematical operations.
    3333 */
    3434
    35 #ifndef __OTHER_H__
    36 #define __OTHER_H__
     35#ifndef LIBMATH_MATH_H_
     36#define LIBMATH_MATH_H_
     37
     38#include <libarch/math.h>
    3739
    3840#endif
  • uspace/lib/math/include/trunc.h

    r75baf6e rd9be488  
    11/*
    2  * Copyright (c) 2005 Josef Cejka
     2 * Copyright (c) 2014 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup softfloat
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 /** @file Other functions (power, complex).
     32/** @file
    3333 */
    3434
     35#ifndef LIBMATH_TRUNC_H_
     36#define LIBMATH_TRUNC_H_
     37
     38#include <mathtypes.h>
     39
     40extern float64 trunc_float64(float64);
     41
     42#endif
    3543
    3644/** @}
Note: See TracChangeset for help on using the changeset viewer.