Dave Hansen wrote: > From: d...@mobilefusioninc.com > [...] > I'm still puzzled as to why the compiler didn't change: > > // This takes 53uS at 4 MHz > Bin = ( A / Data_Divisor ) // Data_Divisor is a constant, 32. > > into > > // This takes 8.9uS at 4 MHz > Bin = ( A >> 5) > > Just guessing, but it may be trying to preserve truncation toward zero > (required by C99) if the expression is signed.
Yes, guessing is all we can do because Dave keeps posting these things without providing a proper snipet of compilable code, with compilation options and compiler / libc / binutils versions. Dave, if you want help from the users on this list, you _really_ need to provide some compilable code so that we can actually see what's going on. At high enough compilation (O2, O3, Os) levels it is very hard to track down what the compiler is doing just from some bits of assembly taken out of context... :( -- Paulo Marques Software Development Department - Grupo PIE, S.A. Phone: +351 252 290600, Fax: +351 252 290601 Web: www.grupopie.com "To know recursion, you must first know recursion." _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list