Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692728 > unrolled thread

Re: [PATCH] Optimize int_sqrt for small values for faster idle

Started byPeter Zijlstra <peterz@infradead.org>
First post2017-07-20 12:20 +0200
Last post2017-07-24 15:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] Optimize int_sqrt for small values for faster idle Peter Zijlstra <peterz@infradead.org> - 2017-07-20 12:20 +0200
    Re: [PATCH] Optimize int_sqrt for small values for faster idle Eric Dumazet <eric.dumazet@gmail.com> - 2017-07-24 15:30 +0200

#1692728 — Re: [PATCH] Optimize int_sqrt for small values for faster idle

FromPeter Zijlstra <peterz@infradead.org>
Date2017-07-20 12:20 +0200
SubjectRe: [PATCH] Optimize int_sqrt for small values for faster idle
Message-ID<u5gIO-5VF-19@gated-at.bofh.it>
On Mon, Feb 01, 2016 at 04:36:38PM -0800, Eric Dumazet wrote:
> On Tue, 2016-02-02 at 00:08 +0100, Rasmus Villemoes wrote:
> 
> > Thanks. (Is there a good way to tell gcc that avg*avg is actually a
> > 32x32->64 multiplication?)
> 
> If avg is 32bit, compiler does that for you.
> 
> u32 avg = ...
> 
> u64 result = (u64)avg * avg;

It does not in fact do that :/ See commit:

  9e3d6223d209 ("math64, timers: Fix 32bit mul_u64_u32_shr() and friends")

[toc] | [next] | [standalone]


#1694708

FromEric Dumazet <eric.dumazet@gmail.com>
Date2017-07-24 15:30 +0200
Message-ID<u6LAS-5qf-19@gated-at.bofh.it>
In reply to#1692728
On Thu, 2017-07-20 at 12:10 +0200, Peter Zijlstra wrote:
> On Mon, Feb 01, 2016 at 04:36:38PM -0800, Eric Dumazet wrote:
> > On Tue, 2016-02-02 at 00:08 +0100, Rasmus Villemoes wrote:
> > 
> > > Thanks. (Is there a good way to tell gcc that avg*avg is actually a
> > > 32x32->64 multiplication?)
> > 
> > If avg is 32bit, compiler does that for you.
> > 
> > u32 avg = ...
> > 
> > u64 result = (u64)avg * avg;
> 
> It does not in fact do that :/ See commit:
> 
>   9e3d6223d209 ("math64, timers: Fix 32bit mul_u64_u32_shr() and friends")

Interesting :/

Thanks for letting me know !

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web