This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Average number of instructions per line of kernel code
- From: Tom St Denis <tstdenis at ellipticsemi dot com>
- To: bamakhrama at gmail dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 30 Aug 2007 09:08:21 -0400
- Subject: Re: Average number of instructions per line of kernel code
- References: <40378e40708300603j71da3108hf09bbb3facc77935@mail.gmail.com>
Mohamed Bamakhrama wrote:
> Hi all,
> I have a question regarding the average number of assembly
> instructions per line of kernel code. I know that this is a difficult
> question since it depends on many factors such as the instruction set
> architecture, compiler used, optimizations used, type of code, coding
> style, etc...
> I would like to know a rough estimate for such a quantity for the
> kernel 2.4/2.6 code running on MIPS32 architecture compiled using GCC.
> My estimate is between 5-10 instructions. I googled for such a thing
> but couldn't find any useful papers/resources.
>
I don't understand what use this metric is.
For starters, not all lines are created equal. Not all lines contain
code, not all lines with code produce output (hint: dead code). Not all
lines contain a single statement, etc....
Tom