News for hackers. Stuff that matters.
Re:Hello. I'm a compiler by andrewaylett on Tuesday February 19, 2013 @06:42AM (#5243780)
I used to work on a compiler for an embedded system. One fun trick we used while writing the run-time libraries was to write them in C, then optimise the generated assembly (possibly by rewriting it from scratch), then fix the compiler so it generated that assembly :). Sometimes that did require using (and occasionally adding) new intrinsics.
Re:Hello. I'm a compiler by eru on Tuesday February 19, 2013 @06:50AM (#5243809)
How stable where those fixes? I.e. if you made slight changes to the C code, did the optimizations still kick in?
Re:Hello. I'm a compiler by smcl on Tuesday February 19, 2013 @09:45AM (#5244507)
I worked in the same company (Hey Andrew!). It would definitely depend on the specific instructions/optimisations involved but I believe they were generally pretty robust to changes. Some would require the user to supply pragmas (i.e. to specify data alignment, etc) but obviously the compiler intrinsics would always generate the expected instructions.