// For now, the generated successors must be a permutation of the matched successors.
// constant folding
-(Trunc16to8 (Const16 [c])) -> (Const8 [int64(int8(c))])
-(Trunc32to8 (Const32 [c])) -> (Const8 [int64(int8(c))])
-(Trunc32to16 (Const32 [c])) -> (Const16 [int64(int16(c))])
-(Trunc64to8 (Const64 [c])) -> (Const8 [int64(int8(c))])
-(Trunc64to16 (Const64 [c])) -> (Const16 [int64(int16(c))])
-(Trunc64to32 (Const64 [c])) -> (Const32 [int64(int32(c))])
-(Cvt64Fto32F (Const64F [c])) -> (Const32F [auxFrom32F(float32(auxTo64F(c)))])
-(Cvt32Fto64F (Const32F [c])) -> (Const64F [c]) // c is already a 64 bit float
-(Cvt32to32F (Const32 [c])) -> (Const32F [auxFrom32F(float32(int32(c)))])
-(Cvt32to64F (Const32 [c])) -> (Const64F [auxFrom64F(float64(int32(c)))])
-(Cvt64to32F (Const64 [c])) -> (Const32F [auxFrom32F(float32(c))])
-(Cvt64to64F (Const64 [c])) -> (Const64F [auxFrom64F(float64(c))])
-(Cvt32Fto32 (Const32F [c])) -> (Const32 [int64(int32(auxTo32F(c)))])
-(Cvt32Fto64 (Const32F [c])) -> (Const64 [int64(auxTo32F(c))])
-(Cvt64Fto32 (Const64F [c])) -> (Const32 [int64(int32(auxTo64F(c)))])
-(Cvt64Fto64 (Const64F [c])) -> (Const64 [int64(auxTo64F(c))])
-(Round32F x:(Const32F)) -> x
-(Round64F x:(Const64F)) -> x
-(CvtBoolToUint8 (ConstBool [c])) -> (Const8 [c])
-
-(Trunc16to8 (ZeroExt8to16 x)) -> x
-(Trunc32to8 (ZeroExt8to32 x)) -> x
-(Trunc32to16 (ZeroExt8to32 x)) -> (ZeroExt8to16 x)
-(Trunc32to16 (ZeroExt16to32 x)) -> x
-(Trunc64to8 (ZeroExt8to64 x)) -> x
-(Trunc64to16 (ZeroExt8to64 x)) -> (ZeroExt8to16 x)
-(Trunc64to16 (ZeroExt16to64 x)) -> x
-(Trunc64to32 (ZeroExt8to64 x)) -> (ZeroExt8to32 x)
-(Trunc64to32 (ZeroExt16to64 x)) -> (ZeroExt16to32 x)
-(Trunc64to32 (ZeroExt32to64 x)) -> x
-(Trunc16to8 (SignExt8to16 x)) -> x
-(Trunc32to8 (SignExt8to32 x)) -> x
-(Trunc32to16 (SignExt8to32 x)) -> (SignExt8to16 x)
-(Trunc32to16 (SignExt16to32 x)) -> x
-(Trunc64to8 (SignExt8to64 x)) -> x
-(Trunc64to16 (SignExt8to64 x)) -> (SignExt8to16 x)
-(Trunc64to16 (SignExt16to64 x)) -> x
-(Trunc64to32 (SignExt8to64 x)) -> (SignExt8to32 x)
-(Trunc64to32 (SignExt16to64 x)) -> (SignExt16to32 x)
-(Trunc64to32 (SignExt32to64 x)) -> x
-
-(ZeroExt8to16 (Const8 [c])) -> (Const16 [int64( uint8(c))])
-(ZeroExt8to32 (Const8 [c])) -> (Const32 [int64( uint8(c))])
-(ZeroExt8to64 (Const8 [c])) -> (Const64 [int64( uint8(c))])
-(ZeroExt16to32 (Const16 [c])) -> (Const32 [int64(uint16(c))])
-(ZeroExt16to64 (Const16 [c])) -> (Const64 [int64(uint16(c))])
-(ZeroExt32to64 (Const32 [c])) -> (Const64 [int64(uint32(c))])
-(SignExt8to16 (Const8 [c])) -> (Const16 [int64( int8(c))])
-(SignExt8to32 (Const8 [c])) -> (Const32 [int64( int8(c))])
-(SignExt8to64 (Const8 [c])) -> (Const64 [int64( int8(c))])
-(SignExt16to32 (Const16 [c])) -> (Const32 [int64( int16(c))])
-(SignExt16to64 (Const16 [c])) -> (Const64 [int64( int16(c))])
-(SignExt32to64 (Const32 [c])) -> (Const64 [int64( int32(c))])
-
-(Neg8 (Const8 [c])) -> (Const8 [int64( -int8(c))])
-(Neg16 (Const16 [c])) -> (Const16 [int64(-int16(c))])
-(Neg32 (Const32 [c])) -> (Const32 [int64(-int32(c))])
-(Neg64 (Const64 [c])) -> (Const64 [-c])
-(Neg32F (Const32F [c])) && auxTo32F(c) != 0 -> (Const32F [auxFrom32F(-auxTo32F(c))])
-(Neg64F (Const64F [c])) && auxTo64F(c) != 0 -> (Const64F [auxFrom64F(-auxTo64F(c))])
-
-(Add8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c+d))])
-(Add16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c+d))])
-(Add32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c+d))])
-(Add64 (Const64 [c]) (Const64 [d])) -> (Const64 [c+d])
-(Add32F (Const32F [c]) (Const32F [d])) && !math.IsNaN(float64(auxTo32F(c) + auxTo32F(d))) -> (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))])
-(Add64F (Const64F [c]) (Const64F [d])) && !math.IsNaN(auxTo64F(c) + auxTo64F(d)) -> (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))])
-(AddPtr <t> x (Const64 [c])) -> (OffPtr <t> x [c])
-(AddPtr <t> x (Const32 [c])) -> (OffPtr <t> x [c])
-
-(Sub8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c-d))])
-(Sub16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c-d))])
-(Sub32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c-d))])
-(Sub64 (Const64 [c]) (Const64 [d])) -> (Const64 [c-d])
-(Sub32F (Const32F [c]) (Const32F [d])) && !math.IsNaN(float64(auxTo32F(c) - auxTo32F(d))) -> (Const32F [auxFrom32F(auxTo32F(c) - auxTo32F(d))])
-(Sub64F (Const64F [c]) (Const64F [d])) && !math.IsNaN(auxTo64F(c) - auxTo64F(d)) -> (Const64F [auxFrom64F(auxTo64F(c) - auxTo64F(d))])
-
-(Mul8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c*d))])
-(Mul16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c*d))])
-(Mul32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c*d))])
-(Mul64 (Const64 [c]) (Const64 [d])) -> (Const64 [c*d])
-(Mul32F (Const32F [c]) (Const32F [d])) && !math.IsNaN(float64(auxTo32F(c) * auxTo32F(d))) -> (Const32F [auxFrom32F(auxTo32F(c) * auxTo32F(d))])
-(Mul64F (Const64F [c]) (Const64F [d])) && !math.IsNaN(auxTo64F(c) * auxTo64F(d)) -> (Const64F [auxFrom64F(auxTo64F(c) * auxTo64F(d))])
-
-(And8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c&d))])
-(And16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c&d))])
-(And32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c&d))])
-(And64 (Const64 [c]) (Const64 [d])) -> (Const64 [c&d])
-
-(Or8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c|d))])
-(Or16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c|d))])
-(Or32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c|d))])
-(Or64 (Const64 [c]) (Const64 [d])) -> (Const64 [c|d])
-
-(Xor8 (Const8 [c]) (Const8 [d])) -> (Const8 [int64(int8(c^d))])
-(Xor16 (Const16 [c]) (Const16 [d])) -> (Const16 [int64(int16(c^d))])
-(Xor32 (Const32 [c]) (Const32 [d])) -> (Const32 [int64(int32(c^d))])
-(Xor64 (Const64 [c]) (Const64 [d])) -> (Const64 [c^d])
-
-(Ctz64 (Const64 [c])) && config.PtrSize == 4 -> (Const32 [ntz(c)])
-(Ctz32 (Const32 [c])) && config.PtrSize == 4 -> (Const32 [ntz32(c)])
-(Ctz16 (Const16 [c])) && config.PtrSize == 4 -> (Const32 [ntz16(c)])
-(Ctz8 (Const8 [c])) && config.PtrSize == 4 -> (Const32 [ntz8(c)])
-
-(Ctz64 (Const64 [c])) && config.PtrSize == 8 -> (Const64 [ntz(c)])
-(Ctz32 (Const32 [c])) && config.PtrSize == 8 -> (Const64 [ntz32(c)])
-(Ctz16 (Const16 [c])) && config.PtrSize == 8 -> (Const64 [ntz16(c)])
-(Ctz8 (Const8 [c])) && config.PtrSize == 8 -> (Const64 [ntz8(c)])
-
-(Div8 (Const8 [c]) (Const8 [d])) && d != 0 -> (Const8 [int64(int8(c)/int8(d))])
-(Div16 (Const16 [c]) (Const16 [d])) && d != 0 -> (Const16 [int64(int16(c)/int16(d))])
-(Div32 (Const32 [c]) (Const32 [d])) && d != 0 -> (Const32 [int64(int32(c)/int32(d))])
-(Div64 (Const64 [c]) (Const64 [d])) && d != 0 -> (Const64 [c/d])
-(Div8u (Const8 [c]) (Const8 [d])) && d != 0 -> (Const8 [int64(int8(uint8(c)/uint8(d)))])
-(Div16u (Const16 [c]) (Const16 [d])) && d != 0 -> (Const16 [int64(int16(uint16(c)/uint16(d)))])
-(Div32u (Const32 [c]) (Const32 [d])) && d != 0 -> (Const32 [int64(int32(uint32(c)/uint32(d)))])
-(Div64u (Const64 [c]) (Const64 [d])) && d != 0 -> (Const64 [int64(uint64(c)/uint64(d))])
-(Div32F (Const32F [c]) (Const32F [d])) && !math.IsNaN(float64(auxTo32F(c) / auxTo32F(d))) -> (Const32F [auxFrom32F(auxTo32F(c) / auxTo32F(d))])
-(Div64F (Const64F [c]) (Const64F [d])) && !math.IsNaN(auxTo64F(c) / auxTo64F(d)) -> (Const64F [auxFrom64F(auxTo64F(c) / auxTo64F(d))])
-(Select0 (Div128u (Const64 [0]) lo y)) -> (Div64u lo y)
-(Select1 (Div128u (Const64 [0]) lo y)) -> (Mod64u lo y)
+(Trunc16to8 (Const16 [c])) => (Const8 [int8(c)])
+(Trunc32to8 (Const32 [c])) => (Const8 [int8(c)])
+(Trunc32to16 (Const32 [c])) => (Const16 [int16(c)])
+(Trunc64to8 (Const64 [c])) => (Const8 [int8(c)])
+(Trunc64to16 (Const64 [c])) => (Const16 [int16(c)])
+(Trunc64to32 (Const64 [c])) => (Const32 [int32(c)])
+(Cvt64Fto32F (Const64F [c])) => (Const32F [float32(c)])
+(Cvt32Fto64F (Const32F [c])) => (Const64F [float64(c)])
+(Cvt32to32F (Const32 [c])) => (Const32F [float32(c)])
+(Cvt32to64F (Const32 [c])) => (Const64F [float64(c)])
+(Cvt64to32F (Const64 [c])) => (Const32F [float32(c)])
+(Cvt64to64F (Const64 [c])) => (Const64F [float64(c)])
+(Cvt32Fto32 (Const32F [c])) => (Const32 [int32(c)])
+(Cvt32Fto64 (Const32F [c])) => (Const64 [int64(c)])
+(Cvt64Fto32 (Const64F [c])) => (Const32 [int32(c)])
+(Cvt64Fto64 (Const64F [c])) => (Const64 [int64(c)])
+(Round32F x:(Const32F)) => x
+(Round64F x:(Const64F)) => x
+(CvtBoolToUint8 (ConstBool [false])) => (Const8 [0])
+(CvtBoolToUint8 (ConstBool [true])) => (Const8 [1])
+
+(Trunc16to8 (ZeroExt8to16 x)) => x
+(Trunc32to8 (ZeroExt8to32 x)) => x
+(Trunc32to16 (ZeroExt8to32 x)) => (ZeroExt8to16 x)
+(Trunc32to16 (ZeroExt16to32 x)) => x
+(Trunc64to8 (ZeroExt8to64 x)) => x
+(Trunc64to16 (ZeroExt8to64 x)) => (ZeroExt8to16 x)
+(Trunc64to16 (ZeroExt16to64 x)) => x
+(Trunc64to32 (ZeroExt8to64 x)) => (ZeroExt8to32 x)
+(Trunc64to32 (ZeroExt16to64 x)) => (ZeroExt16to32 x)
+(Trunc64to32 (ZeroExt32to64 x)) => x
+(Trunc16to8 (SignExt8to16 x)) => x
+(Trunc32to8 (SignExt8to32 x)) => x
+(Trunc32to16 (SignExt8to32 x)) => (SignExt8to16 x)
+(Trunc32to16 (SignExt16to32 x)) => x
+(Trunc64to8 (SignExt8to64 x)) => x
+(Trunc64to16 (SignExt8to64 x)) => (SignExt8to16 x)
+(Trunc64to16 (SignExt16to64 x)) => x
+(Trunc64to32 (SignExt8to64 x)) => (SignExt8to32 x)
+(Trunc64to32 (SignExt16to64 x)) => (SignExt16to32 x)
+(Trunc64to32 (SignExt32to64 x)) => x
+
+(ZeroExt8to16 (Const8 [c])) => (Const16 [int16( uint8(c))])
+(ZeroExt8to32 (Const8 [c])) => (Const32 [int32( uint8(c))])
+(ZeroExt8to64 (Const8 [c])) => (Const64 [int64( uint8(c))])
+(ZeroExt16to32 (Const16 [c])) => (Const32 [int32(uint16(c))])
+(ZeroExt16to64 (Const16 [c])) => (Const64 [int64(uint16(c))])
+(ZeroExt32to64 (Const32 [c])) => (Const64 [int64(uint32(c))])
+(SignExt8to16 (Const8 [c])) => (Const16 [int16(c)])
+(SignExt8to32 (Const8 [c])) => (Const32 [int32(c)])
+(SignExt8to64 (Const8 [c])) => (Const64 [int64(c)])
+(SignExt16to32 (Const16 [c])) => (Const32 [int32(c)])
+(SignExt16to64 (Const16 [c])) => (Const64 [int64(c)])
+(SignExt32to64 (Const32 [c])) => (Const64 [int64(c)])
+
+(Neg8 (Const8 [c])) => (Const8 [-c])
+(Neg16 (Const16 [c])) => (Const16 [-c])
+(Neg32 (Const32 [c])) => (Const32 [-c])
+(Neg64 (Const64 [c])) => (Const64 [-c])
+(Neg32F (Const32F [c])) && c != 0 => (Const32F [-c])
+(Neg64F (Const64F [c])) && c != 0 => (Const64F [-c])
+
+(Add8 (Const8 [c]) (Const8 [d])) => (Const8 [c+d])
+(Add16 (Const16 [c]) (Const16 [d])) => (Const16 [c+d])
+(Add32 (Const32 [c]) (Const32 [d])) => (Const32 [c+d])
+(Add64 (Const64 [c]) (Const64 [d])) => (Const64 [c+d])
+(Add32F (Const32F [c]) (Const32F [d])) && c+d == c+d => (Const32F [c+d])
+(Add64F (Const64F [c]) (Const64F [d])) && c+d == c+d => (Const64F [c+d])
+(AddPtr <t> x (Const64 [c])) => (OffPtr <t> x [c])
+(AddPtr <t> x (Const32 [c])) => (OffPtr <t> x [int64(c)])
+
+(Sub8 (Const8 [c]) (Const8 [d])) => (Const8 [c-d])
+(Sub16 (Const16 [c]) (Const16 [d])) => (Const16 [c-d])
+(Sub32 (Const32 [c]) (Const32 [d])) => (Const32 [c-d])
+(Sub64 (Const64 [c]) (Const64 [d])) => (Const64 [c-d])
+(Sub32F (Const32F [c]) (Const32F [d])) && c-d == c-d => (Const32F [c-d])
+(Sub64F (Const64F [c]) (Const64F [d])) && c-d == c-d => (Const64F [c-d])
+
+(Mul8 (Const8 [c]) (Const8 [d])) => (Const8 [c*d])
+(Mul16 (Const16 [c]) (Const16 [d])) => (Const16 [c*d])
+(Mul32 (Const32 [c]) (Const32 [d])) => (Const32 [c*d])
+(Mul64 (Const64 [c]) (Const64 [d])) => (Const64 [c*d])
+(Mul32F (Const32F [c]) (Const32F [d])) && c*d == c*d => (Const32F [c*d])
+(Mul64F (Const64F [c]) (Const64F [d])) && c*d == c*d => (Const64F [c*d])
+
+(And8 (Const8 [c]) (Const8 [d])) => (Const8 [c&d])
+(And16 (Const16 [c]) (Const16 [d])) => (Const16 [c&d])
+(And32 (Const32 [c]) (Const32 [d])) => (Const32 [c&d])
+(And64 (Const64 [c]) (Const64 [d])) => (Const64 [c&d])
+
+(Or8 (Const8 [c]) (Const8 [d])) => (Const8 [c|d])
+(Or16 (Const16 [c]) (Const16 [d])) => (Const16 [c|d])
+(Or32 (Const32 [c]) (Const32 [d])) => (Const32 [c|d])
+(Or64 (Const64 [c]) (Const64 [d])) => (Const64 [c|d])
+
+(Xor8 (Const8 [c]) (Const8 [d])) => (Const8 [c^d])
+(Xor16 (Const16 [c]) (Const16 [d])) => (Const16 [c^d])
+(Xor32 (Const32 [c]) (Const32 [d])) => (Const32 [c^d])
+(Xor64 (Const64 [c]) (Const64 [d])) => (Const64 [c^d])
+
+(Ctz64 (Const64 [c])) && config.PtrSize == 4 => (Const32 [int32(ntz64(c))])
+(Ctz32 (Const32 [c])) && config.PtrSize == 4 => (Const32 [int32(ntz32(c))])
+(Ctz16 (Const16 [c])) && config.PtrSize == 4 => (Const32 [int32(ntz16(c))])
+(Ctz8 (Const8 [c])) && config.PtrSize == 4 => (Const32 [int32(ntz8(c))])
+
+(Ctz64 (Const64 [c])) && config.PtrSize == 8 => (Const64 [int64(ntz64(c))])
+(Ctz32 (Const32 [c])) && config.PtrSize == 8 => (Const64 [int64(ntz32(c))])
+(Ctz16 (Const16 [c])) && config.PtrSize == 8 => (Const64 [int64(ntz16(c))])
+(Ctz8 (Const8 [c])) && config.PtrSize == 8 => (Const64 [int64(ntz8(c))])
+
+(Div8 (Const8 [c]) (Const8 [d])) && d != 0 => (Const8 [c/d])
+(Div16 (Const16 [c]) (Const16 [d])) && d != 0 => (Const16 [c/d])
+(Div32 (Const32 [c]) (Const32 [d])) && d != 0 => (Const32 [c/d])
+(Div64 (Const64 [c]) (Const64 [d])) && d != 0 => (Const64 [c/d])
+(Div8u (Const8 [c]) (Const8 [d])) && d != 0 => (Const8 [int8(uint8(c)/uint8(d))])
+(Div16u (Const16 [c]) (Const16 [d])) && d != 0 => (Const16 [int16(uint16(c)/uint16(d))])
+(Div32u (Const32 [c]) (Const32 [d])) && d != 0 => (Const32 [int32(uint32(c)/uint32(d))])
+(Div64u (Const64 [c]) (Const64 [d])) && d != 0 => (Const64 [int64(uint64(c)/uint64(d))])
+(Div32F (Const32F [c]) (Const32F [d])) && c/d == c/d => (Const32F [c/d])
+(Div64F (Const64F [c]) (Const64F [d])) && c/d == c/d => (Const64F [c/d])
+(Select0 (Div128u (Const64 [0]) lo y)) => (Div64u lo y)
+(Select1 (Div128u (Const64 [0]) lo y)) => (Mod64u lo y)
(Not (ConstBool [c])) -> (ConstBool [1-c])
v_0 := v.Args[0]
b := v.Block
// match: (Add16 (Const16 [c]) (Const16 [d]))
- // result: (Const16 [int64(int16(c+d))])
+ // result: (Const16 [c+d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst16 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c + d))
+ var _auxint int16 = c + d
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (Add32 (Const32 [c]) (Const32 [d]))
- // result: (Const32 [int64(int32(c+d))])
+ // result: (Const32 [c+d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst32 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(c + d))
+ var _auxint int32 = c + d
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
break
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Add32F (Const32F [c]) (Const32F [d]))
- // cond: !math.IsNaN(float64(auxTo32F(c) + auxTo32F(d)))
- // result: (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))])
+ // cond: c+d == c+d
+ // result: (Const32F [c+d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst32F {
continue
}
- c := v_0.AuxInt
+ c := auxIntToFloat32(v_0.AuxInt)
if v_1.Op != OpConst32F {
continue
}
- d := v_1.AuxInt
- if !(!math.IsNaN(float64(auxTo32F(c) + auxTo32F(d)))) {
+ d := auxIntToFloat32(v_1.AuxInt)
+ if !(c+d == c+d) {
continue
}
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(auxTo32F(c) + auxTo32F(d))
+ var _auxint float32 = c + d
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
break
if v_0.Op != OpConst64 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
v.reset(OpConst64)
- v.AuxInt = c + d
+ var _auxint int64 = c + d
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
break
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Add64F (Const64F [c]) (Const64F [d]))
- // cond: !math.IsNaN(auxTo64F(c) + auxTo64F(d))
- // result: (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))])
+ // cond: c+d == c+d
+ // result: (Const64F [c+d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst64F {
continue
}
- c := v_0.AuxInt
+ c := auxIntToFloat64(v_0.AuxInt)
if v_1.Op != OpConst64F {
continue
}
- d := v_1.AuxInt
- if !(!math.IsNaN(auxTo64F(c) + auxTo64F(d))) {
+ d := auxIntToFloat64(v_1.AuxInt)
+ if !(c+d == c+d) {
continue
}
v.reset(OpConst64F)
- v.AuxInt = auxFrom64F(auxTo64F(c) + auxTo64F(d))
+ var _auxint float64 = c + d
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (Add8 (Const8 [c]) (Const8 [d]))
- // result: (Const8 [int64(int8(c+d))])
+ // result: (Const8 [c+d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst8 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c + d))
+ var _auxint int8 = c + d
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
break
if v_1.Op != OpConst64 {
break
}
- c := v_1.AuxInt
+ c := auxIntToInt64(v_1.AuxInt)
v.reset(OpOffPtr)
v.Type = t
- v.AuxInt = c
+ var _auxint int64 = c
+ v.AuxInt = int64ToAuxInt(_auxint)
v.AddArg(x)
return true
}
// match: (AddPtr <t> x (Const32 [c]))
- // result: (OffPtr <t> x [c])
+ // result: (OffPtr <t> x [int64(c)])
for {
t := v.Type
x := v_0
if v_1.Op != OpConst32 {
break
}
- c := v_1.AuxInt
+ c := auxIntToInt32(v_1.AuxInt)
v.reset(OpOffPtr)
v.Type = t
- v.AuxInt = c
+ var _auxint int64 = int64(c)
+ v.AuxInt = int64ToAuxInt(_auxint)
v.AddArg(x)
return true
}
v_0 := v.Args[0]
b := v.Block
// match: (And16 (Const16 [c]) (Const16 [d]))
- // result: (Const16 [int64(int16(c&d))])
+ // result: (Const16 [c&d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst16 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c & d))
+ var _auxint int16 = c & d
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (And32 (Const32 [c]) (Const32 [d]))
- // result: (Const32 [int64(int32(c&d))])
+ // result: (Const32 [c&d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst32 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(c & d))
+ var _auxint int32 = c & d
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
break
if v_0.Op != OpConst64 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
v.reset(OpConst64)
- v.AuxInt = c & d
+ var _auxint int64 = c & d
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (And8 (Const8 [c]) (Const8 [d]))
- // result: (Const8 [int64(int8(c&d))])
+ // result: (Const8 [c&d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst8 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c & d))
+ var _auxint int8 = c & d
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
break
v0 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr)
v1 := b.NewValue0(v.Pos, OpConst32, typ.Int)
var _auxint int32 = 0
- v1.AuxInt = int64(_auxint)
+ v1.AuxInt = int32ToAuxInt(_auxint)
v.AddArg2(v0, v1)
return true
}
v0 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr)
v1 := b.NewValue0(v.Pos, OpConst64, typ.Int)
var _auxint int64 = 0
- v1.AuxInt = int64(_auxint)
+ v1.AuxInt = int64ToAuxInt(_auxint)
v.AddArg2(v0, v1)
return true
}
v0.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpConst32, typ.Int)
var _auxint int32 = int32(len(str))
- v2.AuxInt = int64(_auxint)
+ v2.AuxInt = int32ToAuxInt(_auxint)
v.AddArg2(v0, v2)
return true
}
v0.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpConst64, typ.Int)
var _auxint int64 = int64(len(str))
- v2.AuxInt = int64(_auxint)
+ v2.AuxInt = int64ToAuxInt(_auxint)
v.AddArg2(v0, v2)
return true
}
config := b.Func.Config
// match: (Ctz16 (Const16 [c]))
// cond: config.PtrSize == 4
- // result: (Const32 [ntz16(c)])
+ // result: (Const32 [int32(ntz16(c))])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if !(config.PtrSize == 4) {
break
}
v.reset(OpConst32)
- v.AuxInt = ntz16(c)
+ var _auxint int32 = int32(ntz16(c))
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Ctz16 (Const16 [c]))
// cond: config.PtrSize == 8
- // result: (Const64 [ntz16(c)])
+ // result: (Const64 [int64(ntz16(c))])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if !(config.PtrSize == 8) {
break
}
v.reset(OpConst64)
- v.AuxInt = ntz16(c)
+ var _auxint int64 = int64(ntz16(c))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
return false
config := b.Func.Config
// match: (Ctz32 (Const32 [c]))
// cond: config.PtrSize == 4
- // result: (Const32 [ntz32(c)])
+ // result: (Const32 [int32(ntz32(c))])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if !(config.PtrSize == 4) {
break
}
v.reset(OpConst32)
- v.AuxInt = ntz32(c)
+ var _auxint int32 = int32(ntz32(c))
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Ctz32 (Const32 [c]))
// cond: config.PtrSize == 8
- // result: (Const64 [ntz32(c)])
+ // result: (Const64 [int64(ntz32(c))])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if !(config.PtrSize == 8) {
break
}
v.reset(OpConst64)
- v.AuxInt = ntz32(c)
+ var _auxint int64 = int64(ntz32(c))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
return false
config := b.Func.Config
// match: (Ctz64 (Const64 [c]))
// cond: config.PtrSize == 4
- // result: (Const32 [ntz(c)])
+ // result: (Const32 [int32(ntz64(c))])
for {
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if !(config.PtrSize == 4) {
break
}
v.reset(OpConst32)
- v.AuxInt = ntz(c)
+ var _auxint int32 = int32(ntz64(c))
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Ctz64 (Const64 [c]))
// cond: config.PtrSize == 8
- // result: (Const64 [ntz(c)])
+ // result: (Const64 [int64(ntz64(c))])
for {
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if !(config.PtrSize == 8) {
break
}
v.reset(OpConst64)
- v.AuxInt = ntz(c)
+ var _auxint int64 = int64(ntz64(c))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
return false
config := b.Func.Config
// match: (Ctz8 (Const8 [c]))
// cond: config.PtrSize == 4
- // result: (Const32 [ntz8(c)])
+ // result: (Const32 [int32(ntz8(c))])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if !(config.PtrSize == 4) {
break
}
v.reset(OpConst32)
- v.AuxInt = ntz8(c)
+ var _auxint int32 = int32(ntz8(c))
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Ctz8 (Const8 [c]))
// cond: config.PtrSize == 8
- // result: (Const64 [ntz8(c)])
+ // result: (Const64 [int64(ntz8(c))])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if !(config.PtrSize == 8) {
break
}
v.reset(OpConst64)
- v.AuxInt = ntz8(c)
+ var _auxint int64 = int64(ntz8(c))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt32Fto32(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt32Fto32 (Const32F [c]))
- // result: (Const32 [int64(int32(auxTo32F(c)))])
+ // result: (Const32 [int32(c)])
for {
if v_0.Op != OpConst32F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat32(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(auxTo32F(c)))
+ var _auxint int32 = int32(c)
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt32Fto64(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt32Fto64 (Const32F [c]))
- // result: (Const64 [int64(auxTo32F(c))])
+ // result: (Const64 [int64(c)])
for {
if v_0.Op != OpConst32F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat32(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(auxTo32F(c))
+ var _auxint int64 = int64(c)
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt32Fto64F(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt32Fto64F (Const32F [c]))
- // result: (Const64F [c])
+ // result: (Const64F [float64(c)])
for {
if v_0.Op != OpConst32F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat32(v_0.AuxInt)
v.reset(OpConst64F)
- v.AuxInt = c
+ var _auxint float64 = float64(c)
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt32to32F(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt32to32F (Const32 [c]))
- // result: (Const32F [auxFrom32F(float32(int32(c)))])
+ // result: (Const32F [float32(c)])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(float32(int32(c)))
+ var _auxint float32 = float32(c)
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt32to64F(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt32to64F (Const32 [c]))
- // result: (Const64F [auxFrom64F(float64(int32(c)))])
+ // result: (Const64F [float64(c)])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(OpConst64F)
- v.AuxInt = auxFrom64F(float64(int32(c)))
+ var _auxint float64 = float64(c)
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt64Fto32(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt64Fto32 (Const64F [c]))
- // result: (Const32 [int64(int32(auxTo64F(c)))])
+ // result: (Const32 [int32(c)])
for {
if v_0.Op != OpConst64F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat64(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(auxTo64F(c)))
+ var _auxint int32 = int32(c)
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt64Fto32F(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt64Fto32F (Const64F [c]))
- // result: (Const32F [auxFrom32F(float32(auxTo64F(c)))])
+ // result: (Const32F [float32(c)])
for {
if v_0.Op != OpConst64F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat64(v_0.AuxInt)
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(float32(auxTo64F(c)))
+ var _auxint float32 = float32(c)
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt64Fto64(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt64Fto64 (Const64F [c]))
- // result: (Const64 [int64(auxTo64F(c))])
+ // result: (Const64 [int64(c)])
for {
if v_0.Op != OpConst64F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat64(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(auxTo64F(c))
+ var _auxint int64 = int64(c)
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt64to32F(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt64to32F (Const64 [c]))
- // result: (Const32F [auxFrom32F(float32(c))])
+ // result: (Const32F [float32(c)])
for {
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(float32(c))
+ var _auxint float32 = float32(c)
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
return false
func rewriteValuegeneric_OpCvt64to64F(v *Value) bool {
v_0 := v.Args[0]
// match: (Cvt64to64F (Const64 [c]))
- // result: (Const64F [auxFrom64F(float64(c))])
+ // result: (Const64F [float64(c)])
for {
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
v.reset(OpConst64F)
- v.AuxInt = auxFrom64F(float64(c))
+ var _auxint float64 = float64(c)
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
return false
}
func rewriteValuegeneric_OpCvtBoolToUint8(v *Value) bool {
v_0 := v.Args[0]
- // match: (CvtBoolToUint8 (ConstBool [c]))
- // result: (Const8 [c])
+ // match: (CvtBoolToUint8 (ConstBool [false]))
+ // result: (Const8 [0])
for {
- if v_0.Op != OpConstBool {
+ if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != false {
break
}
- c := v_0.AuxInt
v.reset(OpConst8)
- v.AuxInt = c
+ var _auxint int8 = 0
+ v.AuxInt = int8ToAuxInt(_auxint)
+ return true
+ }
+ // match: (CvtBoolToUint8 (ConstBool [true]))
+ // result: (Const8 [1])
+ for {
+ if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != true {
+ break
+ }
+ v.reset(OpConst8)
+ var _auxint int8 = 1
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
return false
typ := &b.Func.Config.Types
// match: (Div16 (Const16 [c]) (Const16 [d]))
// cond: d != 0
- // result: (Const16 [int64(int16(c)/int16(d))])
+ // result: (Const16 [c/d])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst16)
- v.AuxInt = int64(int16(c) / int16(d))
+ var _auxint int16 = c / d
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (Div16 n (Const16 [c]))
typ := &b.Func.Config.Types
// match: (Div16u (Const16 [c]) (Const16 [d]))
// cond: d != 0
- // result: (Const16 [int64(int16(uint16(c)/uint16(d)))])
+ // result: (Const16 [int16(uint16(c)/uint16(d))])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst16)
- v.AuxInt = int64(int16(uint16(c) / uint16(d)))
+ var _auxint int16 = int16(uint16(c) / uint16(d))
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (Div16u n (Const16 [c]))
typ := &b.Func.Config.Types
// match: (Div32 (Const32 [c]) (Const32 [d]))
// cond: d != 0
- // result: (Const32 [int64(int32(c)/int32(d))])
+ // result: (Const32 [c/d])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst32)
- v.AuxInt = int64(int32(c) / int32(d))
+ var _auxint int32 = c / d
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Div32 n (Const32 [c]))
v_0 := v.Args[0]
b := v.Block
// match: (Div32F (Const32F [c]) (Const32F [d]))
- // cond: !math.IsNaN(float64(auxTo32F(c) / auxTo32F(d)))
- // result: (Const32F [auxFrom32F(auxTo32F(c) / auxTo32F(d))])
+ // cond: c/d == c/d
+ // result: (Const32F [c/d])
for {
if v_0.Op != OpConst32F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat32(v_0.AuxInt)
if v_1.Op != OpConst32F {
break
}
- d := v_1.AuxInt
- if !(!math.IsNaN(float64(auxTo32F(c) / auxTo32F(d)))) {
+ d := auxIntToFloat32(v_1.AuxInt)
+ if !(c/d == c/d) {
break
}
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(auxTo32F(c) / auxTo32F(d))
+ var _auxint float32 = c / d
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
// match: (Div32F x (Const32F <t> [c]))
typ := &b.Func.Config.Types
// match: (Div32u (Const32 [c]) (Const32 [d]))
// cond: d != 0
- // result: (Const32 [int64(int32(uint32(c)/uint32(d)))])
+ // result: (Const32 [int32(uint32(c)/uint32(d))])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst32)
- v.AuxInt = int64(int32(uint32(c) / uint32(d)))
+ var _auxint int32 = int32(uint32(c) / uint32(d))
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Div32u n (Const32 [c]))
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst64)
- v.AuxInt = c / d
+ var _auxint int64 = c / d
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (Div64 n (Const64 [c]))
v_0 := v.Args[0]
b := v.Block
// match: (Div64F (Const64F [c]) (Const64F [d]))
- // cond: !math.IsNaN(auxTo64F(c) / auxTo64F(d))
- // result: (Const64F [auxFrom64F(auxTo64F(c) / auxTo64F(d))])
+ // cond: c/d == c/d
+ // result: (Const64F [c/d])
for {
if v_0.Op != OpConst64F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat64(v_0.AuxInt)
if v_1.Op != OpConst64F {
break
}
- d := v_1.AuxInt
- if !(!math.IsNaN(auxTo64F(c) / auxTo64F(d))) {
+ d := auxIntToFloat64(v_1.AuxInt)
+ if !(c/d == c/d) {
break
}
v.reset(OpConst64F)
- v.AuxInt = auxFrom64F(auxTo64F(c) / auxTo64F(d))
+ var _auxint float64 = c / d
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
// match: (Div64F x (Const64F <t> [c]))
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst64)
- v.AuxInt = int64(uint64(c) / uint64(d))
+ var _auxint int64 = int64(uint64(c) / uint64(d))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (Div64u n (Const64 [c]))
typ := &b.Func.Config.Types
// match: (Div8 (Const8 [c]) (Const8 [d]))
// cond: d != 0
- // result: (Const8 [int64(int8(c)/int8(d))])
+ // result: (Const8 [c/d])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst8)
- v.AuxInt = int64(int8(c) / int8(d))
+ var _auxint int8 = c / d
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
// match: (Div8 n (Const8 [c]))
typ := &b.Func.Config.Types
// match: (Div8u (Const8 [c]) (Const8 [d]))
// cond: d != 0
- // result: (Const8 [int64(int8(uint8(c)/uint8(d)))])
+ // result: (Const8 [int8(uint8(c)/uint8(d))])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
if !(d != 0) {
break
}
v.reset(OpConst8)
- v.AuxInt = int64(int8(uint8(c) / uint8(d)))
+ var _auxint int8 = int8(uint8(c) / uint8(d))
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
// match: (Div8u n (Const8 [c]))
b := v.Block
typ := &b.Func.Config.Types
// match: (Mul16 (Const16 [c]) (Const16 [d]))
- // result: (Const16 [int64(int16(c*d))])
+ // result: (Const16 [c*d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst16 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c * d))
+ var _auxint int16 = c * d
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
break
b := v.Block
typ := &b.Func.Config.Types
// match: (Mul32 (Const32 [c]) (Const32 [d]))
- // result: (Const32 [int64(int32(c*d))])
+ // result: (Const32 [c*d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst32 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(c * d))
+ var _auxint int32 = c * d
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
break
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Mul32F (Const32F [c]) (Const32F [d]))
- // cond: !math.IsNaN(float64(auxTo32F(c) * auxTo32F(d)))
- // result: (Const32F [auxFrom32F(auxTo32F(c) * auxTo32F(d))])
+ // cond: c*d == c*d
+ // result: (Const32F [c*d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst32F {
continue
}
- c := v_0.AuxInt
+ c := auxIntToFloat32(v_0.AuxInt)
if v_1.Op != OpConst32F {
continue
}
- d := v_1.AuxInt
- if !(!math.IsNaN(float64(auxTo32F(c) * auxTo32F(d)))) {
+ d := auxIntToFloat32(v_1.AuxInt)
+ if !(c*d == c*d) {
continue
}
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(auxTo32F(c) * auxTo32F(d))
+ var _auxint float32 = c * d
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
break
if v_0.Op != OpConst64 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
v.reset(OpConst64)
- v.AuxInt = c * d
+ var _auxint int64 = c * d
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
break
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Mul64F (Const64F [c]) (Const64F [d]))
- // cond: !math.IsNaN(auxTo64F(c) * auxTo64F(d))
- // result: (Const64F [auxFrom64F(auxTo64F(c) * auxTo64F(d))])
+ // cond: c*d == c*d
+ // result: (Const64F [c*d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst64F {
continue
}
- c := v_0.AuxInt
+ c := auxIntToFloat64(v_0.AuxInt)
if v_1.Op != OpConst64F {
continue
}
- d := v_1.AuxInt
- if !(!math.IsNaN(auxTo64F(c) * auxTo64F(d))) {
+ d := auxIntToFloat64(v_1.AuxInt)
+ if !(c*d == c*d) {
continue
}
v.reset(OpConst64F)
- v.AuxInt = auxFrom64F(auxTo64F(c) * auxTo64F(d))
+ var _auxint float64 = c * d
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
break
b := v.Block
typ := &b.Func.Config.Types
// match: (Mul8 (Const8 [c]) (Const8 [d]))
- // result: (Const8 [int64(int8(c*d))])
+ // result: (Const8 [c*d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst8 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c * d))
+ var _auxint int8 = c * d
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (Neg16 (Const16 [c]))
- // result: (Const16 [int64(-int16(c))])
+ // result: (Const16 [-c])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(-int16(c))
+ var _auxint int16 = -c
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (Neg16 (Sub16 x y))
v_0 := v.Args[0]
b := v.Block
// match: (Neg32 (Const32 [c]))
- // result: (Const32 [int64(-int32(c))])
+ // result: (Const32 [-c])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(-int32(c))
+ var _auxint int32 = -c
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Neg32 (Sub32 x y))
func rewriteValuegeneric_OpNeg32F(v *Value) bool {
v_0 := v.Args[0]
// match: (Neg32F (Const32F [c]))
- // cond: auxTo32F(c) != 0
- // result: (Const32F [auxFrom32F(-auxTo32F(c))])
+ // cond: c != 0
+ // result: (Const32F [-c])
for {
if v_0.Op != OpConst32F {
break
}
- c := v_0.AuxInt
- if !(auxTo32F(c) != 0) {
+ c := auxIntToFloat32(v_0.AuxInt)
+ if !(c != 0) {
break
}
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(-auxTo32F(c))
+ var _auxint float32 = -c
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
return false
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = -c
+ var _auxint int64 = -c
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (Neg64 (Sub64 x y))
func rewriteValuegeneric_OpNeg64F(v *Value) bool {
v_0 := v.Args[0]
// match: (Neg64F (Const64F [c]))
- // cond: auxTo64F(c) != 0
- // result: (Const64F [auxFrom64F(-auxTo64F(c))])
+ // cond: c != 0
+ // result: (Const64F [-c])
for {
if v_0.Op != OpConst64F {
break
}
- c := v_0.AuxInt
- if !(auxTo64F(c) != 0) {
+ c := auxIntToFloat64(v_0.AuxInt)
+ if !(c != 0) {
break
}
v.reset(OpConst64F)
- v.AuxInt = auxFrom64F(-auxTo64F(c))
+ var _auxint float64 = -c
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
return false
v_0 := v.Args[0]
b := v.Block
// match: (Neg8 (Const8 [c]))
- // result: (Const8 [int64( -int8(c))])
+ // result: (Const8 [-c])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(-int8(c))
+ var _auxint int8 = -c
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
// match: (Neg8 (Sub8 x y))
v_0 := v.Args[0]
b := v.Block
// match: (Or16 (Const16 [c]) (Const16 [d]))
- // result: (Const16 [int64(int16(c|d))])
+ // result: (Const16 [c|d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst16 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c | d))
+ var _auxint int16 = c | d
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (Or32 (Const32 [c]) (Const32 [d]))
- // result: (Const32 [int64(int32(c|d))])
+ // result: (Const32 [c|d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst32 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(c | d))
+ var _auxint int32 = c | d
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
break
if v_0.Op != OpConst64 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
v.reset(OpConst64)
- v.AuxInt = c | d
+ var _auxint int64 = c | d
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (Or8 (Const8 [c]) (Const8 [d]))
- // result: (Const8 [int64(int8(c|d))])
+ // result: (Const8 [c|d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst8 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c | d))
+ var _auxint int8 = c | d
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
break
}
y := v_0.Args[2]
v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpConst64 || v_0_0.AuxInt != 0 {
+ if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 0 {
break
}
lo := v_0.Args[1]
}
y := v_0.Args[2]
v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpConst64 || v_0_0.AuxInt != 0 {
+ if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 0 {
break
}
lo := v_0.Args[1]
func rewriteValuegeneric_OpSignExt16to32(v *Value) bool {
v_0 := v.Args[0]
// match: (SignExt16to32 (Const16 [c]))
- // result: (Const32 [int64( int16(c))])
+ // result: (Const32 [int32(c)])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int16(c))
+ var _auxint int32 = int32(c)
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (SignExt16to32 (Trunc32to16 x:(Rsh32x64 _ (Const64 [s]))))
func rewriteValuegeneric_OpSignExt16to64(v *Value) bool {
v_0 := v.Args[0]
// match: (SignExt16to64 (Const16 [c]))
- // result: (Const64 [int64( int16(c))])
+ // result: (Const64 [int64(c)])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(int16(c))
+ var _auxint int64 = int64(c)
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (SignExt16to64 (Trunc64to16 x:(Rsh64x64 _ (Const64 [s]))))
func rewriteValuegeneric_OpSignExt32to64(v *Value) bool {
v_0 := v.Args[0]
// match: (SignExt32to64 (Const32 [c]))
- // result: (Const64 [int64( int32(c))])
+ // result: (Const64 [int64(c)])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(int32(c))
+ var _auxint int64 = int64(c)
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (SignExt32to64 (Trunc64to32 x:(Rsh64x64 _ (Const64 [s]))))
func rewriteValuegeneric_OpSignExt8to16(v *Value) bool {
v_0 := v.Args[0]
// match: (SignExt8to16 (Const8 [c]))
- // result: (Const16 [int64( int8(c))])
+ // result: (Const16 [int16(c)])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int8(c))
+ var _auxint int16 = int16(c)
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (SignExt8to16 (Trunc16to8 x:(Rsh16x64 _ (Const64 [s]))))
func rewriteValuegeneric_OpSignExt8to32(v *Value) bool {
v_0 := v.Args[0]
// match: (SignExt8to32 (Const8 [c]))
- // result: (Const32 [int64( int8(c))])
+ // result: (Const32 [int32(c)])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int8(c))
+ var _auxint int32 = int32(c)
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (SignExt8to32 (Trunc32to8 x:(Rsh32x64 _ (Const64 [s]))))
func rewriteValuegeneric_OpSignExt8to64(v *Value) bool {
v_0 := v.Args[0]
// match: (SignExt8to64 (Const8 [c]))
- // result: (Const64 [int64( int8(c))])
+ // result: (Const64 [int64(c)])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(int8(c))
+ var _auxint int64 = int64(c)
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (SignExt8to64 (Trunc64to8 x:(Rsh64x64 _ (Const64 [s]))))
v_0 := v.Args[0]
b := v.Block
// match: (Sub16 (Const16 [c]) (Const16 [d]))
- // result: (Const16 [int64(int16(c-d))])
+ // result: (Const16 [c-d])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c - d))
+ var _auxint int16 = c - d
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (Sub16 x (Const16 <t> [c]))
v_0 := v.Args[0]
b := v.Block
// match: (Sub32 (Const32 [c]) (Const32 [d]))
- // result: (Const32 [int64(int32(c-d))])
+ // result: (Const32 [c-d])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(c - d))
+ var _auxint int32 = c - d
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Sub32 x (Const32 <t> [c]))
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Sub32F (Const32F [c]) (Const32F [d]))
- // cond: !math.IsNaN(float64(auxTo32F(c) - auxTo32F(d)))
- // result: (Const32F [auxFrom32F(auxTo32F(c) - auxTo32F(d))])
+ // cond: c-d == c-d
+ // result: (Const32F [c-d])
for {
if v_0.Op != OpConst32F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat32(v_0.AuxInt)
if v_1.Op != OpConst32F {
break
}
- d := v_1.AuxInt
- if !(!math.IsNaN(float64(auxTo32F(c) - auxTo32F(d)))) {
+ d := auxIntToFloat32(v_1.AuxInt)
+ if !(c-d == c-d) {
break
}
v.reset(OpConst32F)
- v.AuxInt = auxFrom32F(auxTo32F(c) - auxTo32F(d))
+ var _auxint float32 = c - d
+ v.AuxInt = float32ToAuxInt(_auxint)
return true
}
return false
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
v.reset(OpConst64)
- v.AuxInt = c - d
+ var _auxint int64 = c - d
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (Sub64 x (Const64 <t> [c]))
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Sub64F (Const64F [c]) (Const64F [d]))
- // cond: !math.IsNaN(auxTo64F(c) - auxTo64F(d))
- // result: (Const64F [auxFrom64F(auxTo64F(c) - auxTo64F(d))])
+ // cond: c-d == c-d
+ // result: (Const64F [c-d])
for {
if v_0.Op != OpConst64F {
break
}
- c := v_0.AuxInt
+ c := auxIntToFloat64(v_0.AuxInt)
if v_1.Op != OpConst64F {
break
}
- d := v_1.AuxInt
- if !(!math.IsNaN(auxTo64F(c) - auxTo64F(d))) {
+ d := auxIntToFloat64(v_1.AuxInt)
+ if !(c-d == c-d) {
break
}
v.reset(OpConst64F)
- v.AuxInt = auxFrom64F(auxTo64F(c) - auxTo64F(d))
+ var _auxint float64 = c - d
+ v.AuxInt = float64ToAuxInt(_auxint)
return true
}
return false
v_0 := v.Args[0]
b := v.Block
// match: (Sub8 (Const8 [c]) (Const8 [d]))
- // result: (Const8 [int64(int8(c-d))])
+ // result: (Const8 [c-d])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
break
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c - d))
+ var _auxint int8 = c - d
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
// match: (Sub8 x (Const8 <t> [c]))
func rewriteValuegeneric_OpTrunc16to8(v *Value) bool {
v_0 := v.Args[0]
// match: (Trunc16to8 (Const16 [c]))
- // result: (Const8 [int64(int8(c))])
+ // result: (Const8 [int8(c)])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c))
+ var _auxint int8 = int8(c)
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
// match: (Trunc16to8 (ZeroExt8to16 x))
func rewriteValuegeneric_OpTrunc32to16(v *Value) bool {
v_0 := v.Args[0]
// match: (Trunc32to16 (Const32 [c]))
- // result: (Const16 [int64(int16(c))])
+ // result: (Const16 [int16(c)])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c))
+ var _auxint int16 = int16(c)
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (Trunc32to16 (ZeroExt8to32 x))
func rewriteValuegeneric_OpTrunc32to8(v *Value) bool {
v_0 := v.Args[0]
// match: (Trunc32to8 (Const32 [c]))
- // result: (Const8 [int64(int8(c))])
+ // result: (Const8 [int8(c)])
for {
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c))
+ var _auxint int8 = int8(c)
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
// match: (Trunc32to8 (ZeroExt8to32 x))
func rewriteValuegeneric_OpTrunc64to16(v *Value) bool {
v_0 := v.Args[0]
// match: (Trunc64to16 (Const64 [c]))
- // result: (Const16 [int64(int16(c))])
+ // result: (Const16 [int16(c)])
for {
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c))
+ var _auxint int16 = int16(c)
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (Trunc64to16 (ZeroExt8to64 x))
func rewriteValuegeneric_OpTrunc64to32(v *Value) bool {
v_0 := v.Args[0]
// match: (Trunc64to32 (Const64 [c]))
- // result: (Const32 [int64(int32(c))])
+ // result: (Const32 [int32(c)])
for {
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(c))
+ var _auxint int32 = int32(c)
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (Trunc64to32 (ZeroExt8to64 x))
func rewriteValuegeneric_OpTrunc64to8(v *Value) bool {
v_0 := v.Args[0]
// match: (Trunc64to8 (Const64 [c]))
- // result: (Const8 [int64(int8(c))])
+ // result: (Const8 [int8(c)])
for {
if v_0.Op != OpConst64 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c))
+ var _auxint int8 = int8(c)
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
// match: (Trunc64to8 (ZeroExt8to64 x))
v_0 := v.Args[0]
b := v.Block
// match: (Xor16 (Const16 [c]) (Const16 [d]))
- // result: (Const16 [int64(int16(c^d))])
+ // result: (Const16 [c^d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst16 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
if v_1.Op != OpConst16 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt16(v_1.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(int16(c ^ d))
+ var _auxint int16 = c ^ d
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (Xor32 (Const32 [c]) (Const32 [d]))
- // result: (Const32 [int64(int32(c^d))])
+ // result: (Const32 [c^d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst32 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if v_1.Op != OpConst32 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt32(v_1.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(int32(c ^ d))
+ var _auxint int32 = c ^ d
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
break
if v_0.Op != OpConst64 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt64(v_0.AuxInt)
if v_1.Op != OpConst64 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt64(v_1.AuxInt)
v.reset(OpConst64)
- v.AuxInt = c ^ d
+ var _auxint int64 = c ^ d
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
break
v_0 := v.Args[0]
b := v.Block
// match: (Xor8 (Const8 [c]) (Const8 [d]))
- // result: (Const8 [int64(int8(c^d))])
+ // result: (Const8 [c^d])
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
if v_0.Op != OpConst8 {
continue
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
if v_1.Op != OpConst8 {
continue
}
- d := v_1.AuxInt
+ d := auxIntToInt8(v_1.AuxInt)
v.reset(OpConst8)
- v.AuxInt = int64(int8(c ^ d))
+ var _auxint int8 = c ^ d
+ v.AuxInt = int8ToAuxInt(_auxint)
return true
}
break
func rewriteValuegeneric_OpZeroExt16to32(v *Value) bool {
v_0 := v.Args[0]
// match: (ZeroExt16to32 (Const16 [c]))
- // result: (Const32 [int64(uint16(c))])
+ // result: (Const32 [int32(uint16(c))])
for {
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(uint16(c))
+ var _auxint int32 = int32(uint16(c))
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (ZeroExt16to32 (Trunc32to16 x:(Rsh32Ux64 _ (Const64 [s]))))
if v_0.Op != OpConst16 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt16(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(uint16(c))
+ var _auxint int64 = int64(uint16(c))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (ZeroExt16to64 (Trunc64to16 x:(Rsh64Ux64 _ (Const64 [s]))))
if v_0.Op != OpConst32 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(uint32(c))
+ var _auxint int64 = int64(uint32(c))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (ZeroExt32to64 (Trunc64to32 x:(Rsh64Ux64 _ (Const64 [s]))))
func rewriteValuegeneric_OpZeroExt8to16(v *Value) bool {
v_0 := v.Args[0]
// match: (ZeroExt8to16 (Const8 [c]))
- // result: (Const16 [int64( uint8(c))])
+ // result: (Const16 [int16( uint8(c))])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
v.reset(OpConst16)
- v.AuxInt = int64(uint8(c))
+ var _auxint int16 = int16(uint8(c))
+ v.AuxInt = int16ToAuxInt(_auxint)
return true
}
// match: (ZeroExt8to16 (Trunc16to8 x:(Rsh16Ux64 _ (Const64 [s]))))
func rewriteValuegeneric_OpZeroExt8to32(v *Value) bool {
v_0 := v.Args[0]
// match: (ZeroExt8to32 (Const8 [c]))
- // result: (Const32 [int64( uint8(c))])
+ // result: (Const32 [int32( uint8(c))])
for {
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
v.reset(OpConst32)
- v.AuxInt = int64(uint8(c))
+ var _auxint int32 = int32(uint8(c))
+ v.AuxInt = int32ToAuxInt(_auxint)
return true
}
// match: (ZeroExt8to32 (Trunc32to8 x:(Rsh32Ux64 _ (Const64 [s]))))
if v_0.Op != OpConst8 {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt8(v_0.AuxInt)
v.reset(OpConst64)
- v.AuxInt = int64(uint8(c))
+ var _auxint int64 = int64(uint8(c))
+ v.AuxInt = int64ToAuxInt(_auxint)
return true
}
// match: (ZeroExt8to64 (Trunc64to8 x:(Rsh64Ux64 _ (Const64 [s]))))