From: SourceForge.net <no...@so...> - 2003-05-09 09:33:09
|
Feature Requests item #723112, was opened at 2003-04-17 14:47 Message generated for change (Settings changed) made by bernhardheld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=723112&group_id=599 Category: None Group: None >Status: Closed Priority: 5 Submitted By: Josef Pavlik (jetset) >Assigned to: Bernhard Held (bernhardheld) Summary: generic pointer access optimize Initial Comment: hello, I have an idea for optimize (for size) the access to the generic pointer allocated in the registers R2,R3,R4 The actual code is: ; genGenPointerGet mov dpl,r2 mov dph,r3 mov b,r4 lcall __gptrget My idea is to make an prepend to function __gptrget: __gptrget_r234: mov dpl,r2 mov dph,r3 mov b,r4 __gptrget: ; original gptrget function and replace the sequence mov dpl,r2 mov dph,r3 mov b,r4 lcall __gptrget with simply lcall __gptrget_r234 This may be done by peephole catcher If you want to optimize a bit more (for speed), you may write new function _gptrget_r234 which may load dptr from r2,r3 and test directly the register r4 for the type of the pointer without moving this value to the B and then test the value of B reg. But this may break the caller function functionality if the caller want reuse the value of B (I dont know if this may happen in the code generated by sdcc). bye Jet ---------------------------------------------------------------------- Comment By: Bernhard Held (bernhardheld) Date: 2003-04-18 11:42 Message: Logged In: YES user_id=203539 Generic pointers are not always located in r2...r4. Rather it's a very special case you're discussing here, which will hardly ever be hit. Therefore it doesn't make sense to introduce special code for it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=723112&group_id=599 |