aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/quant_util.h
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@arm.com>2021-05-12 10:44:49 -0700
committerKevin Cheng <kevin.cheng@arm.com>2021-05-12 14:51:16 -0700
commit14d7f7a2b5d0d85b83d8c84a5456828feb1a0ea1 (patch)
treec0e5eaa7e119d7998f5780a6c90947e875eddf84 /reference_model/src/quant_util.h
parentd267dd9418374d49ac1e1a1a9c9b1d30b5733ee9 (diff)
downloadreference_model-14d7f7a2b5d0d85b83d8c84a5456828feb1a0ea1.tar.gz
Update to v0.22.0
- remove identityN and placeholder - add div - update serialization_lib hash - update apply_scale_16() assertion - regenerate examples/ due to serialization_lib change Change-Id: I7183d92bec33697c65adfc07cb8eb89c6882675a
Diffstat (limited to 'reference_model/src/quant_util.h')
-rw-r--r--reference_model/src/quant_util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/reference_model/src/quant_util.h b/reference_model/src/quant_util.h
index f07dd10..c595869 100644
--- a/reference_model/src/quant_util.h
+++ b/reference_model/src/quant_util.h
@@ -65,8 +65,8 @@ public:
static int32_t apply_scale_16(int64_t value, int16_t multiplier, int32_t shift)
{
ASSERT_MSG(multiplier >= 0, "apply_scale_16() error: multiplier should >= 0 but is %d", multiplier);
- ASSERT_MSG(value >= -(static_cast<int64_t>(1) << 47) && value < (static_cast<int64_t>(1) << 47),
- "apply_scale_16() error: value should be within [-(1^47), 1^47]");
+ ASSERT_MSG(shift >= 2 && shift <= 62, "apply_scale_16() error: shift should be within [2, 62] but is %d",
+ shift);
int64_t round = 1L << (shift - 1);
int64_t result = value * (int64_t)multiplier + round;
result = result >> shift;