diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-24 09:33:51 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-24 09:33:51 +0200 |
| commit | d02bd0eb656b885bdf48088529183c40df8bd9c1 (patch) | |
| tree | 799a8b5ff0c55978235d7c8bf69e2940d427c5f3 /dev/lib/logic | |
| parent | 3c50f5e98f28be7a9909c02172da6e627fd2b665 (diff) | |
feat: lib: micro-optimizations and improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/logic')
| -rw-r--r-- | dev/lib/logic/equiv.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dev/lib/logic/equiv.hpp b/dev/lib/logic/equiv.hpp index 2f63673..75fd8ee 100644 --- a/dev/lib/logic/equiv.hpp +++ b/dev/lib/logic/equiv.hpp @@ -7,6 +7,7 @@ #pragma once +/// @brief SOCL equivalence namespace. namespace snu::equiv { template <typename T> @@ -59,7 +60,7 @@ namespace snu::equiv struct equiv_is_int8 { private: - T left_ = 255, right_ = 255; + T left_ = 127, right_ = 127; public: using result = T; @@ -74,7 +75,8 @@ namespace snu::equiv struct equiv_not_int8 { private: - T left_ = 255, right_ = 255; + // these shall overflow if not int8. + T left_ = 127, right_ = 127; public: using result = T; @@ -96,7 +98,7 @@ namespace snu::equiv constexpr result hash() { - return left_ / right_; + return left_ / right_ == 1; } }; -} // namespace snu::equiv
\ No newline at end of file +} // namespace snu::equiv |
