Re: Mostly portable strnlen_user()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 May 2012 19:13:31 -0700

> One issue is just syntactic: the fact that you want to initialize
> those constants just results in nasty syntax. Is gcc really so bad on
> sparc that it doesn't do the obvious CSE etc on the constants? That
> surprises me, because it does it on x86-64..

It CSE's them into the loop, but like I said a few days
ago it doesn't CSE them into the find_zero() code block.

> Do you *really* need to CSE them by hand?

Yes, GCC refused to do it.

It CSEs it into the loop, but not the tail code.

> So how bad does the code look on sparc if you just get rid of the
> "low_bits" and "high_bits" and just replace them with the constants
> they are?

It looks like GCC reconstituting the constants for the zero byte
determination, which on 64-bit is nearly half of the instructions
of the exit path.

But you shouldn't really need to care about this, we can surely
abstract it behind something.
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux