Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Mar 2004 22:44:58 +0100
From:      stephan mantler <step@stephanmantler.com>
To:        Narvi <narvi@haldjas.folklore.ee>
Cc:        freebsd-chat@freebsd.org
Subject:   Re: FreeBSD Most wanted
Message-ID:  <404A465A.1040009@stephanmantler.com>
In-Reply-To: <20040306013914.D38020@haldjas.folklore.ee>
References:  <Pine.LNX.4.43.0403011839470.3269-100000@pilchuck.reedmedia.net> <EABDE846-6EF2-11D8-AE09-000A95DA58FE@jimz.net> <20040306005744.T38020@haldjas.folklore.ee> <20040305153505.74061868.cpressey@catseye.mine.nu> <20040306013914.D38020@haldjas.folklore.ee>

next in thread | previous in thread | raw e-mail | index | archive | help
Narvi wrote:
>>"Familiarity with the target machine and its instruction set is a
>>prerequisite for designing a good code generator.  Unfortunately, in a
>>general discussion of code generation it is not possible to describe
>>the nuances of any target machine in sufficient detail to be able to
>>generate good code for a complete language on that machine."
>>  -- The "Dragon" Book, pp 519
> 
> Sure - but code generation is but one part of the compiler and usualy not
> the largest.

Well, it is still a crucial part of the compiler and deeply tied into the
rest. It is also the reason why simply using the Intel C++ compiler instead
of .NET2003 (both at full optimization) made our vector math library run
five times faster... guess who knows the target architecture ;-)  In this
highly specific example hand optimized assembler code is another four times
faster for some functions, but I think this is not a problem of compilers per
se. I guess the C/C++ language simply isn't giving the compiler all the
information it would need. I haven't yet tried Intel's feedback optimization
feature, but it will be interesting to see what it will do to our library.

Also, to get a bit closer to the original topic. I can't remember where I
read this (DDJ probably), but apparently programmers who have a deep
understanding of computer architecture through low level programming also
produce "better" code in high level languages. My interpretation is that
they are simply feeding the compiler a better foundation to work with.

Cheers,
-stephan

-- 
stephan mantler             | web www.stephanmantler.com
----------------------------| net step@stephanmantler.com
It's not an adventure       | fon +43 (699) 104 128 42
until something f--ks up.   | fax +43 (699) 404 128 42



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?404A465A.1040009>