lkml.org 
[lkml]   [2005]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] NTP shift_right cleanup (v. A1)
From
Date
On Wed, 2005-09-14 at 20:13 +0200, Roman Zippel wrote:
> > @@ -792,13 +769,8 @@ static void update_wall_time_one_tick(vo
> > * advance the tick more.
> > */
> > time_phase += time_adj;
> > - if (time_phase <= -FINENSEC) {
> > - long ltemp = -time_phase >> (SHIFT_SCALE - 10);
> > - time_phase += ltemp << (SHIFT_SCALE - 10);
> > - delta_nsec -= ltemp;
> > - }
> > - else if (time_phase >= FINENSEC) {
> > - long ltemp = time_phase >> (SHIFT_SCALE - 10);
> > + if (abs(time_phase) >= FINENSEC) {
> > + long ltemp = shift_right(time_phase, (SHIFT_SCALE - 10));
> > time_phase -= ltemp << (SHIFT_SCALE - 10);
> > delta_nsec += ltemp;
> > }
>
> I checked and this actually generates worse code.

Well, if I drop the abs() and use:
if ((time_phase >= FINENSEC) || (time_phase <= -FINENSEC))
It looks pretty close in my test. Is that cool with you?

thanks
-john


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-14 20:28    [from the cache]
©2003-2011 Jasper Spaans