|
From: Steve S. <ste...@gm...> - 2023-09-05 06:17:31
|
But shouldn't that code generate something like JB bitvar, set; mov return, 250; ret; set: mov return, 123; ret; Still has branching but minimal. I guess i did not really get what you meant... -- Steve SCHNEPP On Tue, Sep 5, 2023, 07:32 Oleg Endo <ole...@t-...> wrote: > Hi all, > > For a conditional assignments, like > > return bitvar ? 123 : 250; > > SDCC/mcs51 currently generates conditional jumps around the assignments of > the results: > > genIfx > genIfxJump > ... > label: > genAssign > ... > label: > genAssign > ... > label: > > > While the resulting code is probably the smallest code for mcs51, if > branches are expensive it can be better to compute the result with > straight- > line code instead. > > I would like to try to toy with some of those ideas. What would be the > easiest way to capture the conditional assignment at a higher level? E.g. > is it possible to somehow tap into mcs51's genIfx by looking around the > related iCodes? Or is better to do it at the ast level? > > Any pointers appreciated! > > Cheers, > Oleg > > > _______________________________________________ > sdcc-devel mailing list > sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-devel > |