[U-Boot-Users] Eliminate calls of _divsi3 on ARM

Wolfgang Denk wd at denx.de
Tue Apr 26 16:08:10 CEST 2005


In message <fc.004c4e480031a732004c4e480031a732.31a781 at rea.de> you wrote:
> 
> the enclosed patch agains current top of CVS eliminates two calls of the
> libgcc helper function _divsi3 and _modsi3.
> 
> Rationale:
> Certain commercially available tool-chains provides b0rken libgcc.a
> (compiled with hardware FP) making these helper functions unusable

Don't use these tool-chains, then. There are free and working
solutions.

...
-		i -= (i % info->portwidth);
+		i -= i & (info->portwidth - 1);
...
-		*cp++ = ((i + 1) % info->chipwidth) ? '\0' : cmd;
+		*cp++ = ((i + 1) & (info->chipwidth - 1)) ? '\0' : cmd;

Should we  document  the  restrictions  (i.  e.  that  portwidth  and
chipwidth have to be powers of two) ?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Imagination is more important than knowledge.      -- Albert Einstein




More information about the U-Boot mailing list