Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2018-07-03 14:54:36 +0300
committerCorinna Vinschen <corinna@vinschen.de>2018-07-06 11:29:01 +0300
commitcbe50607fb4741bd96e8de726ad89d0ec3d9f427 (patch)
treeabe144875956f93f185194b317c131c331e3491f /newlib/libm/common/math_config.h
parent6a3e08a53ec996b37639a18dc98123e23531409c (diff)
Fix code style and comments of new math code
Synchronize code style and comments with Arm Optimized Routines, there are no code changes in this patch. This ensures different projects using the same code have consistent code style so bug fix patches can be applied more easily.
Diffstat (limited to 'newlib/libm/common/math_config.h')
-rw-r--r--newlib/libm/common/math_config.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/newlib/libm/common/math_config.h b/newlib/libm/common/math_config.h
index 3a8cebbe3..aec9cd0d6 100644
--- a/newlib/libm/common/math_config.h
+++ b/newlib/libm/common/math_config.h
@@ -233,28 +233,48 @@ eval_as_double (double x)
# define unlikely(x) (x)
#endif
-/* Error handling tail calls for special cases, with sign argument. */
+/* Error handling tail calls for special cases, with a sign argument.
+ The sign of the return value is set if the argument is non-zero. */
+
+/* The result overflows. */
HIDDEN float __math_oflowf (uint32_t);
+/* The result underflows to 0 in nearest rounding mode. */
HIDDEN float __math_uflowf (uint32_t);
+/* The result underflows to 0 in some directed rounding mode only. */
HIDDEN float __math_may_uflowf (uint32_t);
+/* Division by zero. */
HIDDEN float __math_divzerof (uint32_t);
+/* The result overflows. */
HIDDEN double __math_oflow (uint32_t);
+/* The result underflows to 0 in nearest rounding mode. */
HIDDEN double __math_uflow (uint32_t);
+/* The result underflows to 0 in some directed rounding mode only. */
HIDDEN double __math_may_uflow (uint32_t);
+/* Division by zero. */
HIDDEN double __math_divzero (uint32_t);
+
/* Error handling using input checking. */
+
+/* Invalid input unless it is a quiet NaN. */
HIDDEN float __math_invalidf (float);
+/* Invalid input unless it is a quiet NaN. */
HIDDEN double __math_invalid (double);
+
/* Error handling using output checking, only for errno setting. */
+
+/* Check if the result overflowed to infinity. */
HIDDEN double __math_check_oflow (double);
+/* Check if the result underflowed to 0. */
HIDDEN double __math_check_uflow (double);
+/* Check if the result overflowed to infinity. */
static inline double
check_oflow (double x)
{
return WANT_ERRNO ? __math_check_oflow (x) : x;
}
+/* Check if the result underflowed to 0. */
static inline double
check_uflow (double x)
{
@@ -324,7 +344,8 @@ extern const struct powf_log2_data
#define EXP_USE_TOINT_NARROW 0
#define EXP2_POLY_ORDER 5
#define EXP2_POLY_WIDE 0
-extern const struct exp_data {
+extern const struct exp_data
+{
double invln2N;
double shift;
double negln2hiN;
@@ -338,7 +359,8 @@ extern const struct exp_data {
#define LOG_TABLE_BITS 7
#define LOG_POLY_ORDER 6
#define LOG_POLY1_ORDER 12
-extern const struct log_data {
+extern const struct log_data
+{
double ln2hi;
double ln2lo;
double poly[LOG_POLY_ORDER - 1]; /* First coefficient is 1. */
@@ -352,7 +374,8 @@ extern const struct log_data {
#define LOG2_TABLE_BITS 6
#define LOG2_POLY_ORDER 7
#define LOG2_POLY1_ORDER 11
-extern const struct log2_data {
+extern const struct log2_data
+{
double invln2hi;
double invln2lo;
double poly[LOG2_POLY_ORDER - 1];
@@ -365,7 +388,8 @@ extern const struct log2_data {
#define POW_LOG_TABLE_BITS 7
#define POW_LOG_POLY_ORDER 8
-extern const struct pow_log_data {
+extern const struct pow_log_data
+{
double ln2hi;
double ln2lo;
double poly[POW_LOG_POLY_ORDER - 1]; /* First coefficient is 1. */