Note that there are some explanatory texts on larger screens.

plurals
  1. POFloating Point Math Execution Time
    primarykey
    data
    text
    <p>What accounts for the added execution time of the first data set? The assembly instructions are the same. </p> <p>With DN_FLUSH flag not on, the first data set takes 63 milliseconds, the second set takes 15 milliseconds.<br> With DN_FLUSH flag on, the first data set takes 15 milliseconds, the second set takes ~0 milliseconds.</p> <p>Therefore, in both cases the execution time of the first data set is much greater.</p> <p>Is there any way to decrease the execution time to be closer in line with the second data set?</p> <p>I am using C++ Visual Studio 2005, /arch:SSE2 /fp:fast running on Intel Core 2 Duo T7700 @ 2.4Ghz Windows XP Pro. </p> <pre><code>#define NUMLOOPS 1000000 // Denormal values flushed to zero by hardware on ALPHA and x86 // processors with SSE2 support. Ignored on other x86 platforms // Setting this decreases execution time from 63 milliseconds to 16 millisecond // _controlfp(_DN_FLUSH, _MCW_DN); float denormal = 1.0e-38; float denormalTwo = 1.0e-39; float denormalThree = 1; tickStart = GetTickCount(); // Run First Calculation Loop for (loops=0; loops &lt; NUMLOOPS; loops++) { denormalThree = denormal - denormalTwo; } // Get execution time duration = GetTickCount()-tickStart; printf("Duration = %dms\n", duration); float normal = 1.0e-10; float normalTwo = 1.0e-2; float normalThree = 1; tickStart = GetTickCount(); // Run Second Calculation Loop for (loops=0; loops &lt; NUMLOOPS; loops++) { normalThree = normal - normalTwo; } // Get execution time duration = GetTickCount()-tickStart; printf("Duration = %dms\n", duration); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload