lkml.org 
[lkml]   [2000]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 64 bit divide/mod in 2.4.0-test5
"Jeff V. Merkey" wrote:
>
> Linus.
>
> a = val >> shift
>
> for 64 bits divides and
>
> a = val >> shift;
> b = val - (a << shift)
>
> for 64 bit modulo operations

I suppose this is faster:

a = val & ((1ULL << shift) - 1)

--
Abramo Bagnara mailto:abramo@alsa-project.org

Opera Unica
Via Emilia Interna, 140 Phone: +39.0546.656023
48014 Castel Bolognese (RA) - Italy Fax: +39.0546.656023

ALSA project is http://www.alsa-project.org
sponsored by SuSE Linux http://www.suse.com

It sounds good!

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

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.057 / U:2.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site