2 ms·
Similarly, one can use the compiler as a CASE [0] tool and write in a HLL using the compiler and optimizer to generate assembly which can then be modified by th
by sitkack 12y ago
Similarly, one can use the compiler as a CASE [0] tool and write in a HLL using the compiler and optimizer to generate assembly which can then be modified by the programmer. There are many instructions that the compiler won't use that can lead to speedups.
I used the above technique for some bit rotation code years ago, I couldn't figure out how to do it in C, so I wrote the function signature, dumped the whole thing to assembly using the compiler, removed the function body with my own routine which was trivial to write in assembler.
It would be interesting to have an application for this, that could be called as part of an optimizing build step:
* given a set of compilers (gcc,clang,icc,open64)
* project the source to assembler as various optimization levels
* benchmark all of them using supplied data
* give a side by side view of the fastest assembly and HLL code
* programmer optimizes assembly, does a benchmark test with historical runs tests for correctness and speed
The tool would be a combo text editor, historical benchmark and compiler driver. This feedback loop step could be broadcast on a website for lots of organic agents to optimize... ;)
[0] http://en.wikipedia.org/wiki/Computer-aided_software_engineering http://en.wikipedia.org/wiki/Computer-aided_software_enginee...