Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Fix mid-end ISLE spec causing verification timeout (#13991)

Yage Hu84b2a13229c1
diff --git a/cranelift/codegen/src/spec/opt.isle b/cranelift/codegen/src/spec/opt.isle
index 427bec5a7f..60f1896bd1 100644
--- a/cranelift/codegen/src/spec/opt.isle
+++ b/cranelift/codegen/src/spec/opt.isle
@@ -546,7 +546,7 @@
(match (and (bvsge result (int2bv 64 0))
(not (bv_is_zero! result))
(bv_is_zero! (bvand result (bvsub result (int2bv 64 1))))))
- (provide (= x (clz (rev result)))))
+ (provide (= result (bvshl (int2bv 64 1) (zero_ext 64 x)))))
;;;; Condition-code helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; `IntCC::complement` (negate) / `IntCC::swap_args` (swap operands), per