Changeset d9be488 in mainline
- Timestamp:
- 2014-03-01T23:03:21Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 071fefec
- Parents:
- 75baf6e
- Files:
-
- 33 added
- 1 deleted
- 15 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r75baf6e rd9be488 397 397 ! [PLATFORM=ia32|PLATFORM=amd64|PLATFORM=ia64|PLATFORM=sparc64] CONFIG_FPU (y) 398 398 399 ## armv7 made fpuhardware compulsory399 ## ARMv7 made FPU hardware compulsory 400 400 % FPU support 401 401 ! [PLATFORM=arm32&PROCESSOR_ARCH=armv7_a] CONFIG_FPU (y) -
uspace/Makefile.common
r75baf6e rd9be488 44 44 # EXTRA_CLEAN additional cleanup targets 45 45 # 46 # MATH set to 'y' to use the math library 46 47 # POSIX_COMPAT set to 'y' to use POSIX compatibility layer 47 # NEEDS_MATH set to 'y' to add implementation of mathematical functions48 48 # 49 49 # Optionally, for a binary: … … 87 87 endif 88 88 89 ifeq ($(CONFIG_BUILD_SHARED_LIBS), 89 ifeq ($(CONFIG_BUILD_SHARED_LIBS),y) 90 90 ifneq ($(SLIBRARY),) 91 91 LARCHIVE = $(LIBRARY).la … … 110 110 LIBSOFTFLOAT_PREFIX = $(LIB_PREFIX)/softfloat 111 111 LIBSOFTINT_PREFIX = $(LIB_PREFIX)/softint 112 112 113 LIBMATH_PREFIX = $(LIB_PREFIX)/math 114 LIBMATH_INCLUDES_FLAGS = \ 115 -I$(LIBMATH_PREFIX)/include \ 116 -I$(LIBMATH_PREFIX)/arch/$(UARCH)/include 113 117 114 118 LIBPOSIX_PREFIX = $(LIB_PREFIX)/posix … … 155 159 STATIC_BUILD = y 156 160 else 157 ifeq ($(CONFIG_USE_SHARED_LIBS), 161 ifeq ($(CONFIG_USE_SHARED_LIBS),y) 158 162 STATIC_BUILD = n 159 163 else … … 172 176 BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a 173 177 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld 178 ifeq ($(MATH),y) 179 BASE_LIBS += $(LIBMATH_PREFIX)/libmath.a 180 endif 174 181 else 175 182 BASE_LIBS = $(LIBC_PREFIX)/libc.so0 $(LIBSOFTINT_PREFIX)/libsofti.so0 176 183 LFLAGS = -Bdynamic 177 184 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld 185 ifeq ($(MATH),y) 186 BASE_LIBS += $(LIBMATH_PREFIX)/libmath.so0 187 endif 188 endif 189 190 ifeq ($(MATH),y) 191 INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS) $(LIBMATH_INCLUDES_FLAGS) 192 else 193 INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS) 178 194 endif 179 195 … … 194 210 find . -name '*.lo' -follow -exec rm \{\} \; 195 211 196 GCC_CFLAGS = $( LIBC_INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \212 GCC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 197 213 -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \ 198 214 -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \ … … 201 217 -pipe -ggdb -D__$(ENDIANESS)__ 202 218 203 ICC_CFLAGS = $( LIBC_INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \219 ICC_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 204 220 -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \ 205 221 -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \ … … 234 250 # Prepare for POSIX before including platform specific stuff 235 251 ifeq ($(POSIX_COMPAT),y) 236 CFLAGS = -I$(LIBPOSIX_PREFIX)/include/posix 252 CFLAGS = -I$(LIBPOSIX_PREFIX)/include/posix -I$(LIBPOSIX_PREFIX)/include/ 237 253 BASE_LIBS = $(LIBPOSIX_PREFIX)/libposixaslibc.a $(LIBPOSIX_PREFIX)/libc4posix.a $(LIBSOFTINT_PREFIX)/libsoftint.a 238 endif239 240 # Do we need math?241 ifeq ($(NEEDS_MATH),y)242 BASE_LIBS += $(LIBMATH_PREFIX)/libmath.a243 254 endif 244 255 -
uspace/app/tester/Makefile
r75baf6e rd9be488 41 41 42 42 BINARY = tester 43 MATH = y 43 44 44 45 SOURCES = \ … … 62 63 fault/fault3.c \ 63 64 float/float1.c \ 65 float/float2.c \ 64 66 float/softfloat1.c \ 65 67 vfs/vfs1.c \ -
uspace/app/tester/tester.c
r75baf6e rd9be488 64 64 #include "fault/fault3.def" 65 65 #include "float/float1.def" 66 #include "float/float2.def" 66 67 #include "float/softfloat1.def" 67 68 #include "vfs/vfs1.def" -
uspace/app/tester/tester.h
r75baf6e rd9be488 97 97 extern const char *test_fault3(void); 98 98 extern const char *test_float1(void); 99 extern const char *test_float2(void); 99 100 extern const char *test_softfloat1(void); 100 101 extern const char *test_vfs1(void); -
uspace/app/vdemo/Makefile
r75baf6e rd9be488 41 41 42 42 BINARY = vdemo 43 MATH = y 43 44 44 45 SOURCES = \ -
uspace/app/viewer/Makefile
r75baf6e rd9be488 41 41 42 42 BINARY = viewer 43 MATH = y 43 44 44 45 SOURCES = \ -
uspace/app/vlaunch/Makefile
r75baf6e rd9be488 41 41 42 42 BINARY = vlaunch 43 MATH = y 43 44 44 45 SOURCES = \ -
uspace/app/vterm/Makefile
r75baf6e rd9be488 43 43 44 44 BINARY = vterm 45 MATH = y 45 46 46 47 SOURCES = \ -
uspace/lib/math/Makefile
r75baf6e rd9be488 28 28 29 29 USPACE_PREFIX = ../.. 30 ROOT_PATH = $(USPACE_PREFIX)/.. 31 32 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config 33 30 34 LIBRARY = libmath 35 SLIBRARY = libmath.so.0.0 36 LSONAME = libmath.so0 37 MATH = y 38 39 -include $(CONFIG_MAKEFILE) 40 -include arch/$(UARCH)/Makefile.inc 41 42 GENERIC_SOURCES = \ 43 generic/trunc.c 31 44 32 45 SOURCES = \ 33 src/dummy.c 46 $(GENERIC_SOURCES) \ 47 $(ARCH_SOURCES) 34 48 35 49 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/math/arch/amd64/include/libarch/math.h
r75baf6e rd9be488 1 1 /* 2 * Copyright (c) 201 1 Petr Koupy2 * Copyright (c) 2014 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup lib posix29 /** @addtogroup libmathamd64 30 30 * @{ 31 31 */ 32 /** @file Mathematical operations. 33 * 34 * The implementation is provided by a separate library to allow 35 * switching of the implementations. 32 /** @file 36 33 */ 37 34 38 #ifndef LIB C_MATH_H_39 #define LIB C_MATH_H_35 #ifndef LIBMATH_amd64_MATH_H_ 36 #define LIBMATH_amd64_MATH_H_ 40 37 41 #ifdef __GNUC__42 #define HUGE_VAL (__builtin_huge_val())43 #endif44 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);59 38 extern double sin(double); 60 extern double sinh(double);61 extern double asin(double);62 extern double asinh(double);63 39 extern 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); 40 extern double trunc(double); 74 41 75 42 #endif -
uspace/lib/math/include/math.h
r75baf6e rd9be488 1 1 /* 2 * Copyright (c) 20 05 Josef Cejka2 * Copyright (c) 2011 Petr Koupy 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup softfloat29 /** @addtogroup libmath 30 30 * @{ 31 31 */ 32 /** @file Other functions (power, complex).32 /** @file Mathematical operations. 33 33 */ 34 34 35 #ifndef __OTHER_H__ 36 #define __OTHER_H__ 35 #ifndef LIBMATH_MATH_H_ 36 #define LIBMATH_MATH_H_ 37 38 #include <libarch/math.h> 37 39 38 40 #endif -
uspace/lib/math/include/trunc.h
r75baf6e rd9be488 1 1 /* 2 * Copyright (c) 20 05 Josef Cejka2 * Copyright (c) 2014 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup softfloat29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 /** @file Other functions (power, complex).32 /** @file 33 33 */ 34 34 35 #ifndef LIBMATH_TRUNC_H_ 36 #define LIBMATH_TRUNC_H_ 37 38 #include <mathtypes.h> 39 40 extern float64 trunc_float64(float64); 41 42 #endif 35 43 36 44 /** @} -
uspace/lib/softfloat/Makefile
r75baf6e rd9be488 30 30 USPACE_PREFIX = ../.. 31 31 LIBRARY = libsoftfloat 32 MATH = y 32 33 33 34 SOURCES = \ … … 39 40 mul.c \ 40 41 comparison.c \ 41 conversion.c \ 42 other.c 42 conversion.c 43 43 44 44 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/softfloat/sftypes.h
r75baf6e rd9be488 34 34 */ 35 35 36 #ifndef __SFTYPES_H__ 37 #define __SFTYPES_H__ 38 39 #include <byteorder.h> 40 #include <stdint.h> 41 42 /* 43 * For recognizing NaNs or infinity use specialized comparison 44 * functions, comparing with these constants is not sufficient. 45 */ 46 47 #define FLOAT32_NAN UINT32_C(0x7FC00001) 48 #define FLOAT32_SIGNAN UINT32_C(0x7F800001) 49 #define FLOAT32_INF UINT32_C(0x7F800000) 50 51 #define FLOAT64_NAN UINT64_C(0x7FF8000000000001) 52 #define FLOAT64_SIGNAN UINT64_C(0x7FF0000000000001) 53 #define FLOAT64_INF UINT64_C(0x7FF0000000000000) 54 55 #define FLOAT96_NAN_HI UINT64_C(0x7FFF80000000) 56 #define FLOAT96_NAN_LO UINT32_C(0x00010000) 57 #define FLOAT96_SIGNAN_HI UINT64_C(0x7FFF00000000) 58 #define FLOAT96_SIGNAN_LO UINT32_C(0x00010000) 59 60 #define FLOAT128_NAN_HI UINT64_C(0x7FFF800000000000) 61 #define FLOAT128_NAN_LO UINT64_C(0x0000000000000001) 62 #define FLOAT128_SIGNAN_HI UINT64_C(0x7FFF000000000000) 63 #define FLOAT128_SIGNAN_LO UINT64_C(0x0000000000000001) 64 #define FLOAT128_INF_HI UINT64_C(0x7FFF000000000000) 65 #define FLOAT128_INF_LO UINT64_C(0x0000000000000000) 66 67 #define FLOAT32_FRACTION_SIZE 23 68 #define FLOAT64_FRACTION_SIZE 52 69 #define FLOAT96_FRACTION_SIZE 64 70 #define FLOAT128_FRACTION_SIZE 112 71 #define FLOAT128_FRAC_HI_SIZE 48 72 #define FLOAT128_FRAC_LO_SIZE 64 73 74 #define FLOAT32_HIDDEN_BIT_MASK UINT32_C(0x800000) 75 #define FLOAT64_HIDDEN_BIT_MASK UINT64_C(0x10000000000000) 76 #define FLOAT128_HIDDEN_BIT_MASK_HI UINT64_C(0x1000000000000) 77 #define FLOAT128_HIDDEN_BIT_MASK_LO UINT64_C(0x0000000000000000) 78 79 #define FLOAT32_MAX_EXPONENT 0xFF 80 #define FLOAT64_MAX_EXPONENT 0x7FF 81 #define FLOAT96_MAX_EXPONENT 0x7FFF 82 #define FLOAT128_MAX_EXPONENT 0x7FFF 83 84 #define FLOAT32_BIAS 0x7F 85 #define FLOAT64_BIAS 0x3FF 86 #define FLOAT96_BIAS 0x3FFF 87 #define FLOAT128_BIAS 0x3FFF 88 89 #if defined(__BE__) 90 91 typedef union { 92 uint32_t bin; 93 94 struct { 95 uint32_t sign : 1; 96 uint32_t exp : 8; 97 uint32_t fraction : 23; 98 } parts __attribute__((packed)); 99 } float32; 100 101 typedef union { 102 uint64_t bin; 103 104 struct { 105 uint64_t sign : 1; 106 uint64_t exp : 11; 107 uint64_t fraction : 52; 108 } parts __attribute__((packed)); 109 } float64; 110 111 typedef union { 112 struct { 113 uint64_t hi; 114 uint32_t lo; 115 } bin __attribute__((packed)); 116 117 struct { 118 uint64_t padding : 16; 119 uint64_t sign : 1; 120 uint64_t exp : 15; 121 uint64_t fraction : 64; 122 } parts __attribute__((packed)); 123 } float96; 124 125 typedef union { 126 struct { 127 uint64_t hi; 128 uint64_t lo; 129 } bin __attribute__((packed)); 130 131 struct { 132 uint64_t sign : 1; 133 uint64_t exp : 15; 134 uint64_t frac_hi : 48; 135 uint64_t frac_lo : 64; 136 } parts __attribute__((packed)); 137 } float128; 138 139 #elif defined(__LE__) 140 141 typedef union { 142 uint32_t bin; 143 144 struct { 145 uint32_t fraction : 23; 146 uint32_t exp : 8; 147 uint32_t sign : 1; 148 } parts __attribute__((packed)); 149 } float32; 150 151 typedef union { 152 uint64_t bin; 153 154 struct { 155 uint64_t fraction : 52; 156 uint64_t exp : 11; 157 uint64_t sign : 1; 158 } parts __attribute__((packed)); 159 } float64; 160 161 typedef union { 162 struct { 163 uint32_t lo; 164 uint64_t hi; 165 } bin __attribute__((packed)); 166 167 struct { 168 uint64_t fraction : 64; 169 uint64_t exp : 15; 170 uint64_t sign : 1; 171 uint64_t padding : 16; 172 } parts __attribute__((packed)); 173 } float96; 174 175 typedef union { 176 struct { 177 uint64_t lo; 178 uint64_t hi; 179 } bin __attribute__((packed)); 180 181 struct { 182 uint64_t frac_lo : 64; 183 uint64_t frac_hi : 48; 184 uint64_t exp : 15; 185 uint64_t sign : 1; 186 } parts __attribute__((packed)); 187 } float128; 188 189 #else 190 #error Unknown endianess 191 #endif 192 193 typedef union { 194 float val; 195 196 #if defined(FLOAT_SIZE_32) 197 float32 data; 198 #elif defined(FLOAT_SIZE_64) 199 float64 data; 200 #elif defined(FLOAT_SIZE_96) 201 float96 data; 202 #elif defined(FLOAT_SIZE_128) 203 float128 data; 204 #else 205 #error Unsupported float size 206 #endif 207 } float_t; 208 209 typedef union { 210 double val; 211 212 #if defined(DOUBLE_SIZE_32) 213 float32 data; 214 #elif defined(DOUBLE_SIZE_64) 215 float64 data; 216 #elif defined(DOUBLE_SIZE_96) 217 float96 data; 218 #elif defined(DOUBLE_SIZE_128) 219 float128 data; 220 #else 221 #error Unsupported double size 222 #endif 223 } double_t; 224 225 typedef union { 226 long double val; 227 228 #if defined(LONG_DOUBLE_SIZE_32) 229 float32 data; 230 #elif defined(LONG_DOUBLE_SIZE_64) 231 float64 data; 232 #elif defined(LONG_DOUBLE_SIZE_96) 233 float96 data; 234 #elif defined(LONG_DOUBLE_SIZE_128) 235 float128 data; 236 #else 237 #error Unsupported long double size 238 #endif 239 } long_double_t; 240 36 #ifndef SOFTFLOAT_SFTYPES_H__ 37 #define SOFTFLOAT_SFTYPES_H__ 38 39 #include <mathtypes.h> 241 40 242 41 #if defined(INT_SIZE_8) -
uspace/lib/softfloat/softfloat.c
r75baf6e rd9be488 44 44 #include "conversion.h" 45 45 #include "comparison.h" 46 #include "other.h"47 46 48 47 /* Arithmetic functions */ -
uspace/lib/softrend/Makefile
r75baf6e rd9be488 31 31 SLIBRARY = libsoftrend.so.0.0 32 32 LSONAME = libsoftrend.so0 33 MATH = y 33 34 34 35 SOURCES = \ -
uspace/srv/hid/compositor/Makefile
r75baf6e rd9be488 28 28 29 29 USPACE_PREFIX = ../../.. 30 30 31 LIBS = \ 31 32 $(LIBDRAW_PREFIX)/libdraw.a \ … … 40 41 41 42 BINARY = compositor 43 MATH = y 42 44 43 45 SOURCES = \
Note:
See TracChangeset
for help on using the changeset viewer.