137034db8STobias Grosser /* 237034db8STobias Grosser * Copyright 2016 Sven Verdoolaege 337034db8STobias Grosser * 437034db8STobias Grosser * Use of this software is governed by the MIT license 537034db8STobias Grosser * 637034db8STobias Grosser * Written by Sven Verdoolaege 737034db8STobias Grosser */ 837034db8STobias Grosser 937034db8STobias Grosser #include <isl_multi_macro.h> 1037034db8STobias Grosser #include <isl/hash.h> 1137034db8STobias Grosser 1237034db8STobias Grosser /* Return a hash value that digests "multi". 1337034db8STobias Grosser */ FN(MULTI (BASE),get_hash)1437034db8STobias Grosseruint32_t FN(MULTI(BASE),get_hash)(__isl_keep MULTI(BASE) *multi) 1537034db8STobias Grosser { 1637034db8STobias Grosser int i; 1737034db8STobias Grosser uint32_t hash; 1837034db8STobias Grosser 1937034db8STobias Grosser if (!multi) 2037034db8STobias Grosser return 0; 2137034db8STobias Grosser 2237034db8STobias Grosser hash = isl_hash_init(); 2337034db8STobias Grosser for (i = 0; i < multi->n; ++i) { 2437034db8STobias Grosser uint32_t el_hash; 25*6135b0feSTobias Grosser el_hash = FN(EL,get_hash)(multi->u.p[i]); 2637034db8STobias Grosser isl_hash_hash(hash, el_hash); 2737034db8STobias Grosser } 2837034db8STobias Grosser 2937034db8STobias Grosser return hash; 3037034db8STobias Grosser } 31