diff --git a/ml-proto/README.md b/ml-proto/README.md index df57d65ca1..0b2c6aad47 100644 --- a/ml-proto/README.md +++ b/ml-proto/README.md @@ -154,7 +154,7 @@ var: | $ unop: ctz | clz | popcnt | ... binop: add | sub | mul | ... -relop: eq | neq | lt | ... +relop: eq | ne | lt | ... sign: s|u align: 1|2|4|8|... cvtop: trunc_s | trunc_u | extend_s | extend_u | ... diff --git a/ml-proto/src/host/lexer.mll b/ml-proto/src/host/lexer.mll index e2cd4c7c9e..d386bcb9cb 100644 --- a/ml-proto/src/host/lexer.mll +++ b/ml-proto/src/host/lexer.mll @@ -192,7 +192,7 @@ rule token = parse { BINARY (floatop t Float32Op.CopySign Float64Op.CopySign) } | (ixx as t)".eq" { COMPARE (intop t Int32Op.Eq Int64Op.Eq) } - | (ixx as t)".neq" { COMPARE (intop t Int32Op.Neq Int64Op.Neq) } + | (ixx as t)".ne" { COMPARE (intop t Int32Op.Ne Int64Op.Ne) } | (ixx as t)".lt_s" { COMPARE (intop t Int32Op.LtS Int64Op.LtS) } | (ixx as t)".lt_u" { COMPARE (intop t Int32Op.LtU Int64Op.LtU) } | (ixx as t)".le_s" { COMPARE (intop t Int32Op.LeS Int64Op.LeS) } @@ -202,7 +202,7 @@ rule token = parse | (ixx as t)".ge_s" { COMPARE (intop t Int32Op.GeS Int64Op.GeS) } | (ixx as t)".ge_u" { COMPARE (intop t Int32Op.GeU Int64Op.GtU) } | (fxx as t)".eq" { COMPARE (floatop t Float32Op.Eq Float64Op.Eq) } - | (fxx as t)".neq" { COMPARE (floatop t Float32Op.Neq Float64Op.Neq) } + | (fxx as t)".ne" { COMPARE (floatop t Float32Op.Ne Float64Op.Ne) } | (fxx as t)".lt" { COMPARE (floatop t Float32Op.Lt Float64Op.Lt) } | (fxx as t)".le" { COMPARE (floatop t Float32Op.Le Float64Op.Le) } | (fxx as t)".gt" { COMPARE (floatop t Float32Op.Gt Float64Op.Gt) } diff --git a/ml-proto/src/spec/arithmetic.ml b/ml-proto/src/spec/arithmetic.ml index 234a07cebc..1e404f3408 100644 --- a/ml-proto/src/spec/arithmetic.ml +++ b/ml-proto/src/spec/arithmetic.ml @@ -144,7 +144,7 @@ struct let relop op = let f = match op with | Eq -> (=) - | Neq -> (<>) + | Ne -> (<>) | LtS -> (<) | LtU -> unsigned lt_big_int | LeS -> (<=) @@ -214,7 +214,7 @@ struct let relop op = let f = match op with | Eq -> (=) - | Neq -> (<>) + | Ne -> (<>) | Lt -> (<) | Le -> (<=) | Gt -> (>) diff --git a/ml-proto/src/spec/ast.ml b/ml-proto/src/spec/ast.ml index 4575d9fa60..0630f4b770 100644 --- a/ml-proto/src/spec/ast.ml +++ b/ml-proto/src/spec/ast.ml @@ -37,7 +37,7 @@ struct type unop = Clz | Ctz | Popcnt type binop = Add | Sub | Mul | DivS | DivU | RemS | RemU | And | Or | Xor | Shl | ShrU | ShrS - type relop = Eq | Neq | LtS | LtU | LeS | LeU | GtS | GtU | GeS | GeU + type relop = Eq | Ne | LtS | LtU | LeS | LeU | GtS | GtU | GeS | GeU type cvt = ExtendSInt32 | ExtendUInt32 | WrapInt64 | TruncSFloat32 | TruncUFloat32 | TruncSFloat64 | TruncUFloat64 | ReinterpretFloat @@ -47,7 +47,7 @@ module FloatOp () = struct type unop = Neg | Abs | Ceil | Floor | Trunc | Nearest | Sqrt type binop = Add | Sub | Mul | Div | CopySign | Min | Max - type relop = Eq | Neq | Lt | Le | Gt | Ge + type relop = Eq | Ne | Lt | Le | Gt | Ge type cvt = ConvertSInt32 | ConvertUInt32 | ConvertSInt64 | ConvertUInt64 | PromoteFloat32 | DemoteFloat64 | ReinterpretInt diff --git a/ml-proto/test/memory.wasm b/ml-proto/test/memory.wasm index 1b266a9af6..03f100e0d0 100644 --- a/ml-proto/test/memory.wasm +++ b/ml-proto/test/memory.wasm @@ -92,7 +92,7 @@ (i32.store (get_local 2) (get_local 0)) (set_local 1 (i32.load (get_local 2))) (if - (i32.neq (get_local 0) (get_local 1)) + (i32.ne (get_local 0) (get_local 1)) (return (i32.const 0)) ) (set_local 0 (i32.sub (get_local 0) (i32.const 1))) @@ -115,7 +115,7 @@ (f64.store/1 (get_local 0) (get_local 2)) (set_local 1 (f64.load/1 (get_local 0))) (if - (f64.neq (get_local 2) (get_local 1)) + (f64.ne (get_local 2) (get_local 1)) (return (i32.const 0)) ) (set_local 0 (i32.sub (get_local 0) (i32.const 1)))