diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2017-06-14 18:00:05 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:15:39 +0100 |
commit | 0a8334cb78dae66fdc31257a96ba15f7c41bde50 (patch) | |
tree | c8e5f290f8a9a674588e1d67f6a623debf9397f7 /tests/validation/FixedPoint.h | |
parent | e5f8fd64a46ce61dac61fd50095a27cfd94930b5 (diff) | |
download | ComputeLibrary-0a8334cb78dae66fdc31257a96ba15f7c41bde50.tar.gz |
COMPMID-400 Add support for 16 bit fixed point arithmetic.
Change-Id: Iebfaef1b219d80d6362b7fd4b1357612b31e43cb
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/77749
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/validation/FixedPoint.h')
-rw-r--r-- | tests/validation/FixedPoint.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/validation/FixedPoint.h b/tests/validation/FixedPoint.h index 380bad04a1..fa99ff84c2 100644 --- a/tests/validation/FixedPoint.h +++ b/tests/validation/FixedPoint.h @@ -756,8 +756,9 @@ struct functions fixed_point<T> a = shift < 0 ? shift_left(x, -shift) : shift_right(x, shift); const fixed_point<T> x_half = shift_right(a, 1); - // We need three iterations to find the result - for(int i = 0; i < 3; ++i) + // We need three iterations to find the result for QS8 and five for QS16 + constexpr int num_iterations = std::is_same<T, int8_t>::value ? 3 : 5; + for(int i = 0; i < num_iterations; ++i) { a = mul(a, sub(three_half, mul(x_half, mul(a, a)))); } |