--- Paulo Marques <[EMAIL PROTECTED]> schrieb:
> karsten wiese wrote:
> > Ok, thats not much, but it dosn't harm either.
> > Erm, at least as long as UHCI_NUMFRAMES is a power of
> 2
> > ;-)
>
> > - framenum %= UHCI_NUMFRAMES;
> > + framenum &= (UHCI_NUMFRAMES - 1);
>
> This seems like it should really be handled by the
> compiler... Did you
> try a more recent gcc, or looked at the assembler
> generated?
>
No (next month I'll change to fc3) and yes, the compiler
really generates the % operations without the patch.
> IMHO if the compiler does what it is supposed to do, then
> the compiled
> binary should be the same. If we change the value of
> UHCI_NUMFRAMES in
> the future to something that is not a power of 2, this
> code won't break,
> whereas in your version, it will.
>
> This does not that I'm antecipating any change in
> UHCI_NUMFRAMES. Is
> just that, as a general rule, I really prefer to let the
> compiler do the
> low-level optimizations to improve code maintenance.
>
UHCI_NUMFRAMES will never change, it is a standard.
I'll recheck with gcc 3.4 of fc3. I guess it'll stay the
same. Anyhow this is interrupt level, time critical code so
I think the patch is the right way to go.
Karsten
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden:
http://mail.yahoo.de
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel