<br><br>
<div><span class="gmail_quote">On 12/1/05, <b class="gmail_sendername">Loren Merritt</b> <<a href="mailto:lorenm@u.washington.edu">lorenm@u.washington.edu</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Thu, 1 Dec 2005, David Pio wrote:<br><br>> encoder/me.c<br>> function 'x264_me_search_ref'<br>>
<br>> various search methods use 'i_me_range/2' or 'i_me_range/4' in the<br>> conditional part of the looping structure.<br>> i_me_range seems not to change within the context of the function, so should<br>> those divides be taken out of the looping structure? say create 2 new
<br>> variables i_me_range_div2 and i_me_range_div4?? It would save some divide<br>> CPU cycles.<br>><br>> Or does the compiler optimize this out?<br><br>Division symbol != division instruction. The compiler knows to use shifts.
</blockquote>
<div> </div>
<div> </div>
<div>what I mean here is not about the shifting itslef but more of the shifting/divide per loop iteration</div>
<div>at the end of the for loop it will do a i_me_range/2 or /4 to compare with the counter.</div>
<div>if the compiler knows that i_me_range hasn't changed, it can optimize that conditional fragment by remembering the value of i_me_range/2 or /4...but does it actually do that?</div></div><br>