From: Michael H. <mic...@ju...> - 2001-08-25 03:53:03
|
I turn it on for the z80 port and added a RLE based init scheme - works pretty well. Two bugs: 1. Negative values break the run and cause this to fall back to the old method. 2. The old method adds an offset of one to all the addresses, such that: static char fish[] = { 1, 2, 3 } generates ld _fish+1,1 ld _fish+2,2 ld _fish+3,3 -- Michael On Fri, 24 Aug 2001, Kevin Vigor wrote: > I just comitted a change to improve static array initialization > (currently only for the DS390 port). > > If a port has the arrayInitializerSuppported bool in the port structure > set, instead of breaking the array initialization down into a series of > pointer sets, it instead creates a new iCode, ARRAYINIT, which takes one > operand (the array to initialize) and a list of values to initialize the > array with. This allows the port specific code generator to handle this > case, and hopefully generate better code. > > See ds390/gen.c:genArrayInit for the '390 implementation. The 8051 > version should be similar, but can't make the assumption that the array > in in XDATA space. > > The generated code looks much better (and is generated much faster for > large static arrays), but I haven't actually tested it on real hardware > yet. If problems occur, please change the arrayInitializerSuppported > value in the DS390 port structure (ds390/main.c) to FALSE, which should > fix the problem, and let me know. > > Peace, > Kevin > > _______________________________________________ > sdcc-devel mailing list > sdc...@li... > http://lists.sourceforge.net/lists/listinfo/sdcc-devel > |