Thank you Brain!  Your suggestion to #undef log2 worked perfectly for getting 
the assembly to call log2 instead of log and eliminates the divide and no 
longer requires the use of xmm7 to hold the constant log(2).

Unfortunately, 100,000,000 log calculations using log2 is taking 0.700 seconds 
on my i7-4790k vs. 0.583 when using log and dividing by log(2). So the assembly 
code now looks good but the time for the log calculations is 20% higher.  I 
also tried cr_log2 and found the time for the loop using that function is 65% 
higher (likely with better accuracy).  So it seems to turn out that log2 is 
even more inefficient speedwise than I thought, given that using log2 is even 
slower than the the seemingly inefficient use of log divided by log(2) in place 
of log2.  At this point, it seems the best option speedwise for a 64 bit log 
may be to rescale surrounding code to support direct use of the log function 
(no divide by log(2) instead of using the log2 function.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to