Skip to content

Commit

Permalink
Merge pull request #60 from binji/rename-sar
Browse files Browse the repository at this point in the history
Rename shr -> shr_u, sar -> shr_s
  • Loading branch information
jfbastien committed Sep 15, 2015
2 parents 3d2937a + 471e98a commit 193e1ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ml-proto/src/host/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
4 changes: 2 additions & 2 deletions ml-proto/src/spec/arithmetic.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion ml-proto/src/spec/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 193e1ef

Please # to comment.