charlesarcher / i7z

Automatically exported from code.google.com/p/i7z
GNU General Public License v2.0
0 stars 0 forks source link

Overflow corrected #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
            if (old_val_CORE[ii] > new_val_CORE[ii]) {                  //handle overflow
                CPU_CLK_UNHALTED_CORE = (UINT64_MAX - old_val_CORE[ii]) + new_val_CORE[ii];

may be corrected by

            if (old_val_CORE[ii] > new_val_CORE[ii]) {                  //handle overflow
                CPU_CLK_UNHALTED_CORE = (UINT64_MAX - new_val_CORE[ii]) + old_val_CORE[ii];

I'm programming XFreq and this is the formula which gives me good results when 
showing Turbo.

blog.cyring.fr

Original issue reported on code.google.com by cyril.in...@gmail.com on 17 Feb 2014 at 6:02