(Neq(8|16|32|64) s:(Sub(8|16|32|64) x y) (Const(8|16|32|64) [0])) && s.Uses == 1 -> (Neq(8|16|32|64) x y)
// Optimize bitsets
-(Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y])) && isPowerOfTwo8(y)
+(Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y])) && oneBit8(y)
=> (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
-(Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y])) && isPowerOfTwo16(y)
+(Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y])) && oneBit16(y)
=> (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0]))
-(Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y])) && isPowerOfTwo32(y)
+(Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y])) && oneBit32(y)
=> (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
-(Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y])) && isPowerOfTwo64(y)
+(Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y])) && oneBit64(y)
=> (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0]))
-(Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y])) && isPowerOfTwo8(y)
+(Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y])) && oneBit8(y)
=> (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
-(Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y])) && isPowerOfTwo16(y)
+(Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y])) && oneBit16(y)
=> (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0]))
-(Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y])) && isPowerOfTwo32(y)
+(Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y])) && oneBit32(y)
=> (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
-(Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y])) && isPowerOfTwo64(y)
+(Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y])) && oneBit64(y)
=> (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0]))
// Reassociate expressions involving
break
}
// match: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y]))
- // cond: isPowerOfTwo16(y)
+ // cond: oneBit16(y)
// result: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt16(v_0_1.AuxInt)
- if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(isPowerOfTwo16(y)) {
+ if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(oneBit16(y)) {
continue
}
v.reset(OpNeq16)
break
}
// match: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y]))
- // cond: isPowerOfTwo32(y)
+ // cond: oneBit32(y)
// result: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt32(v_0_1.AuxInt)
- if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(isPowerOfTwo32(y)) {
+ if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(oneBit32(y)) {
continue
}
v.reset(OpNeq32)
break
}
// match: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y]))
- // cond: isPowerOfTwo64(y)
+ // cond: oneBit64(y)
// result: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt64(v_0_1.AuxInt)
- if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(isPowerOfTwo64(y)) {
+ if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(oneBit64(y)) {
continue
}
v.reset(OpNeq64)
break
}
// match: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y]))
- // cond: isPowerOfTwo8(y)
+ // cond: oneBit8(y)
// result: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt8(v_0_1.AuxInt)
- if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(isPowerOfTwo8(y)) {
+ if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(oneBit8(y)) {
continue
}
v.reset(OpNeq8)
break
}
// match: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y]))
- // cond: isPowerOfTwo16(y)
+ // cond: oneBit16(y)
// result: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt16(v_0_1.AuxInt)
- if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(isPowerOfTwo16(y)) {
+ if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(oneBit16(y)) {
continue
}
v.reset(OpEq16)
break
}
// match: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y]))
- // cond: isPowerOfTwo32(y)
+ // cond: oneBit32(y)
// result: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt32(v_0_1.AuxInt)
- if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(isPowerOfTwo32(y)) {
+ if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(oneBit32(y)) {
continue
}
v.reset(OpEq32)
break
}
// match: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y]))
- // cond: isPowerOfTwo64(y)
+ // cond: oneBit64(y)
// result: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt64(v_0_1.AuxInt)
- if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(isPowerOfTwo64(y)) {
+ if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(oneBit64(y)) {
continue
}
v.reset(OpEq64)
break
}
// match: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y]))
- // cond: isPowerOfTwo8(y)
+ // cond: oneBit8(y)
// result: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
continue
}
y := auxIntToInt8(v_0_1.AuxInt)
- if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(isPowerOfTwo8(y)) {
+ if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(oneBit8(y)) {
continue
}
v.reset(OpEq8)