lkml.org 
[lkml]   [1996]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 64-bit math in the kernel
Date

Followup to: <199611150027.TAA11071@denali.ccs.neu.edu>
By author: Albert Cahalan <albert@ccs.neu.edu>
In newsgroup: linux.dev.kernel
>
> What is the best way to divide a __u64 by a __u32 in the kernel?
> The result will fit in a __u32.
>

There is no way to express that in C, but the x86 DIV instruction will
do exactly that. It sounds like adding some inline assembly functions
(which needs to go into include/asm-* and need equivalents for all
architectures) probably is in order.

Furthermore, it might be worthwhile to provide the equivalent of
libgcc in the kernel.

-hpa

--
Not speaking for Transmeta in any way, shape or form.

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