Commit 35e279ee authored by Pietro Fezzardi's avatar Pietro Fezzardi Committed by Alessandro Rubini

softpll_ng.c: replace "/ 2" with ">> 1"

The previous version was compiled into a 64bit division
by gcc. in this way it uses no division, but a bitshift.

This reduces the compiled file by 4 bytes.
parent f4bf6ab7
......@@ -443,8 +443,11 @@ static void set_phase_shift(int channel, int32_t value_picoseconds)
{
struct spll_main_state *st = (struct spll_main_state *)
(!channel ? &softpll.mpll : &softpll.aux[channel - 1].pll.dmtd);
int div = (DIVIDE_DMTD_CLOCKS_BY_2 ? 2 : 1);
mpll_set_phase_shift(st, from_picos(value_picoseconds) / div);
int32_t desired_shift = from_picos(value_picoseconds);
if (DIVIDE_DMTD_CLOCKS_BY_2)
desired_shift >>= 1;
mpll_set_phase_shift(st, desired_shift);
softpll.mpll_shift_ps = value_picoseconds;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment