Linked by Thom Holwerda on Wed 8th Mar 2006 22:57 UTC, submitted by hidden player
OSNews, Generic OSes Even a small operating system can have big disputes within its community. The lead developer of MenuetOS, an OS written in assembly, has decided to drop all support for the 32bit version of Menuet, focusing development on the 64bit version. However, disgruntled users of the open source operating system are trying to keep the 32bit version alive by starting a special forum for it.
Thread beginning with comment 102963
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[3]: Responsive
by edwdig on Fri 10th Mar 2006 00:25 UTC in reply to "RE[2]: Responsive"
Member since:

If you're writing code that can use MMX/SSE, C compilers are not very good at generating that code automatically. You can very easily win in those situations by hand writing assembly.

If you're not using SIMD instructions, a C compiler will usually easily outdo your hand coded assembly. The only time you stand a chance at outdoing the C compiler is in tight loops where the C compiler isn't provided with enough information to properly optimize the code. The more information you provide the compiler, the better job you can do. For example, if you have a function that's only used by other functions in the same source file, mark it as static. This will allow the compiler to use optimize across the function calls. Declare things as const when possible and it will further help your optimizations. Help the compiler, and it will gladly help you back.

5-10 years ago I used to write assembly. Primarly 16 bit. I could very easily outdo the compiler then. I was one of those people that never believed the claims of how good compilers are. Nowadays the compilers really impress me, and I'm usually wrong when I try to outsmart the compiler.

That said, if you're still working with more primative CPUs, you can outdo the compiler without too much trouble. I do some GameBoy Advance coding as a hobby. If I try, there are definitely situations where I can create better code than the compiler. Realistically, there aren't many places where I have to.

Reply Parent Score: 2