mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-18 11:38:06 +02:00
intel/perf: use the right popcount for 64bits
We're currently using the 32bit version which is dropping half the
bits of the 64bits values.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11607>
(cherry picked from commit 71b7c7b0dc)
This commit is contained in:
parent
d42e8c8f6c
commit
f1e122758e
2 changed files with 7 additions and 7 deletions
|
|
@ -463,7 +463,7 @@
|
|||
"description": "intel/perf: use the right popcount for 64bits",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -375,11 +375,11 @@ compute_topology_builtins(struct gen_perf_config *perf,
|
|||
|
||||
for (int i = 0; i < sizeof(devinfo->subslice_masks[i]); i++) {
|
||||
perf->sys_vars.n_eu_sub_slices +=
|
||||
__builtin_popcount(devinfo->subslice_masks[i]);
|
||||
util_bitcount(devinfo->subslice_masks[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < sizeof(devinfo->eu_masks); i++)
|
||||
perf->sys_vars.n_eus += __builtin_popcount(devinfo->eu_masks[i]);
|
||||
perf->sys_vars.n_eus += util_bitcount(devinfo->eu_masks[i]);
|
||||
|
||||
perf->sys_vars.eu_threads_count = devinfo->num_thread_per_eu;
|
||||
|
||||
|
|
@ -895,7 +895,7 @@ get_passes_mask(struct gen_perf_config *perf,
|
|||
assert(counter_indices[i] < perf->n_counters);
|
||||
|
||||
uint32_t idx = counter_indices[i];
|
||||
if (__builtin_popcount(perf->counter_infos[idx].query_mask) != (q + 1))
|
||||
if (util_bitcount64(perf->counter_infos[idx].query_mask) != (q + 1))
|
||||
continue;
|
||||
|
||||
if (queries_mask & perf->counter_infos[idx].query_mask)
|
||||
|
|
@ -924,7 +924,7 @@ gen_perf_get_n_passes(struct gen_perf_config *perf,
|
|||
}
|
||||
}
|
||||
|
||||
return __builtin_popcount(queries_mask);
|
||||
return util_bitcount64(queries_mask);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -934,7 +934,7 @@ gen_perf_get_counters_passes(struct gen_perf_config *perf,
|
|||
struct gen_perf_counter_pass *counter_pass)
|
||||
{
|
||||
uint64_t queries_mask = get_passes_mask(perf, counter_indices, counter_indices_count);
|
||||
ASSERTED uint32_t n_passes = __builtin_popcount(queries_mask);
|
||||
ASSERTED uint32_t n_passes = util_bitcount64(queries_mask);
|
||||
|
||||
for (uint32_t i = 0; i < counter_indices_count; i++) {
|
||||
assert(counter_indices[i] < perf->n_counters);
|
||||
|
|
@ -946,7 +946,7 @@ gen_perf_get_counters_passes(struct gen_perf_config *perf,
|
|||
counter_pass[i].query = &perf->queries[query_idx];
|
||||
|
||||
uint32_t clear_bits = 63 - query_idx;
|
||||
counter_pass[i].pass = __builtin_popcount((queries_mask << clear_bits) >> clear_bits) - 1;
|
||||
counter_pass[i].pass = util_bitcount64((queries_mask << clear_bits) >> clear_bits) - 1;
|
||||
assert(counter_pass[i].pass < n_passes);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue