sysprog21 / shecc

A self-hosting and educational C optimizing compiler
BSD 2-Clause "Simplified" License
1.11k stars 118 forks source link

Fix Arm outputs for right shift operations #144

Closed DrXiao closed 2 months ago

DrXiao commented 2 months ago

As the discussion in the pull request (#126) mentioned, shecc generates logical right shift instructions for right shift operations on Arm targets currently. However, the most famous compilers such as GCC or Clang generate arithmetic right shift instructions for the operations.

Therefore, this pull request modifies the Arm backend so that the behavior of right shift operations is consistent with GCC and Clang.

jserv commented 2 months ago

Thank @DrXiao for contributing!