lkml.org 
[lkml]   [2000]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Patch to remove undefined C code
From
Date
Bill Wendling <wendling@ganymede.isdn.uiuc.edu> writes:
> Also sprach Bernd Schmidt:
> } > Looking at the above code, I noticed that there are a lot of ++
> } > operations. I rewrote the code as:
> } >
> } > setup_from[0] = setup_from[1] = eaddrs[0];
> } > setup_from[2] = setup_from[3] = eaddrs[1];
> } > setup_from[4] = setup_from[5] = eaddrs[2];
> } > setup_from += 6;
> } >
> } > I compiled using "gcc -S -Wall -O2 -fomit-frame-pointer -m486"
> } > to generate the assembler code. The old code is 17 instructions
> } > long and the new code is 11 instructions. As well as being
> } > shorter, simple timing test indicate that the new code is
> } > significantly quicker.
> }
> } This is something the compiler ought to know about.
>
> A compiler can only guess so much. Don't look to a compiler to fix poorly
> written code...

While I agree with this sentiment, I'll probably go with what Bernd
Schmidt says in this case. He is, after all, the expert on that part
of GCC (CSE, loop opts, flow, etc.).

- Hari
--
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions." -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing." -- Roy L Ash
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.162 / U:5.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site