|
|
|
@ -996,8 +996,9 @@ module Normalize = struct
|
|
|
|
|
if abs then Exp.get_undefined false
|
|
|
|
|
else
|
|
|
|
|
match (e1, e2) with
|
|
|
|
|
| Const Cint n, Const Cint m
|
|
|
|
|
-> Exp.int (IntLit.shift_left n m)
|
|
|
|
|
| Const Cint n, Const Cint m -> (
|
|
|
|
|
try Exp.int (IntLit.shift_left n m)
|
|
|
|
|
with IntLit.OversizedShift -> BinOp (Shiftlt, eval e1, eval e2) )
|
|
|
|
|
| _, Const Cint m when IntLit.iszero m
|
|
|
|
|
-> eval e1
|
|
|
|
|
| _, Const Cint m when IntLit.isone m
|
|
|
|
@ -1011,8 +1012,9 @@ module Normalize = struct
|
|
|
|
|
if abs then Exp.get_undefined false
|
|
|
|
|
else
|
|
|
|
|
match (e1, e2) with
|
|
|
|
|
| Const Cint n, Const Cint m
|
|
|
|
|
-> Exp.int (IntLit.shift_right n m)
|
|
|
|
|
| Const Cint n, Const Cint m -> (
|
|
|
|
|
try Exp.int (IntLit.shift_right n m)
|
|
|
|
|
with IntLit.OversizedShift -> BinOp (Shiftrt, eval e1, eval e2) )
|
|
|
|
|
| _, Const Cint m when IntLit.iszero m
|
|
|
|
|
-> eval e1
|
|
|
|
|
| Const Cint m, _ when IntLit.iszero m
|
|
|
|
|