| March 4, 2009 11:00 PM PST | |
Include assembly code in compilation and determine its effectiveness. Once you have optimized assembly code by hand, you must include that optimized assembly in the compilation and then determine that optimization's level of success.
Extern the function to include it in the executable, and then create a mechanism to measure the function's execution duration. In order to include the function in the compilation, simply extern it like so:
#define FACTORIAL 12 |
and have a command line like
ecl Factorial.cpp fact.asm nanotime.asm |
The assembly code is now included in the executable.
Now that the code is compiled and ready to go, a method for determining effectiveness is needed. One method is to use time functions. However, some functions need finer resolutions than standard C calls. For those functions, do the following:
Nanotime gets the Interval Time Counter from the processor, measured in clockticks, and returns it as an unsigned long long.
Optimizing Itanium® Processor Family Assembly Code
For more complete information about compiler optimizations, see our Optimization Notice.


Todd Bezenek
565
-Todd