Menu

#259 [z80] peepholer does not properly recognize "nop"

None
closed-accepted
None
5
2016-01-04
2016-01-04
alvin
No

Regarding:
https://sourceforge.net/p/sdcc/discussion/1865/thread/91a6e4eb/#d0f6

An inlined nop instruction is preventing the peepholer from applying optimizations because
z80MightRead() does not have a "nop" case. Since "nop" is not recognized the function returns TRUE meaning "nop" might read all registers.

The fix is applied to sdcc/src/z80/peep.c in function "z80MightRead()":

if(ISINST(pl->line, "ccf"))
return FALSE;

if(ISINST(pl->line, "nop"))
return FALSE;

The case for "ccf" is there but the case for "nop" is new.

Related

Wiki: z80

Discussion

  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
    • Group: -->
     
  • Philipp Klaus Krause

    Fixed in revision [r9441]. Particularly useful for the Rabbit, since SDCC generates nop in Rabbit code.

    Philipp

     

    Last edit: Maarten Brock 2016-01-04
  • Maarten Brock

    Maarten Brock - 2016-01-04
    • status: closed-fixed --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.