[libc-commits] [libc] [llvm] [libc] Move printf long double to simple calc (PR #75414)

via libc-commits libc-commits at lists.llvm.org
Fri Dec 22 06:41:33 PST 2023


================
@@ -152,15 +157,17 @@ LIBC_INLINE constexpr uint32_t ceil_log10_pow2(const uint32_t e) {
   return log10_pow2(e) + 1;
 }
 
+LIBC_INLINE constexpr uint32_t div_ceil(const uint32_t num,
+                                        const uint32_t denom) {
+  return (num + (denom - 1)) / denom;
----------------
lntue wrote:

Can you double check if  this division is optimized to multiplication or shifts in the generated codes since `BLOCK_SIZE` is constant?

https://github.com/llvm/llvm-project/pull/75414


More information about the libc-commits mailing list