Lines Matching refs:hash
86 #define HASH(hash, data) XXH32(&(data), sizeof(data), hash) argument
89 hash_src(uint32_t hash, const nir_src *src) in hash_src() argument
92 hash = HASH(hash, src->ssa); in hash_src()
93 return hash; in hash_src()
97 hash_alu_src(uint32_t hash, const nir_alu_src *src, unsigned num_components) in hash_alu_src() argument
99 hash = HASH(hash, src->abs); in hash_alu_src()
100 hash = HASH(hash, src->negate); in hash_alu_src()
103 hash = HASH(hash, src->swizzle[i]); in hash_alu_src()
105 hash = hash_src(hash, &src->src); in hash_alu_src()
106 return hash; in hash_alu_src()
110 hash_alu(uint32_t hash, const nir_alu_instr *instr) in hash_alu() argument
112 hash = HASH(hash, instr->op); in hash_alu()
117 hash = HASH(hash, flags); in hash_alu()
119 hash = HASH(hash, instr->dest.dest.ssa.num_components); in hash_alu()
120 hash = HASH(hash, instr->dest.dest.ssa.bit_size); in hash_alu()
125 uint32_t hash0 = hash_alu_src(hash, &instr->src[0], in hash_alu()
127 uint32_t hash1 = hash_alu_src(hash, &instr->src[1], in hash_alu()
135 hash = hash0 * hash1; in hash_alu()
138 hash = hash_alu_src(hash, &instr->src[i], in hash_alu()
143 hash = hash_alu_src(hash, &instr->src[i], in hash_alu()
148 return hash; in hash_alu()
152 hash_deref(uint32_t hash, const nir_deref_instr *instr) in hash_deref() argument
154 hash = HASH(hash, instr->deref_type); in hash_deref()
155 hash = HASH(hash, instr->modes); in hash_deref()
156 hash = HASH(hash, instr->type); in hash_deref()
159 return HASH(hash, instr->var); in hash_deref()
161 hash = hash_src(hash, &instr->parent); in hash_deref()
165 hash = HASH(hash, instr->strct.index); in hash_deref()
170 hash = hash_src(hash, &instr->arr.index); in hash_deref()
174 hash = HASH(hash, instr->cast.ptr_stride); in hash_deref()
175 hash = HASH(hash, instr->cast.align_mul); in hash_deref()
176 hash = HASH(hash, instr->cast.align_offset); in hash_deref()
188 return hash; in hash_deref()
192 hash_load_const(uint32_t hash, const nir_load_const_instr *instr) in hash_load_const() argument
194 hash = HASH(hash, instr->def.num_components); in hash_load_const()
199 hash = HASH(hash, b); in hash_load_const()
203 hash = XXH32(instr->value, size, hash); in hash_load_const()
206 return hash; in hash_load_const()
218 hash_phi(uint32_t hash, const nir_phi_instr *instr) in hash_phi() argument
220 hash = HASH(hash, instr->instr.block); in hash_phi()
233 hash = hash_src(hash, &srcs[i]->src); in hash_phi()
234 hash = HASH(hash, srcs[i]->pred); in hash_phi()
237 return hash; in hash_phi()
241 hash_intrinsic(uint32_t hash, const nir_intrinsic_instr *instr) in hash_intrinsic() argument
244 hash = HASH(hash, instr->intrinsic); in hash_intrinsic()
247 hash = HASH(hash, instr->dest.ssa.num_components); in hash_intrinsic()
248 hash = HASH(hash, instr->dest.ssa.bit_size); in hash_intrinsic()
251 hash = XXH32(instr->const_index, info->num_indices * sizeof(instr->const_index[0]), hash); in hash_intrinsic()
254 hash = hash_src(hash, &instr->src[i]); in hash_intrinsic()
256 return hash; in hash_intrinsic()
260 hash_tex(uint32_t hash, const nir_tex_instr *instr) in hash_tex() argument
262 hash = HASH(hash, instr->op); in hash_tex()
263 hash = HASH(hash, instr->num_srcs); in hash_tex()
266 hash = HASH(hash, instr->src[i].src_type); in hash_tex()
267 hash = hash_src(hash, &instr->src[i].src); in hash_tex()
270 hash = HASH(hash, instr->coord_components); in hash_tex()
271 hash = HASH(hash, instr->sampler_dim); in hash_tex()
272 hash = HASH(hash, instr->is_array); in hash_tex()
273 hash = HASH(hash, instr->is_shadow); in hash_tex()
274 hash = HASH(hash, instr->is_new_style_shadow); in hash_tex()
276 hash = HASH(hash, component); in hash_tex()
279 hash = HASH(hash, instr->tg4_offsets[i][j]); in hash_tex()
280 hash = HASH(hash, instr->texture_index); in hash_tex()
281 hash = HASH(hash, instr->sampler_index); in hash_tex()
282 hash = HASH(hash, instr->texture_non_uniform); in hash_tex()
283 hash = HASH(hash, instr->sampler_non_uniform); in hash_tex()
285 return hash; in hash_tex()
298 uint32_t hash = 0; in hash_instr() local
302 hash = hash_alu(hash, nir_instr_as_alu(instr)); in hash_instr()
305 hash = hash_deref(hash, nir_instr_as_deref(instr)); in hash_instr()
308 hash = hash_load_const(hash, nir_instr_as_load_const(instr)); in hash_instr()
311 hash = hash_phi(hash, nir_instr_as_phi(instr)); in hash_instr()
314 hash = hash_intrinsic(hash, nir_instr_as_intrinsic(instr)); in hash_instr()
317 hash = hash_tex(hash, nir_instr_as_tex(instr)); in hash_instr()
323 return hash; in hash_instr()