summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-05-13 13:25:41 -0700
committerMatt Turner <[email protected]>2016-05-16 11:06:15 -0700
commit1385018a72ece9f431fba565508ada400b469201 (patch)
tree731488c6f7d0f906c81dbd27528b4ddd8e880f1a
parent41915512624b26f10ebc2e7c41e9b982fb9208bb (diff)
genxml: Use llroundf() and store to appropriate type.
Both functions return uint64_t, so I expect the masking/shifting should be done on 64-bit types. Reviewed-by: Kristian Høgsberg <[email protected]>
-rw-r--r--src/intel/genxml/gen_pack_header.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py
index 9ef7122ae9e..47870b30cea 100644
--- a/src/intel/genxml/gen_pack_header.py
+++ b/src/intel/genxml/gen_pack_header.py
@@ -131,7 +131,7 @@ __gen_sfixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits)
assert(min <= v && v <= max);
#endif
- const int32_t int_val = roundf(v * factor);
+ const int64_t int_val = llroundf(v * factor);
const uint64_t mask = ~0ull >> (64 - (end - start + 1));
return (int_val & mask) << start;
@@ -150,7 +150,7 @@ __gen_ufixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits)
assert(min <= v && v <= max);
#endif
- const uint32_t uint_val = roundf(v * factor);
+ const uint64_t uint_val = llroundf(v * factor);
return uint_val << start;
}