Re: Long long arithmetic

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Fri Jun 09 2000 - 09:11:52 EST


On Fri, 9 Jun 2000, Peter Samuelson wrote:

>
> [Richard B. Johnson <root@chaos.analogic.com>]
> > I suggest borrowing some long long stuff from the libgcc source and
> > putting it into the kernel. We keep getting hit by requests for long
> > long division.
> >
> > This would quiet that and, if the resulting drivers or other code
> > eventually get into the kernel it will probably get fixed to not have
> > to use the CPU-hog divide.
>
> You really think so? I very much doubt it. For most instances of this
> sort of thing it's not obvious just from staring at the code that
> there's a long long involved. It either just works, or it just fails
> to link, and if the latter, you find it and replace with a shift.
>
Well some of the stuff is one-time execution such as signon-messages.
Somebody, knowing that floating-point is not allowed, may try to
come up with a readable fixed-point fraction for display. The
nature of the fraction precludes shifts since the idea is to get
a decimal value to put after a '.'.

I don't like linking against the 'C' runtime library. But we could
certainly 'swipe' a few long-long functions and put them into the kernel.

Cheers,
Dick Johnson

Penguin : Linux version 2.3.41 on an i686 machine (800.63 BogoMips).

-
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/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:18 EST