summaryrefslogtreecommitdiffstats
path: root/src/intel/tools
diff options
context:
space:
mode:
authorSirisha Gandikota <Sirisha.Gandikota@intel.com>2016-09-13 16:19:29 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-09-13 16:32:24 -0700
commit5d2440532f8ffe80faa9b818fa0c1abff312486f (patch)
treec85f854b4485375d294d7341edafbcdb9b9e96a9 /src/intel/tools
parent1eebb60917d0d4462eb16c72d17050d5d21d438a (diff)
downloadexternal_mesa3d-5d2440532f8ffe80faa9b818fa0c1abff312486f.zip
external_mesa3d-5d2440532f8ffe80faa9b818fa0c1abff312486f.tar.gz
external_mesa3d-5d2440532f8ffe80faa9b818fa0c1abff312486f.tar.bz2
aubinator: Simplify print_dword_val() method
Remove the float/dword union and use the iter->p[f->start / 32] directly as printf formatter %08x expects uint32_t (Ken) v2: Make the cleanup much more crispier (Ken) Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/intel/tools')
-rw-r--r--src/intel/tools/aubinator.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 9d29b68..89d29f2 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -91,18 +91,14 @@ print_dword_val(struct gen_field_iterator *iter, uint64_t offset,
int *dword_num)
{
struct gen_field *f;
- union {
- uint32_t dw;
- float f;
- } v;
f = iter->group->fields[iter->i - 1];
- v.dw = iter->p[f->start / 32];
+ const int dword = f->start / 32;
- if (*dword_num != (f->start / 32)) {
+ if (*dword_num != dword) {
printf("0x%08lx: 0x%08x : Dword %d\n",
- offset + 4 * (f->start / 32), v.dw, f->start / 32);
- *dword_num = (f->start / 32);
+ offset + 4 * dword, iter->p[dword], dword);
+ *dword_num = dword;
}
}