Re: Long long arithmetic

From: Khimenko Victor (khim@sch57.msk.ru)
Date: Thu Jun 08 2000 - 18:13:28 EST


In <Pine.LNX.4.10.10006081601200.3737-100000@plato.ittc.ukans.edu> pramodh mallipatna (pramodh@ittc.ukans.edu) wrote:
> Hello,

> I am trying to do arithmetic involving a "long long" in the kernel.

Hmm. You can use "+", "-", "<<" and ">>". "/" are forbidden ...

> I am unable to compile the code.

You can not COMPILE the code or you can not link kernel with such code ?
First thing will be VERY unusual, second is expected...

> Is there some configurable option with which I can get it to compile?

No, AFAIK.

> I guess, 8 byte arithmetic should be possible in the kernel as the cpu
> ticks is represented as long long and the time is derived from that.

Why you need 8 byte arithmetic for THAT ? You can use normal IA32 idiv
(64bit/32bit=32bit). No, 8 byte arithmentic is NOT supported in kernel.
It's not bug - it was deliberate decision. It's VERY rarely NEEDED and
in most cases you can use few asm commands instead ...

P.S. Oh, and floating point arithmetic is STRICTLY forbidden in kernel.

-
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:16 EST