#299 Available registers not utilited

closed
nobody
5
2003-02-04
2002-02-22
No

This probably is more of a feature request than a
bug... but here goes.

When using mcs51 large memory model, local variables
are often not allocated to unused registers, which
leads to larger and slower code (and in the case of my
little mp3 player project, a lot more external MOVX bus
activity than necessary which temporarily suspend DMA
transfers).

Here's a code sample from the project, separated into
a single self-contained file:

http://www.pjrc.com/tmp/test.c

In this case, there are two 16-bit local variables
that are both allocated to external memory, even
though the compiler only uses 4 of the 8 registers.

When the code is compiled with small model, the
locals are allocated very nicely to registers, and
SDCC does a really nice job of packing it all into
just 6 registers instead of 8.

Is there any chance of getting this smarter register
usage ported from small to large model?

Thanks,
Paul

Discussion

  • Paul Stoffregen

    Paul Stoffregen - 2002-02-22

    Sample code, unused registers

     
  • Johan Knol

    Johan Knol - 2003-02-04

    Logged In: YES
    user_id=63512

    Sandeep fixed this a long time ago with fillInGaps()

     
  • Johan Knol

    Johan Knol - 2003-02-04
    • status: open --> closed
     
  • Johan Knol

    Johan Knol - 2003-02-04

    Logged In: YES
    user_id=63512

    Sandeep fixed this a long time ago with fillInGaps()

     
  • Johan Knol

    Johan Knol - 2003-02-04

    Logged In: YES
    user_id=63512

    Sandeep fixed this a long time ago with fillInGaps()

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks