Add arithmetic shift, use logic shift in current right shift (#1670)

* Add arithmetic shift, use logic shift in current

* State that the MSBs will be cleared to zero in logic right shift
This commit is contained in:
altrisi authored and GitHub committed 2023-03-08 21:26:27 +01:00
1 parent c2ef75df6d
commit 06bdbdaed2
2 files changed
+6 -2

No files matched your search

@@ -314,7 +314,8 @@ public class Operators
});
expression.addFunctionalEquivalence("<=", "nondecreasing");
expression.addMathematicalBinaryIntFunction("bitwise_shift_left", (num, amount) -> num << amount);
expression.addMathematicalBinaryIntFunction("bitwise_shift_right", (num, amount) -> num >> amount);
expression.addMathematicalBinaryIntFunction("bitwise_shift_right", (num, amount) -> num >>> amount);
expression.addMathematicalBinaryIntFunction("bitwise_arithmetic_shift_right", (num, amount) -> num >> amount);
expression.addMathematicalBinaryIntFunction("bitwise_roll_left", (num, amount) -> Long.rotateLeft(num, (int)amount));
expression.addMathematicalBinaryIntFunction("bitwise_roll_right", (num, amount) -> Long.rotateRight(num, (int)amount));
expression.addMathematicalUnaryIntFunction("bitwise_not", d -> {