Re: [PATCH] new system call mknod64

Jamie Lokier
2003-04-21T23:38:07Z

H. Peter Anvin wrote:
> > and in fact the patches I have been giving out use kdev_t
> > as internal format, where you can think of kdev_t as
> > u64, or, if you prefer, as struct { u32 major, minor; }.
>
> Any reason why we don't just *make it* a struct? (Well, besides that
> it'd somewhat suck on 64-bit architectures?)

It varies very much between architectures.

I just checked, and simple copies of this structure are absolutely
atrocious in GCC 3.2 (I tried Alpha, Mips64 and Sparc64). The code
was approx. 3 times longer to copy the 32:32 struct than to copy a 64
bit scalar.

On x86_64, the struct produces the same code as the scalar.
The same is true on s390x.

If you change this to test 16:16, on i386 (or x86_64 with -m32),
the struct still produces the same code as the scalar.

Looks like a part of GCC that might be easy to improve, given that it
works quite well on some architectures already.

-- Jamie