aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops
diff options
context:
space:
mode:
Diffstat (limited to 'reference_model/src/ops')
-rw-r--r--reference_model/src/ops/ewise_binary.cc2
-rw-r--r--reference_model/src/ops/template_types.h34
2 files changed, 18 insertions, 18 deletions
diff --git a/reference_model/src/ops/ewise_binary.cc b/reference_model/src/ops/ewise_binary.cc
index c697db0..16386af 100644
--- a/reference_model/src/ops/ewise_binary.cc
+++ b/reference_model/src/ops/ewise_binary.cc
@@ -434,7 +434,7 @@ int OpMul<Rank, InDtype, OutDtype>::register_fcn()
int64_t result;
if (shift > 0)
{
- int64_t round = 1L << (shift - 1);
+ int64_t round = INT64_C(1) << (shift - 1);
result = static_cast<int64_t>(a) * static_cast<int64_t>(b) + round;
result = result >> shift;
diff --git a/reference_model/src/ops/template_types.h b/reference_model/src/ops/template_types.h
index 6b28502..ece14b1 100644
--- a/reference_model/src/ops/template_types.h
+++ b/reference_model/src/ops/template_types.h
@@ -1,5 +1,5 @@
-// Copyright (c) 2020-2022, ARM Limited.
+// Copyright (c) 2020-2023, ARM Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -196,83 +196,83 @@ struct GetNumBits<DType_FP16>
template <DType T>
struct GetQMin
{
- static constexpr int64_t value = 0L;
+ static constexpr int64_t value = INT64_C(0);
};
template <>
struct GetQMin<DType_UINT8>
{
- static constexpr int64_t value = 0L;
+ static constexpr int64_t value = INT64_C(0);
};
template <>
struct GetQMin<DType_UINT16>
{
- static constexpr int64_t value = 0L;
+ static constexpr int64_t value = INT64_C(0);
};
template <>
struct GetQMin<DType_INT4>
{
- static constexpr int64_t value = -8L;
+ static constexpr int64_t value = INT64_C(-8);
};
template <>
struct GetQMin<DType_INT8>
{
- static constexpr int64_t value = -128L;
+ static constexpr int64_t value = INT64_C(-128);
};
template <>
struct GetQMin<DType_INT16>
{
- static constexpr int64_t value = -32768L;
+ static constexpr int64_t value = INT64_C(-32768);
};
template <>
struct GetQMin<DType_INT32>
{
- static constexpr int64_t value = -(1L << 31);
+ static constexpr int64_t value = -(INT64_C(1) << 31);
};
template <>
struct GetQMin<DType_INT48>
{
- static constexpr int64_t value = -(1L << 47);
+ static constexpr int64_t value = -(INT64_C(1) << 47);
};
template <DType T>
struct GetQMax
{
- static constexpr int64_t value = 0L;
+ static constexpr int64_t value = INT64_C(0);
};
template <>
struct GetQMax<DType_UINT8>
{
- static constexpr int64_t value = 255L;
+ static constexpr int64_t value = INT64_C(255);
};
template <>
struct GetQMax<DType_UINT16>
{
- static constexpr int64_t value = 65535L;
+ static constexpr int64_t value = INT64_C(65535);
};
template <>
struct GetQMax<DType_INT4>
{
- static constexpr int64_t value = 7L;
+ static constexpr int64_t value = INT64_C(7);
};
template <>
struct GetQMax<DType_INT8>
{
- static constexpr int64_t value = 127L;
+ static constexpr int64_t value = INT64_C(127);
};
template <>
struct GetQMax<DType_INT16>
{
- static constexpr int64_t value = 32767L;
+ static constexpr int64_t value = INT64_C(32767);
};
template <>
struct GetQMax<DType_INT32>
{
- static constexpr int64_t value = (1L << 31) - 1;
+ static constexpr int64_t value = (INT64_C(1) << 31) - 1;
};
template <>
struct GetQMax<DType_INT48>
{
- static constexpr int64_t value = (1L << 47) - 1;
+ static constexpr int64_t value = (INT64_C(1) << 47) - 1;
};
}; // namespace TosaReference