Open Darthfett opened 3 years ago
shift right with sign extension instruction (sar) is not supported.
I believe this is an accurate python implementation (though it could likely be more efficient without the branch).
Note: This implementation works on unsigned numbers (because python numbers can be arbitrarily large):
def sar(x, n, sz=32): return (x >> n) | (((2**n - 1) << (sz - n)) if (x & (1 << (sz-1))) else 0)
@Darthfett unfortunately I don't plan to integrate this feature in the near future. If you find time for a PR, feel free so!
shift right with sign extension instruction (sar) is not supported.
I believe this is an accurate python implementation (though it could likely be more efficient without the branch).
Note: This implementation works on unsigned numbers (because python numbers can be arbitrarily large):