aboutsummaryrefslogtreecommitdiff
path: root/math/math_config.h
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2018-06-29 11:06:13 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2018-06-29 13:25:58 +0100
commit58ce45c060855f525a26760a2aff22d30bbce7e9 (patch)
tree2e96ba9f96e517f52bbba1cc6cd48cbe5228928a /math/math_config.h
parent5e8389113b47a48622d1de8beb9a4adc2b332694 (diff)
downloadarm-optimized-routines-58ce45c060855f525a26760a2aff22d30bbce7e9.tar.gz
Add documentation comments to internal functions
Explain the semantics of internal functions.
Diffstat (limited to 'math/math_config.h')
-rw-r--r--math/math_config.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/math/math_config.h b/math/math_config.h
index 3986d48..ee44468 100644
--- a/math/math_config.h
+++ b/math/math_config.h
@@ -66,12 +66,16 @@
#if HAVE_FAST_ROUND
# define TOINT_INTRINSICS 1
+/* Round x to nearest int, ties have to be rounded consistently with
+ converttoint. The result is in [-2^31+1, 2^31-1]. */
static inline double_t
roundtoint (double_t x)
{
return round (x);
}
+/* Convert x to nearest int, ties have to be rounded consistently with
+ roundtoint. The result is in [-2^31+1, 2^31-1]. */
static inline uint64_t
converttoint (double_t x)
{
@@ -240,28 +244,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)
{