Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rename shr -> shr_u, sar -> shr_s #60

Merged
merged 1 commit into from
Sep 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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