aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/type_conversion.h
diff options
context:
space:
mode:
authorTatWai Chong <tatwai.chong@arm.com>2024-04-02 15:45:29 -0700
committerEric Kunze <eric.kunze@arm.com>2024-04-08 17:09:38 +0000
commit0dac6c90a1ed753d1018077be83941834f937601 (patch)
treea6c59981ac161d12df7a4deb65bca14905465d4d /reference_model/src/ops/type_conversion.h
parent129201df8126a16abb0e4fbf7372354021f8a55d (diff)
downloadreference_model-0dac6c90a1ed753d1018077be83941834f937601.tar.gz
Fix the wrong QMax and QMin type assignment in rescale op
Signed integer type is used to retain QMax and QMin no matter what the value of `output_unsigned` is, but the value of QMax and QMin are unsigned integer when output_unsigned is true. Also add a handful of arithmetic helpers to align the pseudo code. Change-Id: Ie3cd444a290ddae08884186cd4b349a88acad032 Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Diffstat (limited to 'reference_model/src/ops/type_conversion.h')
-rw-r--r--reference_model/src/ops/type_conversion.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/reference_model/src/ops/type_conversion.h b/reference_model/src/ops/type_conversion.h
index cf95f16..0636357 100644
--- a/reference_model/src/ops/type_conversion.h
+++ b/reference_model/src/ops/type_conversion.h
@@ -60,6 +60,15 @@ protected:
TosaReference::TensorTemplate<TMultiplierI16>* multiplierI16;
TosaReference::TensorTemplate<TMultiplierI32>* multiplierI32;
TosaReference::TensorTemplate<TShift>* shift;
+
+ // The maximum value when interpreting OutDtype as a signed value
+ int32_t QMax_s;
+ // The minimum value when interpreting OutDtype as a signed value
+ int32_t QMin_s;
+ // The maximum value when interpreting OutDtype as an unsigned value
+ uint32_t QMax_u;
+ // The minimum value when interpreting OutDtype as an unsigned value
+ uint32_t QMin_u;
};
template <TOSA_REF_TYPE InDtype, TOSA_REF_TYPE OutDtype>