diff options
author | Marek Olšák <[email protected]> | 2018-10-05 20:42:16 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-10-10 13:13:12 -0500 |
commit | a9be8dddfedb1d19e43b900bdfd33731d3c390c4 (patch) | |
tree | 37cd91ed7405fe7c2ee460ffe6e7a7a928c27672 /src/util/fast_idiv_by_const.h | |
parent | 7cde4dbcd750dabc74185da058844d43928fa206 (diff) |
util: Add power-of-two divisor support to compute_fast_udiv_info
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/util/fast_idiv_by_const.h')
-rw-r--r-- | src/util/fast_idiv_by_const.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/fast_idiv_by_const.h b/src/util/fast_idiv_by_const.h index 231311f84be..92a3ccdf222 100644 --- a/src/util/fast_idiv_by_const.h +++ b/src/util/fast_idiv_by_const.h @@ -98,8 +98,8 @@ util_compute_fast_sdiv_info(int64_t D, unsigned SINT_BITS); * emit("result >>>= UINT_BITS") * if m.post_shift > 0: emit("result >>>= m.post_shift") * - * The shifts by UINT_BITS may be "free" if the high half of the full multiply - * is put in a separate register. + * This second version works even if D is 1. The shifts by UINT_BITS may be + * "free" if the high half of the full multiply is put in a separate register. * * saturated_increment(n) means "increment n unless it would wrap to 0," i.e. * if n == (1 << UINT_BITS)-1: result = n |