(Rsh8x64 (Const8 [c]) (Const64 [d])) -> (Const8 [int64(int8(c) >> uint64(d))])
(Rsh8Ux64 (Const8 [c]) (Const64 [d])) -> (Const8 [int64(uint8(c) >> uint64(d))])
+(Lsh64x64 (Const64 [0]) _) -> (Const64 [0])
+(Rsh64x64 (Const64 [0]) _) -> (Const64 [0])
+(Rsh64Ux64 (Const64 [0]) _) -> (Const64 [0])
+(Lsh32x64 (Const32 [0]) _) -> (Const32 [0])
+(Rsh32x64 (Const32 [0]) _) -> (Const32 [0])
+(Rsh32Ux64 (Const32 [0]) _) -> (Const32 [0])
+(Lsh16x64 (Const16 [0]) _) -> (Const16 [0])
+(Rsh16x64 (Const16 [0]) _) -> (Const16 [0])
+(Rsh16Ux64 (Const16 [0]) _) -> (Const16 [0])
+(Lsh8x64 (Const8 [0]) _) -> (Const8 [0])
+(Rsh8x64 (Const8 [0]) _) -> (Const8 [0])
+(Rsh8Ux64 (Const8 [0]) _) -> (Const8 [0])
+
(IsInBounds (Const32 [c]) (Const32 [d])) -> (ConstBool [b2i(inBounds32(c,d))])
(IsInBounds (Const64 [c]) (Const64 [d])) -> (ConstBool [b2i(inBounds64(c,d))])
(IsSliceInBounds (Const32 [c]) (Const32 [d])) -> (ConstBool [b2i(sliceInBounds32(c,d))])
// large left shifts of all values, and right shifts of unsigned values
(Lsh64x64 _ (Const64 [c])) && uint64(c) >= 64 -> (Const64 [0])
(Rsh64Ux64 _ (Const64 [c])) && uint64(c) >= 64 -> (Const64 [0])
-(Lsh32x64 _ (Const64 [c])) && uint64(c) >= 32 -> (Const64 [0])
-(Rsh32Ux64 _ (Const64 [c])) && uint64(c) >= 32 -> (Const64 [0])
-(Lsh16x64 _ (Const64 [c])) && uint64(c) >= 16 -> (Const64 [0])
-(Rsh16Ux64 _ (Const64 [c])) && uint64(c) >= 16 -> (Const64 [0])
-(Lsh8x64 _ (Const64 [c])) && uint64(c) >= 8 -> (Const64 [0])
-(Rsh8Ux64 _ (Const64 [c])) && uint64(c) >= 8 -> (Const64 [0])
+(Lsh32x64 _ (Const64 [c])) && uint64(c) >= 32 -> (Const32 [0])
+(Rsh32Ux64 _ (Const64 [c])) && uint64(c) >= 32 -> (Const32 [0])
+(Lsh16x64 _ (Const64 [c])) && uint64(c) >= 16 -> (Const16 [0])
+(Rsh16Ux64 _ (Const64 [c])) && uint64(c) >= 16 -> (Const16 [0])
+(Lsh8x64 _ (Const64 [c])) && uint64(c) >= 8 -> (Const8 [0])
+(Rsh8Ux64 _ (Const64 [c])) && uint64(c) >= 8 -> (Const8 [0])
// combine const shifts
v.AuxInt = int64(int16(c) << uint64(d))
return true
}
+ // match: (Lsh16x64 (Const16 [0]) _)
+ // cond:
+ // result: (Const16 [0])
+ for {
+ if v.Args[0].Op != OpConst16 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst16)
+ v.AuxInt = 0
+ return true
+ }
// match: (Lsh16x64 x (Const64 [0]))
// cond:
// result: x
}
// match: (Lsh16x64 _ (Const64 [c]))
// cond: uint64(c) >= 16
- // result: (Const64 [0])
+ // result: (Const16 [0])
for {
if v.Args[1].Op != OpConst64 {
break
if !(uint64(c) >= 16) {
break
}
- v.reset(OpConst64)
+ v.reset(OpConst16)
v.AuxInt = 0
return true
}
v.AuxInt = int64(int32(c) << uint64(d))
return true
}
+ // match: (Lsh32x64 (Const32 [0]) _)
+ // cond:
+ // result: (Const32 [0])
+ for {
+ if v.Args[0].Op != OpConst32 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst32)
+ v.AuxInt = 0
+ return true
+ }
// match: (Lsh32x64 x (Const64 [0]))
// cond:
// result: x
}
// match: (Lsh32x64 _ (Const64 [c]))
// cond: uint64(c) >= 32
- // result: (Const64 [0])
+ // result: (Const32 [0])
for {
if v.Args[1].Op != OpConst64 {
break
if !(uint64(c) >= 32) {
break
}
- v.reset(OpConst64)
+ v.reset(OpConst32)
v.AuxInt = 0
return true
}
v.AuxInt = c << uint64(d)
return true
}
+ // match: (Lsh64x64 (Const64 [0]) _)
+ // cond:
+ // result: (Const64 [0])
+ for {
+ if v.Args[0].Op != OpConst64 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst64)
+ v.AuxInt = 0
+ return true
+ }
// match: (Lsh64x64 x (Const64 [0]))
// cond:
// result: x
v.AuxInt = int64(int8(c) << uint64(d))
return true
}
+ // match: (Lsh8x64 (Const8 [0]) _)
+ // cond:
+ // result: (Const8 [0])
+ for {
+ if v.Args[0].Op != OpConst8 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst8)
+ v.AuxInt = 0
+ return true
+ }
// match: (Lsh8x64 x (Const64 [0]))
// cond:
// result: x
}
// match: (Lsh8x64 _ (Const64 [c]))
// cond: uint64(c) >= 8
- // result: (Const64 [0])
+ // result: (Const8 [0])
for {
if v.Args[1].Op != OpConst64 {
break
if !(uint64(c) >= 8) {
break
}
- v.reset(OpConst64)
+ v.reset(OpConst8)
v.AuxInt = 0
return true
}
v.AuxInt = int64(uint16(c) >> uint64(d))
return true
}
+ // match: (Rsh16Ux64 (Const16 [0]) _)
+ // cond:
+ // result: (Const16 [0])
+ for {
+ if v.Args[0].Op != OpConst16 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst16)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh16Ux64 x (Const64 [0]))
// cond:
// result: x
}
// match: (Rsh16Ux64 _ (Const64 [c]))
// cond: uint64(c) >= 16
- // result: (Const64 [0])
+ // result: (Const16 [0])
for {
if v.Args[1].Op != OpConst64 {
break
if !(uint64(c) >= 16) {
break
}
- v.reset(OpConst64)
+ v.reset(OpConst16)
v.AuxInt = 0
return true
}
v.AuxInt = int64(int16(c) >> uint64(d))
return true
}
+ // match: (Rsh16x64 (Const16 [0]) _)
+ // cond:
+ // result: (Const16 [0])
+ for {
+ if v.Args[0].Op != OpConst16 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst16)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh16x64 x (Const64 [0]))
// cond:
// result: x
v.AuxInt = int64(uint32(c) >> uint64(d))
return true
}
+ // match: (Rsh32Ux64 (Const32 [0]) _)
+ // cond:
+ // result: (Const32 [0])
+ for {
+ if v.Args[0].Op != OpConst32 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst32)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh32Ux64 x (Const64 [0]))
// cond:
// result: x
}
// match: (Rsh32Ux64 _ (Const64 [c]))
// cond: uint64(c) >= 32
- // result: (Const64 [0])
+ // result: (Const32 [0])
for {
if v.Args[1].Op != OpConst64 {
break
if !(uint64(c) >= 32) {
break
}
- v.reset(OpConst64)
+ v.reset(OpConst32)
v.AuxInt = 0
return true
}
v.AuxInt = int64(int32(c) >> uint64(d))
return true
}
+ // match: (Rsh32x64 (Const32 [0]) _)
+ // cond:
+ // result: (Const32 [0])
+ for {
+ if v.Args[0].Op != OpConst32 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst32)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh32x64 x (Const64 [0]))
// cond:
// result: x
v.AuxInt = int64(uint64(c) >> uint64(d))
return true
}
+ // match: (Rsh64Ux64 (Const64 [0]) _)
+ // cond:
+ // result: (Const64 [0])
+ for {
+ if v.Args[0].Op != OpConst64 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst64)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh64Ux64 x (Const64 [0]))
// cond:
// result: x
v.AuxInt = c >> uint64(d)
return true
}
+ // match: (Rsh64x64 (Const64 [0]) _)
+ // cond:
+ // result: (Const64 [0])
+ for {
+ if v.Args[0].Op != OpConst64 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst64)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh64x64 x (Const64 [0]))
// cond:
// result: x
v.AuxInt = int64(uint8(c) >> uint64(d))
return true
}
+ // match: (Rsh8Ux64 (Const8 [0]) _)
+ // cond:
+ // result: (Const8 [0])
+ for {
+ if v.Args[0].Op != OpConst8 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst8)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh8Ux64 x (Const64 [0]))
// cond:
// result: x
}
// match: (Rsh8Ux64 _ (Const64 [c]))
// cond: uint64(c) >= 8
- // result: (Const64 [0])
+ // result: (Const8 [0])
for {
if v.Args[1].Op != OpConst64 {
break
if !(uint64(c) >= 8) {
break
}
- v.reset(OpConst64)
+ v.reset(OpConst8)
v.AuxInt = 0
return true
}
v.AuxInt = int64(int8(c) >> uint64(d))
return true
}
+ // match: (Rsh8x64 (Const8 [0]) _)
+ // cond:
+ // result: (Const8 [0])
+ for {
+ if v.Args[0].Op != OpConst8 {
+ break
+ }
+ if v.Args[0].AuxInt != 0 {
+ break
+ }
+ v.reset(OpConst8)
+ v.AuxInt = 0
+ return true
+ }
// match: (Rsh8x64 x (Const64 [0]))
// cond:
// result: x