Re: [RFC][PATCH] first cut 64 bit block support

Chris Wedgwood
2001-07-04T10:17:36Z

On Sun, Jul 01, 2001 at 12:53:25AM -0400, Ben LaHaise wrote:

> Ugly bits: I had to add libgcc.a to satisfy the need for 64 bit
> division. Yeah, it sucks, but RAID needs some more massaging before
> I can remove the 64 bit division completely. This will be fixed.

I would rather see this code removed from libgcc and put into a
function (optionally inline) such that code like:

__u64 foo(__u64 a, __u64 b)
{
__u64 t;

t = a * SOME_CONST + b;

return t / BLEM;
}

would really look like:

__64 foo(__u64 a, __u64 b)
{
__u64 t;

t = 64b_mul(a, SOME_CONST) + b;

return 64b_udiv(t, BLEM);
}

such that for peopel to use 64-bit operations on the kernel, they have
to explicity code them in, not just accidentialyl change a variable
type and have gcc/libgcc hide this fact from them.

Note, I use __u64 not "long long" as I'm not 100% "long long" will
mean 64-bits on all future architectures (it would be cool, for
example, if it was 128-bit on some!).

What do you think? Would you accept patches for either of these?

--cw