aboutsummaryrefslogtreecommitdiffstats
path: root/common/hashlib.h
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-06-02 10:01:36 +0100
committergatecat <gatecat@ds0.me>2021-06-02 15:05:19 +0100
commitecc19c2c083f7e3ed7da95557731ded803d2cb1d (patch)
tree864780d38cb9a49b6846a0045ac93e1b4dfcc88d /common/hashlib.h
parentf4fed62c05a9595e22a8ec54add5531225911741 (diff)
downloadnextpnr-ecc19c2c083f7e3ed7da95557731ded803d2cb1d.tar.gz
nextpnr-ecc19c2c083f7e3ed7da95557731ded803d2cb1d.tar.bz2
nextpnr-ecc19c2c083f7e3ed7da95557731ded803d2cb1d.zip
Using hashlib in arches
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/hashlib.h')
-rw-r--r--common/hashlib.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/hashlib.h b/common/hashlib.h
index 30fefc65..063df78f 100644
--- a/common/hashlib.h
+++ b/common/hashlib.h
@@ -74,6 +74,15 @@ template <> struct hash_ops<int64_t> : hash_int_ops
static inline unsigned int hash(int64_t a) { return mkhash((unsigned int)(a), (unsigned int)(a >> 32)); }
};
+template <> struct hash_ops<uint32_t> : hash_int_ops
+{
+ static inline unsigned int hash(uint32_t a) { return a; }
+};
+template <> struct hash_ops<uint64_t> : hash_int_ops
+{
+ static inline unsigned int hash(uint64_t a) { return mkhash((unsigned int)(a), (unsigned int)(a >> 32)); }
+};
+
template <> struct hash_ops<std::string>
{
static inline bool cmp(const std::string &a, const std::string &b) { return a == b; }