Menu

#590 8051 notUsed peephole function

None
open
nobody
5
2023-08-10
2018-10-19
No

It will be really nice to have notUsed peephole function for 8051
Specially for this kind of cases:

                                199 ;   sdcc-divulong.c:50: while (--count);
  000068 E5*08            [12]  200     mov a,__divulong_count_65536_2
  00006A 14               [12]  201     dec a
  00006B FF               [12]  202     mov r7,a
  00006C 8F*08            [24]  203     mov __divulong_count_65536_2,r7
  00006E 70 A6            [24]  204     jnz 00105$

Looks like perfect DJNZ candidate.

Discussion

  • Maarten Brock

    Maarten Brock - 2020-05-29
    • status: open --> closed-fixed
    • assigned_to: Maarten Brock
    • Group: -->
     
  • Maarten Brock

    Maarten Brock - 2020-05-29

    Fixed in SDCC [r11631].
    It was not a peephole problem nor mcs51 only.

     
  • Konstantin Kim

    Konstantin Kim - 2020-05-29

    I do not get comment. It is 51 only related and it is peephole related.

     
    • Maarten Brock

      Maarten Brock - 2020-05-29

      What kind of comment were you expecting?

      SDCC used to generate (during code generation, not peephole optimization) the DJNZ for this loop variable before 3.5.0. Yesterday I fixed this regression and now once again it is generated. The problem was not mcs51 related, but happened during Common SubExpression optimization (CSE) for all targets. Thus it is also not fixed with a peephole rule. See [r11631].

      I do not understand how you can state that it is 51 only and that it is peephole related.
      What am I missing?

       
      • Philipp Klaus Krause

        It seems to me that the feature request was for notUsed() for the mcs51 peephole optimizer.
        The djnz apparently was just meant as one example for something that could have been done with notUsed().

         
        • Konstantin Kim

          Konstantin Kim - 2020-06-02

          @spth Exactly.
          May this feature reques be reopened?

           
  • Maarten Brock

    Maarten Brock - 2020-06-02
    • status: closed-fixed --> open
    • assigned_to: Maarten Brock --> nobody
     
  • Maarten Brock

    Maarten Brock - 2020-06-02

    My apologies for misunderstanding your request.

     

Log in to post a comment.

MongoDB Logo MongoDB