The Big RISCY BUSINESS Question Thread

Is there any reason we couldn’t just do
delta_mcycle * mtime_freq / delta_mtime
instead of
(delta_mcycle / delta_mtime) * mtime_freq + ((delta_mcycle % delta_mtime) * mtime_freq) / delta_mtime
in init.c’s measure_cpu_freq? We worked it out on the series that the second part of the equation is correcting for the loss from the integer division, and it seems that you would get the same answer without the correction term if you just rearrange it so that the multiplication happens before the division.

Also why is measure_cpu_freq attribute((no_inline)), is there a reason we don’t want the compiler to inline this?