"Michael Marcin"
I have written type safe wrappers around some math operations that I need to use everywhere and I expect and rely on them being equivalent to the handcoded or macro based approach for performance reasons.
I tend to check the resulting assembly by hand every so often and it surprises me from time to time to see that inefficiencies have crept in.
If I write a routine in C and a routine using the type safe wrappers that I expect to have equivalent generated assembly is there a way to test that this is indeed the case?
Can anyone else think of a better way to make sure that register usage is optimal, proper inlining is occurring, etc?
You can make this routine a template with parameter policy type modeling either wrapped or non-wrapped operations. Than you can instantiate this function with wrapped and unwrapped parameter policy. Measure and compare the performance of this calls in N invocations. HTH, Gennadiy