From ce6e02cec3a06d991e112f0f875123f1d1f928dc Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Fri, 11 Mar 2022 15:12:38 -0800 Subject: Update floating point edge cases Cover cases where NaN, +/- 0, +/- infinity are involved Signed-off-by: Eric Kunze Change-Id: I1a5a23c7b856ddb997f7cdc00282420294ef3e6d --- chapters/introduction.adoc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'chapters/introduction.adoc') diff --git a/chapters/introduction.adoc b/chapters/introduction.adoc index 2827399..fe4f724 100644 --- a/chapters/introduction.adoc +++ b/chapters/introduction.adoc @@ -351,7 +351,7 @@ Most operations in TOSA do not contain quantization scaling in the operation, bu The apply_scale functions provide a scaling of approximately (multiplier * 2^-shift^). The shift and value range is limited to allow a variety of implementations. The limit of 62 on shift allows the shift to be decomposed as two right shifts of 31. -The limit on value allows implementations that left shift the value before the mutliply in the case of shifts of 32 or less. +The limit on value allows implementations that left shift the value before the multiply in the case of shifts of 32 or less. For example, in the case shift=30 an implementation of the form ((value\<<2) * multiplier + round)>>32 can be used. A scaling range of 2^+12^ down to 2^-32^ is supported for both functions with a normalized multiplier. @@ -482,12 +482,23 @@ These features ensure that detection of overflow and other exceptional condition |=== |Case|Result -|Any input operand is a NaN | a NaN +|Operators other than explicitly mentioned by other rules: Any input operand is a NaN | a NaN +|Comparisons (EQUAL, GREATER, GREATER_EQUAL), where either or both operands is NaN | False + +|Comparisons ignore the sign of 0| + +|RSQRT (reciprocal square root) of negative numbers | a NaN |(± 0) × (± infinity), (± infinity) × (± 0) | a NaN +|LOG of negative numbers | a NaN + +|nonzero numbers / (± 0) | (± infinity) + |(± 0) / (± 0), (± infinity) / (± infinity) | a NaN +|(± infinity) * 0 | a NaN + | (+infinity) - (+infinity), (+infinity) + (-infinity) | a NaN | Any positive overflow | + infinity -- cgit v1.2.1