Skip to content

Commit 78d27df

Browse files
committed
[Cranelift] allow bitop ops for vectors
1 parent 7370808 commit 78d27df

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

cranelift/codegen/src/opts/bitops.isle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
;; x ^ not(x) == not(x) ^ x == x | not(x) == not(x) | x == -1.
2222
;; This identity also holds for non-integer types, vectors, and wider types.
23-
(rule (simplify (bxor (ty_int ty) x (bnot ty x))) (subsume (iconst_s ty -1)))
24-
(rule (simplify (bxor (ty_int ty) (bnot ty x) x)) (subsume (iconst_s ty -1)))
25-
(rule (simplify (bor (ty_int ty) x (bnot ty x))) (subsume (iconst_s ty -1)))
26-
(rule (simplify (bor (ty_int ty) (bnot ty x) x)) (subsume (iconst_s ty -1)))
23+
(rule (simplify (bxor ty x (bnot ty x))) (subsume (iconst_s ty -1)))
24+
(rule (simplify (bxor ty (bnot ty x) x)) (subsume (iconst_s ty -1)))
25+
(rule (simplify (bor ty x (bnot ty x))) (subsume (iconst_s ty -1)))
26+
(rule (simplify (bor ty (bnot ty x) x)) (subsume (iconst_s ty -1)))
2727

2828
;; x & x == x & -1 == x.
2929
(rule (simplify (band ty x x)) (subsume x))
@@ -32,8 +32,8 @@
3232

3333
;; x & 0 == x & not(x) == not(x) & x == 0.
3434
(rule (simplify (band ty _ zero @ (iconst_u ty 0))) (subsume zero))
35-
(rule (simplify (band (ty_int ty) x (bnot ty x))) (subsume (iconst_u ty 0)))
36-
(rule (simplify (band (ty_int ty) (bnot ty x) x)) (subsume (iconst_u ty 0)))
35+
(rule (simplify (band ty x (bnot ty x))) (subsume (iconst_u ty 0)))
36+
(rule (simplify (band ty (bnot ty x) x)) (subsume (iconst_u ty 0)))
3737

3838
;; (x & y) ^ (x ^ y) == x | y
3939
(rule (simplify (bxor ty (band ty X Y) (bxor ty X Y))) (bor ty X Y))

0 commit comments

Comments
 (0)