mirror of
https://github.com/YosysHQ/yosys
synced 2026-03-04 20:50:25 +00:00
More dict/pool related changes
This commit is contained in:
parent
2c2f8e6e9f
commit
6c8b0a5fd1
6 changed files with 77 additions and 54 deletions
|
|
@ -25,10 +25,18 @@
|
|||
|
||||
#define YOSYS_HASHTABLE_SIZE_FACTOR 3
|
||||
|
||||
// The XOR version of DJB2
|
||||
// (traditionally 5381 is used as starting value for the djb2 hash)
|
||||
inline unsigned int mkhash(unsigned int a, unsigned int b) {
|
||||
return ((a << 5) + a) ^ b;
|
||||
}
|
||||
|
||||
// The ADD version of DJB2
|
||||
// (use this version as last call for cache locality in b)
|
||||
inline unsigned int mkhash_add(unsigned int a, unsigned int b) {
|
||||
return ((a << 5) + a) + b;
|
||||
}
|
||||
|
||||
template<typename T> struct hash_ops {
|
||||
bool cmp(const T &a, const T &b) const {
|
||||
return a == b;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue