#220 Improvement of STM8's left shift

None
closed
None
5
2014-04-21
2014-02-19
Ben Shi
No

char sl(char a)
{
return a << 7;
}
will be compiled to 7 sll instructions, which is not so efficient.

it could be optimized to something like
swap a
and a, #0xf0
sll
sll
sll

this patch is about using swap and swapw to optimize left shift while shift_count >= size * 8 / 2

1 Attachments

Discussion

  • Ben Shi

    Ben Shi - 2014-03-27

    A different implementation of utilizing swap / swapw to improve left shift.

    Both of these 2 patches can generate right code.

     
  • Ben Shi

    Ben Shi - 2014-03-28

    both are against rev 8964

     
  • Philipp Klaus Krause

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

    In revision #9004, improvements to the left shift have been implemented, including some similar to those from the patch.

    Philipp

     

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

Sign up for the SourceForge newsletter:





No, thanks