File tree Expand file tree Collapse file tree
cranelift/codegen/src/opts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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))
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))
You can’t perform that action at this time.
0 commit comments