From: SourceForge.net <no...@so...> - 2009-05-03 15:15:28
|
Patches item #2764475, was opened at 2009-04-15 08:54 Message generated for change (Comment added) made by spth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300599&aid=2764475&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: z80 port Group: None >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Marco Bodrato (parerga) Assigned to: Nobody/Anonymous (nobody) Summary: Z80: divisions size/speed tradeoff Initial Comment: This patch splits the division/modulus computing function in two cases: divisor up to 7 bits long, divisor with more than 7 bits. It may sound strange that the threshold is 7 and not 8... but look at the code and you will see! Both cases can be computed faster than with current code. Drawback of the patch: code size increases! The _overall_ test-ucz80 result is 7,000 more bytes used, 150,000 ticks saved. The "atmost7bits" version can be easily adapted to compute both quotient and reminder of a 32-bit long by a positive signed char (7 bits :-), storing dividend (and quotient) in HLDE and divisor in C (A holds the reminder). This code should then be used to speed-up ltoa (radix must be < 37 with the current implementation). ---------------------------------------------------------------------- >Comment By: Philipp Krause (spth) Date: 2009-05-03 17:15 Message: IMO the speedup is worth the increase in code size. I suppose we can make up for the code size increase by further modularization of the asm routines. Applied in revision #5447. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300599&aid=2764475&group_id=599 |