Skip to content

Commit 12b0fbe

Browse files
committed
Revert "remove demorgan rules (bytecodealliance#12127)"
This reverts commit 39f8c4e.
1 parent 11251c6 commit 12b0fbe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cranelift/codegen/src/opts/bitops.isle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
;; not(not(x)) == x.
4242
(rule (simplify (bnot ty (bnot ty x))) (subsume x))
4343

44+
;; DeMorgan's rule (two versions):
45+
;; bnot(bor(x, y)) == band(bnot(x), bnot(y))
46+
(rule (simplify (bnot ty (bor ty x y)))
47+
(band ty (bnot ty x) (bnot ty y)))
48+
;; bnot(band(x, y)) == bor(bnot(x), bnot(y))
49+
(rule (simplify (bnot ty (band t x y)))
50+
(bor ty (bnot ty x) (bnot ty y)))
51+
4452
;; `or(and(x, y), not(y)) == or(x, not(y))`
4553
(rule (simplify (bor ty
4654
(band ty x y)

0 commit comments

Comments
 (0)