lkml.org 
[lkml]   [1999]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 64 bit arithmetic in the kernel
Michael Richardson wrote:
> Is there any easy way to get things like the stuff that it
> is in libgcc1.a into the Linux kernel? I have need for 64/32 integer divide
> (gcc calls __udivdi3).
> This is with 2.2.10, on a Lintel box, and I'm using a module.

Richard Johnson wrote:
> Use inline asm. In Intel, you put the high long-word into edx, the low
> long-word into eax, and "div" either by an immediate or something in, say
> the ecx register. The result is a long-word in eax, with the remainder
> in edx.
>
> This results in an unsigned integer divide, which is what the __udivxxx
> means.

Actually __udivdi3 is a 64/64 -> 64 divide, while the "div" instruction
is 64/32 -> 32. Apples and pears.

-- Jamie

-
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:52    [W:0.135 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site