From 19adf03e84f99440b7fc073757c6b4673be7f5e5 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Tue, 10 Dec 2024 16:15:25 +0100 Subject: [PATCH] try 64 bits --- src/codegen/instrList.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/codegen/instrList.ml b/src/codegen/instrList.ml index 3179e698806..e0624dce8dd 100644 --- a/src/codegen/instrList.ml +++ b/src/codegen/instrList.ml @@ -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'