Changeset bae1e1f in mainline
- Timestamp:
- 2015-09-01T08:08:47Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 992ffa6
- Parents:
- 1d03e86
- Location:
- uspace
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/float/float2.c
r1d03e86 rbae1e1f 39 39 }; 40 40 41 static double results_ceil[OPERANDS] = { 42 4.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 769.0, 1081.0, -600.0, 1.0 43 }; 44 45 static double results_floor[OPERANDS] = { 46 3.0, -3.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0 47 }; 48 41 49 static double results_trunc[OPERANDS] = { 42 50 3.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0 … … 59 67 bool fail = false; 60 68 69 for (unsigned int i = 0; i < OPERANDS; i++) { 70 double res = floor(arguments[i]); 71 int64_t res_int = (int64_t) (res * PRECISION); 72 int64_t corr_int = (int64_t) (results_floor[i] * PRECISION); 73 74 if (res_int != corr_int) { 75 TPRINTF("Double floor failed (%" PRId64 " != %" PRId64 76 ", arg %u)\n", res_int, corr_int, i); 77 fail = true; 78 } 79 } 80 81 for (unsigned int i = 0; i < OPERANDS; i++) { 82 double res = ceil(arguments[i]); 83 int64_t res_int = (int64_t) (res * PRECISION); 84 int64_t corr_int = (int64_t) (results_ceil[i] * PRECISION); 85 86 if (res_int != corr_int) { 87 TPRINTF("Double ceil failed (%" PRId64 " != %" PRId64 88 ", arg %u)\n", res_int, corr_int, i); 89 fail = true; 90 } 91 } 92 61 93 for (unsigned int i = 0; i < OPERANDS; i++) { 62 94 double res = trunc(arguments[i]); -
uspace/lib/math/Makefile
r1d03e86 rbae1e1f 41 41 42 42 GENERIC_SOURCES = \ 43 generic/ceil.c \ 44 generic/floor.c \ 43 45 generic/trig.c \ 44 46 generic/mod.c \ -
uspace/lib/math/arch/abs32le/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_abs32le_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 { -
uspace/lib/math/arch/amd64/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_amd64_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 46 48 extern float64_t sin(float64_t); 47 49 extern float64_t cos(float64_t); 50 51 static inline float64_t ceil(float64_t val) 52 { 53 float64_u arg; 54 arg.val = val; 55 56 float64_u ret; 57 ret.data = ceil_float64(arg.data); 58 59 return ret.val; 60 } 61 62 static inline float64_t floor(float64_t val) 63 { 64 float64_u arg; 65 arg.val = val; 66 67 float64_u ret; 68 ret.data = floor_float64(arg.data); 69 70 return ret.val; 71 } 72 48 73 extern float64_t trunc(float64_t); 49 74 -
uspace/lib/math/arch/arm32/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_arm32_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 { -
uspace/lib/math/arch/ia32/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_ia32_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 46 48 extern float64_t sin(float64_t); 47 49 extern float64_t cos(float64_t); 50 51 static inline float64_t ceil(float64_t val) 52 { 53 float64_u arg; 54 arg.val = val; 55 56 float64_u ret; 57 ret.data = ceil_float64(arg.data); 58 59 return ret.val; 60 } 61 62 static inline float64_t floor(float64_t val) 63 { 64 float64_u arg; 65 arg.val = val; 66 67 float64_u ret; 68 ret.data = floor_float64(arg.data); 69 70 return ret.val; 71 } 72 48 73 extern float64_t trunc(float64_t); 49 74 -
uspace/lib/math/arch/ia64/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_ia64_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 { -
uspace/lib/math/arch/mips32/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_mips32_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 { -
uspace/lib/math/arch/mips32eb/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_mips32eb_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 { -
uspace/lib/math/arch/ppc32/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_ppc32_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 { -
uspace/lib/math/arch/sparc32/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_sparc32_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 { -
uspace/lib/math/arch/sparc64/include/libarch/math.h
r1d03e86 rbae1e1f 36 36 #define LIBMATH_sparc64_MATH_H_ 37 37 38 #include <ceil.h> 39 #include <floor.h> 38 40 #include <mathtypes.h> 39 41 #include <mod.h> … … 57 59 } 58 60 61 static inline float64_t ceil(float64_t val) 62 { 63 float64_u arg; 64 arg.val = val; 65 66 float64_u ret; 67 ret.data = ceil_float64(arg.data); 68 69 return ret.val; 70 } 71 72 static inline float64_t floor(float64_t val) 73 { 74 float64_u arg; 75 arg.val = val; 76 77 float64_u ret; 78 ret.data = floor_float64(arg.data); 79 80 return ret.val; 81 } 82 59 83 static inline float64_t sin(float64_t val) 60 84 {
Note:
See TracChangeset
for help on using the changeset viewer.