(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])) && oneBit8(y)
- => (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
-(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])) && oneBit32(y)
- => (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
-(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])) && oneBit8(y)
- => (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
-(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])) && oneBit32(y)
- => (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
-(Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y])) && oneBit64(y)
- => (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0]))
+(Eq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [y])) && oneBit(y)
+ => (Neq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [0]))
+(Neq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [y])) && oneBit(y)
+ => (Eq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [0]))
// Reassociate expressions involving
// constants such that constants come first,
break
}
// match: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y]))
- // cond: oneBit16(y)
+ // cond: oneBit(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 || !(oneBit16(y)) {
+ if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpNeq16)
break
}
// match: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y]))
- // cond: oneBit32(y)
+ // cond: oneBit(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 || !(oneBit32(y)) {
+ if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpNeq32)
break
}
// match: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y]))
- // cond: oneBit64(y)
+ // cond: oneBit(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 || !(oneBit64(y)) {
+ if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpNeq64)
break
}
// match: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y]))
- // cond: oneBit8(y)
+ // cond: oneBit(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 || !(oneBit8(y)) {
+ if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpNeq8)
break
}
// match: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y]))
- // cond: oneBit16(y)
+ // cond: oneBit(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 || !(oneBit16(y)) {
+ if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpEq16)
break
}
// match: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y]))
- // cond: oneBit32(y)
+ // cond: oneBit(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 || !(oneBit32(y)) {
+ if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpEq32)
break
}
// match: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y]))
- // cond: oneBit64(y)
+ // cond: oneBit(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 || !(oneBit64(y)) {
+ if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpEq64)
break
}
// match: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y]))
- // cond: oneBit8(y)
+ // cond: oneBit(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 || !(oneBit8(y)) {
+ if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(oneBit(y)) {
continue
}
v.reset(OpEq8)