@@ -4007,6 +4007,40 @@ static RegisterPrimOp primop_bitXor({
4007
4007
.fun = prim_bitXor,
4008
4008
});
4009
4009
4010
+ static void prim_bitShiftLeft (EvalState & state, const PosIdx pos, Value * * args, Value & v)
4011
+ {
4012
+ auto i1 = state.forceInt (*args[0 ], pos, " while evaluating the first argument passed to builtins.bitShiftLeft" );
4013
+ auto i2 = state.forceInt (*args[1 ], pos, " while evaluating the second argument passed to builtins.bitShiftLeft" );
4014
+
4015
+ v.mkInt (i1.value << i2.value );
4016
+ }
4017
+
4018
+ static RegisterPrimOp primop_bitShiftLeft ({
4019
+ .name = " __bitShiftLeft" ,
4020
+ .args = {" e1" , " e2" },
4021
+ .doc = R"(
4022
+ Return the integer *e1* shifted left by *e2*.
4023
+ )" ,
4024
+ .fun = prim_bitShiftLeft,
4025
+ });
4026
+
4027
+ static void prim_bitShiftRight (EvalState & state, const PosIdx pos, Value * * args, Value & v)
4028
+ {
4029
+ auto i1 = state.forceInt (*args[0 ], pos, " while evaluating the first argument passed to builtins.bitShiftRight" );
4030
+ auto i2 = state.forceInt (*args[1 ], pos, " while evaluating the second argument passed to builtins.bitShiftRight" );
4031
+
4032
+ v.mkInt (i1.value >> i2.value );
4033
+ }
4034
+
4035
+ static RegisterPrimOp primop_bitShiftRight ({
4036
+ .name = " __bitShiftRight" ,
4037
+ .args = {" e1" , " e2" },
4038
+ .doc = R"(
4039
+ Return the integer *e1* shifted right by *e2*.
4040
+ )" ,
4041
+ .fun = prim_bitShiftRight,
4042
+ });
4043
+
4010
4044
static void prim_lessThan (EvalState & state, const PosIdx pos, Value * * args, Value & v)
4011
4045
{
4012
4046
state.forceValue (*args[0 ], pos);
0 commit comments