Skip to content

Commit

Permalink
try 64 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif committed Dec 10, 2024
1 parent c2403e4 commit 19adf03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/codegen/instrList.ml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ let optimize : instr list -> instr list = fun is ->
| {it = Binary (I32 I32Op.ShrU); _} as shift :: {it = Const {it = I32 31l; _}; _} :: l',
({it = If (res,then_,else_); _} as if_) :: r' ->
go l' ({ shift with it = Unary (I32 I32Op.Clz) } :: { if_ with it = If (res,else_,then_) } :: r')
| {it = Binary (I64 I64Op.ShrU); _} as shift :: {it = Const {it = I64 63L; _}; _} :: l',
({it = If (res,then_,else_); _} as if_) :: r' ->
failwith "I64";go l' ({ shift with it = Unary (I64 I64Op.Clz) } :: { if_ with it = If (res,else_,then_) } :: r')
(* Null shifts can be eliminated *)
| l', {it = Const {it = I32 0l; _}; _} :: {it = Binary (I32 I32Op.(Shl|ShrS|ShrU)); _} :: r' ->
go l' r'
Expand Down

0 comments on commit 19adf03

Please sign in to comment.