diff --git a/ml-proto/src/host/lexer.mll b/ml-proto/src/host/lexer.mll index 92b87eefe0..c655f2b2fd 100644 --- a/ml-proto/src/host/lexer.mll +++ b/ml-proto/src/host/lexer.mll @@ -179,8 +179,8 @@ rule token = parse | (ixx as t)".or" { BINARY (intop t Int32Op.Or Int64Op.Or) } | (ixx as t)".xor" { BINARY (intop t Int32Op.Xor Int64Op.Xor) } | (ixx as t)".shl" { BINARY (intop t Int32Op.Shl Int64Op.Shl) } - | (ixx as t)".shr" { BINARY (intop t Int32Op.Shr Int64Op.Shr) } - | (ixx as t)".sar" { BINARY (intop t Int32Op.Sar Int64Op.Sar) } + | (ixx as t)".shr_u" { BINARY (intop t Int32Op.ShrU Int64Op.ShrU) } + | (ixx as t)".shr_s" { BINARY (intop t Int32Op.ShrS Int64Op.ShrS) } | (fxx as t)".add" { BINARY (floatop t Float32Op.Add Float64Op.Add) } | (fxx as t)".sub" { BINARY (floatop t Float32Op.Sub Float64Op.Sub) } | (fxx as t)".mul" { BINARY (floatop t Float32Op.Mul Float64Op.Mul) } diff --git a/ml-proto/src/spec/arithmetic.ml b/ml-proto/src/spec/arithmetic.ml index 41a9882069..234a07cebc 100644 --- a/ml-proto/src/spec/arithmetic.ml +++ b/ml-proto/src/spec/arithmetic.ml @@ -137,8 +137,8 @@ struct | Or -> Int.logor | Xor -> Int.logxor | Shl -> fun i j -> Int.shift_left i (Int.to_int j) - | Shr -> fun i j -> Int.shift_right_logical i (Int.to_int j) - | Sar -> fun i j -> Int.shift_right i (Int.to_int j) + | ShrU -> fun i j -> Int.shift_right_logical i (Int.to_int j) + | ShrS -> fun i j -> Int.shift_right i (Int.to_int j) in fun v1 v2 -> Int.to_value (f (Int.of_value 1 v1) (Int.of_value 2 v2)) let relop op = diff --git a/ml-proto/src/spec/ast.ml b/ml-proto/src/spec/ast.ml index 1c17b8e89f..39f0a9a13f 100644 --- a/ml-proto/src/spec/ast.ml +++ b/ml-proto/src/spec/ast.ml @@ -36,7 +36,7 @@ module IntOp () = struct type unop = Clz | Ctz | Popcnt type binop = Add | Sub | Mul | DivS | DivU | RemS | RemU - | And | Or | Xor | Shl | Shr | Sar + | And | Or | Xor | Shl | ShrU | ShrS type relop = Eq | Neq | LtS | LtU | LeS | LeU | GtS | GtU | GeS | GeU type cvt = ExtendSInt32 | ExtendUInt32 | WrapInt64 | TruncSFloat32 | TruncUFloat32 | TruncSFloat64 | TruncUFloat64