[PATCH] powerpc: Take 5, merge page.h
Kumar Gala
galak at kernel.crashing.org
Sat Nov 12 06:16:03 EST 2005
On Nov 11, 2005, at 11:53 AM, Arnd Bergmann wrote:
> On Freedag 11 November 2005 18:17, Milton Miller wrote:
>> Can the compiler optimize the first one to the second? Can
>> we always use the first version?
>>
>
> I tried this out and found that gcc-2.95, 3.2, 3.3 and 3.4
> can not, but 4.0 can.
>
> They can all generate the same object code if you do it like
>
> void copy_page(void *to, void *from)
> {
> unsigned int i;
> if (PAGE_SHIFT == 12)
> copy_4K_page(to, from);
> else for (i=0; i < (1 << (PAGE_SHIFT - 12)); i++) {
> copy_4K_page(to, from);
> to += 4096;
> from += 4096;
> }
> }
I think its clear to leave the origonal version with the #ifdef since
it clearly shows we are doing something for 64K page that is special.
- kumar
More information about the Linuxppc64-dev
mailing list