(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 [f2i(float64(i2f32(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 [f2i(float64(float32(int32(c))))])
-(Cvt32to64F (Const32 [c])) -> (Const64F [f2i(float64(int32(c)))])
-(Cvt64to32F (Const64 [c])) -> (Const32F [f2i(float64(float32(c)))])
-(Cvt64to64F (Const64 [c])) -> (Const64F [f2i(float64(c))])
-(Cvt32Fto32 (Const32F [c])) -> (Const32 [int64(int32(i2f(c)))])
-(Cvt32Fto64 (Const32F [c])) -> (Const64 [int64(i2f(c))])
-(Cvt64Fto32 (Const64F [c])) -> (Const32 [int64(int32(i2f(c)))])
-(Cvt64Fto64 (Const64F [c])) -> (Const64 [int64(i2f(c))])
+(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
(Neg16 (Const16 [c])) -> (Const16 [int64(-int16(c))])
(Neg32 (Const32 [c])) -> (Const32 [int64(-int32(c))])
(Neg64 (Const64 [c])) -> (Const64 [-c])
-(Neg32F (Const32F [c])) && i2f(c) != 0 -> (Const32F [f2i(-i2f(c))])
-(Neg64F (Const64F [c])) && i2f(c) != 0 -> (Const64F [f2i(-i2f(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])) ->
- (Const32F [f2i(float64(i2f32(c) + i2f32(d)))]) // ensure we combine the operands with 32 bit precision
-(Add64F (Const64F [c]) (Const64F [d])) -> (Const64F [f2i(i2f(c) + i2f(d))])
+(Add32F (Const32F [c]) (Const32F [d])) -> (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))])
+(Add64F (Const64F [c]) (Const64F [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])
(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])) ->
- (Const32F [f2i(float64(i2f32(c) - i2f32(d)))])
-(Sub64F (Const64F [c]) (Const64F [d])) -> (Const64F [f2i(i2f(c) - i2f(d))])
+(Sub32F (Const32F [c]) (Const32F [d])) -> (Const32F [auxFrom32F(auxTo32F(c) - auxTo32F(d))])
+(Sub64F (Const64F [c]) (Const64F [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])) ->
- (Const32F [f2i(float64(i2f32(c) * i2f32(d)))])
-(Mul64F (Const64F [c]) (Const64F [d])) -> (Const64F [f2i(i2f(c) * i2f(d))])
+(Mul32F (Const32F [c]) (Const32F [d])) -> (Const32F [auxFrom32F(auxTo32F(c) * auxTo32F(d))])
+(Mul64F (Const64F [c]) (Const64F [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))])
(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])) -> (Const32F [f2i(float64(i2f32(c) / i2f32(d)))])
-(Div64F (Const64F [c]) (Const64F [d])) -> (Const64F [f2i(i2f(c) / i2f(d))])
+(Div32F (Const32F [c]) (Const32F [d])) -> (Const32F [auxFrom32F(auxTo32F(c) / auxTo32F(d))])
+(Div64F (Const64F [c]) (Const64F [d])) -> (Const64F [auxFrom64F(auxTo64F(c) / auxTo64F(d))])
(Not (ConstBool [c])) -> (ConstBool [1-c])
(Leq8U (Const8 [c]) (Const8 [d])) -> (ConstBool [b2i(uint8(c) <= uint8(d))])
// constant floating point comparisons
-(Eq(64|32)F (Const(64|32)F [c]) (Const(64|32)F [d])) -> (ConstBool [b2i(i2f(c) == i2f(d))])
-(Neq(64|32)F (Const(64|32)F [c]) (Const(64|32)F [d])) -> (ConstBool [b2i(i2f(c) != i2f(d))])
-(Greater(64|32)F (Const(64|32)F [c]) (Const(64|32)F [d])) -> (ConstBool [b2i(i2f(c) > i2f(d))])
-(Geq(64|32)F (Const(64|32)F [c]) (Const(64|32)F [d])) -> (ConstBool [b2i(i2f(c) >= i2f(d))])
-(Less(64|32)F (Const(64|32)F [c]) (Const(64|32)F [d])) -> (ConstBool [b2i(i2f(c) < i2f(d))])
-(Leq(64|32)F (Const(64|32)F [c]) (Const(64|32)F [d])) -> (ConstBool [b2i(i2f(c) <= i2f(d))])
+(Eq32F (Const32F [c]) (Const32F [d])) -> (ConstBool [b2i(auxTo32F(c) == auxTo32F(d))])
+(Eq64F (Const64F [c]) (Const64F [d])) -> (ConstBool [b2i(auxTo64F(c) == auxTo64F(d))])
+(Neq32F (Const32F [c]) (Const32F [d])) -> (ConstBool [b2i(auxTo32F(c) != auxTo32F(d))])
+(Neq64F (Const64F [c]) (Const64F [d])) -> (ConstBool [b2i(auxTo64F(c) != auxTo64F(d))])
+(Greater32F (Const32F [c]) (Const32F [d])) -> (ConstBool [b2i(auxTo32F(c) > auxTo32F(d))])
+(Greater64F (Const64F [c]) (Const64F [d])) -> (ConstBool [b2i(auxTo64F(c) > auxTo64F(d))])
+(Geq32F (Const32F [c]) (Const32F [d])) -> (ConstBool [b2i(auxTo32F(c) >= auxTo32F(d))])
+(Geq64F (Const64F [c]) (Const64F [d])) -> (ConstBool [b2i(auxTo64F(c) >= auxTo64F(d))])
+(Less32F (Const32F [c]) (Const32F [d])) -> (ConstBool [b2i(auxTo32F(c) < auxTo32F(d))])
+(Less64F (Const64F [c]) (Const64F [d])) -> (ConstBool [b2i(auxTo64F(c) < auxTo64F(d))])
+(Leq32F (Const32F [c]) (Const32F [d])) -> (ConstBool [b2i(auxTo32F(c) <= auxTo32F(d))])
+(Leq64F (Const64F [c]) (Const64F [d])) -> (ConstBool [b2i(auxTo64F(c) <= auxTo64F(d))])
// simplifications
(Or(64|32|16|8) x x) -> x
// Pass constants through math.Float{32,64}bits and math.Float{32,64}frombits
(Load <t1> p1 (Store {t2} p2 (Const64 [x]) _)) && isSamePtr(p1,p2) && sizeof(t2) == 8 && is64BitFloat(t1) -> (Const64F [x])
-(Load <t1> p1 (Store {t2} p2 (Const32 [x]) _)) && isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitFloat(t1) -> (Const32F [f2i(extend32Fto64F(math.Float32frombits(uint32(x))))])
+(Load <t1> p1 (Store {t2} p2 (Const32 [x]) _)) && isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitFloat(t1) -> (Const32F [auxFrom32F(math.Float32frombits(uint32(x)))])
(Load <t1> p1 (Store {t2} p2 (Const64F [x]) _)) && isSamePtr(p1,p2) && sizeof(t2) == 8 && is64BitInt(t1) -> (Const64 [x])
-(Load <t1> p1 (Store {t2} p2 (Const32F [x]) _)) && isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitInt(t1) -> (Const32 [int64(int32(math.Float32bits(truncate64Fto32F(i2f(x)))))])
+(Load <t1> p1 (Store {t2} p2 (Const32F [x]) _)) && isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitInt(t1) -> (Const32 [int64(int32(math.Float32bits(auxTo32F(x))))])
// Float Loads up to Zeros so they can be constant folded.
(Load <t1> op:(OffPtr [o1] p1)
(Add(32|64)F x (Const(32|64)F [0])) -> x
(Sub(32|64)F x (Const(32|64)F [0])) -> x
-(Mul(32|64)F x (Const(32|64)F [f2i(1)])) -> x
-(Mul32F x (Const32F [f2i(-1)])) -> (Neg32F x)
-(Mul64F x (Const64F [f2i(-1)])) -> (Neg64F x)
-(Mul32F x (Const32F [f2i(2)])) -> (Add32F x x)
-(Mul64F x (Const64F [f2i(2)])) -> (Add64F x x)
+(Mul(32|64)F x (Const(32|64)F [auxFrom64F(1)])) -> x
+(Mul32F x (Const32F [auxFrom32F(-1)])) -> (Neg32F x)
+(Mul64F x (Const64F [auxFrom64F(-1)])) -> (Neg64F x)
+(Mul32F x (Const32F [auxFrom32F(2)])) -> (Add32F x x)
+(Mul64F x (Const64F [auxFrom64F(2)])) -> (Add64F x x)
-(Div32F x (Const32F <t> [c])) && reciprocalExact32(float32(i2f(c))) -> (Mul32F x (Const32F <t> [f2i(1/i2f(c))]))
-(Div64F x (Const64F <t> [c])) && reciprocalExact64(i2f(c)) -> (Mul64F x (Const64F <t> [f2i(1/i2f(c))]))
+(Div32F x (Const32F <t> [c])) && reciprocalExact32(auxTo32F(c)) -> (Mul32F x (Const32F <t> [auxFrom32F(1/auxTo32F(c))]))
+(Div64F x (Const64F <t> [c])) && reciprocalExact64(auxTo64F(c)) -> (Mul64F x (Const64F <t> [auxFrom64F(1/auxTo64F(c))]))
-(Sqrt (Const64F [c])) -> (Const64F [f2i(math.Sqrt(i2f(c)))])
+(Sqrt (Const64F [c])) -> (Const64F [auxFrom64F(math.Sqrt(auxTo64F(c)))])
// recognize runtime.newobject and don't Zero/Nilcheck it
(Zero (Load (OffPtr [c] (SP)) mem) mem)
func rewriteValuegeneric_OpAdd32F_0(v *Value) bool {
// match: (Add32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (Const32F [f2i(float64(i2f32(c) + i2f32(d)))])
+ // result: (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(i2f32(c) + i2f32(d)))
+ v.AuxInt = auxFrom32F(auxTo32F(c) + auxTo32F(d))
return true
}
// match: (Add32F (Const32F [d]) (Const32F [c]))
// cond:
- // result: (Const32F [f2i(float64(i2f32(c) + i2f32(d)))])
+ // result: (Const32F [auxFrom32F(auxTo32F(c) + auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(i2f32(c) + i2f32(d)))
+ v.AuxInt = auxFrom32F(auxTo32F(c) + auxTo32F(d))
return true
}
// match: (Add32F x (Const32F [0]))
func rewriteValuegeneric_OpAdd64F_0(v *Value) bool {
// match: (Add64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (Const64F [f2i(i2f(c) + i2f(d))])
+ // result: (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(i2f(c) + i2f(d))
+ v.AuxInt = auxFrom64F(auxTo64F(c) + auxTo64F(d))
return true
}
// match: (Add64F (Const64F [d]) (Const64F [c]))
// cond:
- // result: (Const64F [f2i(i2f(c) + i2f(d))])
+ // result: (Const64F [auxFrom64F(auxTo64F(c) + auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(i2f(c) + i2f(d))
+ v.AuxInt = auxFrom64F(auxTo64F(c) + auxTo64F(d))
return true
}
// match: (Add64F x (Const64F [0]))
func rewriteValuegeneric_OpCvt32Fto32_0(v *Value) bool {
// match: (Cvt32Fto32 (Const32F [c]))
// cond:
- // result: (Const32 [int64(int32(i2f(c)))])
+ // result: (Const32 [int64(int32(auxTo32F(c)))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst32F {
}
c := v_0.AuxInt
v.reset(OpConst32)
- v.AuxInt = int64(int32(i2f(c)))
+ v.AuxInt = int64(int32(auxTo32F(c)))
return true
}
return false
func rewriteValuegeneric_OpCvt32Fto64_0(v *Value) bool {
// match: (Cvt32Fto64 (Const32F [c]))
// cond:
- // result: (Const64 [int64(i2f(c))])
+ // result: (Const64 [int64(auxTo32F(c))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst32F {
}
c := v_0.AuxInt
v.reset(OpConst64)
- v.AuxInt = int64(i2f(c))
+ v.AuxInt = int64(auxTo32F(c))
return true
}
return false
func rewriteValuegeneric_OpCvt32to32F_0(v *Value) bool {
// match: (Cvt32to32F (Const32 [c]))
// cond:
- // result: (Const32F [f2i(float64(float32(int32(c))))])
+ // result: (Const32F [auxFrom32F(float32(int32(c)))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst32 {
}
c := v_0.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(float32(int32(c))))
+ v.AuxInt = auxFrom32F(float32(int32(c)))
return true
}
return false
func rewriteValuegeneric_OpCvt32to64F_0(v *Value) bool {
// match: (Cvt32to64F (Const32 [c]))
// cond:
- // result: (Const64F [f2i(float64(int32(c)))])
+ // result: (Const64F [auxFrom64F(float64(int32(c)))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst32 {
}
c := v_0.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(float64(int32(c)))
+ v.AuxInt = auxFrom64F(float64(int32(c)))
return true
}
return false
func rewriteValuegeneric_OpCvt64Fto32_0(v *Value) bool {
// match: (Cvt64Fto32 (Const64F [c]))
// cond:
- // result: (Const32 [int64(int32(i2f(c)))])
+ // result: (Const32 [int64(int32(auxTo64F(c)))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst64F {
}
c := v_0.AuxInt
v.reset(OpConst32)
- v.AuxInt = int64(int32(i2f(c)))
+ v.AuxInt = int64(int32(auxTo64F(c)))
return true
}
return false
func rewriteValuegeneric_OpCvt64Fto32F_0(v *Value) bool {
// match: (Cvt64Fto32F (Const64F [c]))
// cond:
- // result: (Const32F [f2i(float64(i2f32(c)))])
+ // result: (Const32F [auxFrom32F(float32(auxTo64F(c)))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst64F {
}
c := v_0.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(i2f32(c)))
+ v.AuxInt = auxFrom32F(float32(auxTo64F(c)))
return true
}
return false
func rewriteValuegeneric_OpCvt64Fto64_0(v *Value) bool {
// match: (Cvt64Fto64 (Const64F [c]))
// cond:
- // result: (Const64 [int64(i2f(c))])
+ // result: (Const64 [int64(auxTo64F(c))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst64F {
}
c := v_0.AuxInt
v.reset(OpConst64)
- v.AuxInt = int64(i2f(c))
+ v.AuxInt = int64(auxTo64F(c))
return true
}
return false
func rewriteValuegeneric_OpCvt64to32F_0(v *Value) bool {
// match: (Cvt64to32F (Const64 [c]))
// cond:
- // result: (Const32F [f2i(float64(float32(c)))])
+ // result: (Const32F [auxFrom32F(float32(c))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst64 {
}
c := v_0.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(float32(c)))
+ v.AuxInt = auxFrom32F(float32(c))
return true
}
return false
func rewriteValuegeneric_OpCvt64to64F_0(v *Value) bool {
// match: (Cvt64to64F (Const64 [c]))
// cond:
- // result: (Const64F [f2i(float64(c))])
+ // result: (Const64F [auxFrom64F(float64(c))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst64 {
}
c := v_0.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(float64(c))
+ v.AuxInt = auxFrom64F(float64(c))
return true
}
return false
_ = b
// match: (Div32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (Const32F [f2i(float64(i2f32(c) / i2f32(d)))])
+ // result: (Const32F [auxFrom32F(auxTo32F(c) / auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(i2f32(c) / i2f32(d)))
+ v.AuxInt = auxFrom32F(auxTo32F(c) / auxTo32F(d))
return true
}
// match: (Div32F x (Const32F <t> [c]))
- // cond: reciprocalExact32(float32(i2f(c)))
- // result: (Mul32F x (Const32F <t> [f2i(1/i2f(c))]))
+ // cond: reciprocalExact32(auxTo32F(c))
+ // result: (Mul32F x (Const32F <t> [auxFrom32F(1/auxTo32F(c))]))
for {
_ = v.Args[1]
x := v.Args[0]
}
t := v_1.Type
c := v_1.AuxInt
- if !(reciprocalExact32(float32(i2f(c)))) {
+ if !(reciprocalExact32(auxTo32F(c))) {
break
}
v.reset(OpMul32F)
v.AddArg(x)
v0 := b.NewValue0(v.Pos, OpConst32F, t)
- v0.AuxInt = f2i(1 / i2f(c))
+ v0.AuxInt = auxFrom32F(1 / auxTo32F(c))
v.AddArg(v0)
return true
}
_ = b
// match: (Div64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (Const64F [f2i(i2f(c) / i2f(d))])
+ // result: (Const64F [auxFrom64F(auxTo64F(c) / auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(i2f(c) / i2f(d))
+ v.AuxInt = auxFrom64F(auxTo64F(c) / auxTo64F(d))
return true
}
// match: (Div64F x (Const64F <t> [c]))
- // cond: reciprocalExact64(i2f(c))
- // result: (Mul64F x (Const64F <t> [f2i(1/i2f(c))]))
+ // cond: reciprocalExact64(auxTo64F(c))
+ // result: (Mul64F x (Const64F <t> [auxFrom64F(1/auxTo64F(c))]))
for {
_ = v.Args[1]
x := v.Args[0]
}
t := v_1.Type
c := v_1.AuxInt
- if !(reciprocalExact64(i2f(c))) {
+ if !(reciprocalExact64(auxTo64F(c))) {
break
}
v.reset(OpMul64F)
v.AddArg(x)
v0 := b.NewValue0(v.Pos, OpConst64F, t)
- v0.AuxInt = f2i(1 / i2f(c))
+ v0.AuxInt = auxFrom64F(1 / auxTo64F(c))
v.AddArg(v0)
return true
}
func rewriteValuegeneric_OpEq32F_0(v *Value) bool {
// match: (Eq32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) == i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) == auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) == i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) == auxTo32F(d))
return true
}
// match: (Eq32F (Const32F [d]) (Const32F [c]))
// cond:
- // result: (ConstBool [b2i(i2f(c) == i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) == auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) == i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) == auxTo32F(d))
return true
}
return false
func rewriteValuegeneric_OpEq64F_0(v *Value) bool {
// match: (Eq64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) == i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) == auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) == i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) == auxTo64F(d))
return true
}
// match: (Eq64F (Const64F [d]) (Const64F [c]))
// cond:
- // result: (ConstBool [b2i(i2f(c) == i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) == auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) == i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) == auxTo64F(d))
return true
}
return false
func rewriteValuegeneric_OpGeq32F_0(v *Value) bool {
// match: (Geq32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) >= i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) >= auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) >= i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) >= auxTo32F(d))
return true
}
return false
func rewriteValuegeneric_OpGeq64F_0(v *Value) bool {
// match: (Geq64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) >= i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) >= auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) >= i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) >= auxTo64F(d))
return true
}
return false
func rewriteValuegeneric_OpGreater32F_0(v *Value) bool {
// match: (Greater32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) > i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) > auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) > i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) > auxTo32F(d))
return true
}
return false
func rewriteValuegeneric_OpGreater64F_0(v *Value) bool {
// match: (Greater64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) > i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) > auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) > i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) > auxTo64F(d))
return true
}
return false
func rewriteValuegeneric_OpLeq32F_0(v *Value) bool {
// match: (Leq32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) <= i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) <= auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) <= i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) <= auxTo32F(d))
return true
}
return false
func rewriteValuegeneric_OpLeq64F_0(v *Value) bool {
// match: (Leq64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) <= i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) <= auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) <= i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) <= auxTo64F(d))
return true
}
return false
func rewriteValuegeneric_OpLess32F_0(v *Value) bool {
// match: (Less32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) < i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) < auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) < i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) < auxTo32F(d))
return true
}
return false
func rewriteValuegeneric_OpLess64F_0(v *Value) bool {
// match: (Less64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) < i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) < auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) < i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) < auxTo64F(d))
return true
}
return false
}
// match: (Load <t1> p1 (Store {t2} p2 (Const32 [x]) _))
// cond: isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitFloat(t1)
- // result: (Const32F [f2i(extend32Fto64F(math.Float32frombits(uint32(x))))])
+ // result: (Const32F [auxFrom32F(math.Float32frombits(uint32(x)))])
for {
t1 := v.Type
_ = v.Args[1]
break
}
v.reset(OpConst32F)
- v.AuxInt = f2i(extend32Fto64F(math.Float32frombits(uint32(x))))
+ v.AuxInt = auxFrom32F(math.Float32frombits(uint32(x)))
return true
}
// match: (Load <t1> p1 (Store {t2} p2 (Const64F [x]) _))
}
// match: (Load <t1> p1 (Store {t2} p2 (Const32F [x]) _))
// cond: isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitInt(t1)
- // result: (Const32 [int64(int32(math.Float32bits(truncate64Fto32F(i2f(x)))))])
+ // result: (Const32 [int64(int32(math.Float32bits(auxTo32F(x))))])
for {
t1 := v.Type
_ = v.Args[1]
break
}
v.reset(OpConst32)
- v.AuxInt = int64(int32(math.Float32bits(truncate64Fto32F(i2f(x)))))
+ v.AuxInt = int64(int32(math.Float32bits(auxTo32F(x))))
return true
}
// match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ mem:(Zero [n] p3 _)))
func rewriteValuegeneric_OpMul32F_0(v *Value) bool {
// match: (Mul32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (Const32F [f2i(float64(i2f32(c) * i2f32(d)))])
+ // result: (Const32F [auxFrom32F(auxTo32F(c) * auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(i2f32(c) * i2f32(d)))
+ v.AuxInt = auxFrom32F(auxTo32F(c) * auxTo32F(d))
return true
}
// match: (Mul32F (Const32F [d]) (Const32F [c]))
// cond:
- // result: (Const32F [f2i(float64(i2f32(c) * i2f32(d)))])
+ // result: (Const32F [auxFrom32F(auxTo32F(c) * auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(i2f32(c) * i2f32(d)))
+ v.AuxInt = auxFrom32F(auxTo32F(c) * auxTo32F(d))
return true
}
- // match: (Mul32F x (Const32F [f2i(1)]))
+ // match: (Mul32F x (Const32F [auxFrom64F(1)]))
// cond:
// result: x
for {
if v_1.Op != OpConst32F {
break
}
- if v_1.AuxInt != f2i(1) {
+ if v_1.AuxInt != auxFrom64F(1) {
break
}
v.reset(OpCopy)
v.AddArg(x)
return true
}
- // match: (Mul32F (Const32F [f2i(1)]) x)
+ // match: (Mul32F (Const32F [auxFrom64F(1)]) x)
// cond:
// result: x
for {
if v_0.Op != OpConst32F {
break
}
- if v_0.AuxInt != f2i(1) {
+ if v_0.AuxInt != auxFrom64F(1) {
break
}
x := v.Args[1]
v.AddArg(x)
return true
}
- // match: (Mul32F x (Const32F [f2i(-1)]))
+ // match: (Mul32F x (Const32F [auxFrom32F(-1)]))
// cond:
// result: (Neg32F x)
for {
if v_1.Op != OpConst32F {
break
}
- if v_1.AuxInt != f2i(-1) {
+ if v_1.AuxInt != auxFrom32F(-1) {
break
}
v.reset(OpNeg32F)
v.AddArg(x)
return true
}
- // match: (Mul32F (Const32F [f2i(-1)]) x)
+ // match: (Mul32F (Const32F [auxFrom32F(-1)]) x)
// cond:
// result: (Neg32F x)
for {
if v_0.Op != OpConst32F {
break
}
- if v_0.AuxInt != f2i(-1) {
+ if v_0.AuxInt != auxFrom32F(-1) {
break
}
x := v.Args[1]
v.AddArg(x)
return true
}
- // match: (Mul32F x (Const32F [f2i(2)]))
+ // match: (Mul32F x (Const32F [auxFrom32F(2)]))
// cond:
// result: (Add32F x x)
for {
if v_1.Op != OpConst32F {
break
}
- if v_1.AuxInt != f2i(2) {
+ if v_1.AuxInt != auxFrom32F(2) {
break
}
v.reset(OpAdd32F)
v.AddArg(x)
return true
}
- // match: (Mul32F (Const32F [f2i(2)]) x)
+ // match: (Mul32F (Const32F [auxFrom32F(2)]) x)
// cond:
// result: (Add32F x x)
for {
if v_0.Op != OpConst32F {
break
}
- if v_0.AuxInt != f2i(2) {
+ if v_0.AuxInt != auxFrom32F(2) {
break
}
x := v.Args[1]
func rewriteValuegeneric_OpMul64F_0(v *Value) bool {
// match: (Mul64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (Const64F [f2i(i2f(c) * i2f(d))])
+ // result: (Const64F [auxFrom64F(auxTo64F(c) * auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(i2f(c) * i2f(d))
+ v.AuxInt = auxFrom64F(auxTo64F(c) * auxTo64F(d))
return true
}
// match: (Mul64F (Const64F [d]) (Const64F [c]))
// cond:
- // result: (Const64F [f2i(i2f(c) * i2f(d))])
+ // result: (Const64F [auxFrom64F(auxTo64F(c) * auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(i2f(c) * i2f(d))
+ v.AuxInt = auxFrom64F(auxTo64F(c) * auxTo64F(d))
return true
}
- // match: (Mul64F x (Const64F [f2i(1)]))
+ // match: (Mul64F x (Const64F [auxFrom64F(1)]))
// cond:
// result: x
for {
if v_1.Op != OpConst64F {
break
}
- if v_1.AuxInt != f2i(1) {
+ if v_1.AuxInt != auxFrom64F(1) {
break
}
v.reset(OpCopy)
v.AddArg(x)
return true
}
- // match: (Mul64F (Const64F [f2i(1)]) x)
+ // match: (Mul64F (Const64F [auxFrom64F(1)]) x)
// cond:
// result: x
for {
if v_0.Op != OpConst64F {
break
}
- if v_0.AuxInt != f2i(1) {
+ if v_0.AuxInt != auxFrom64F(1) {
break
}
x := v.Args[1]
v.AddArg(x)
return true
}
- // match: (Mul64F x (Const64F [f2i(-1)]))
+ // match: (Mul64F x (Const64F [auxFrom64F(-1)]))
// cond:
// result: (Neg64F x)
for {
if v_1.Op != OpConst64F {
break
}
- if v_1.AuxInt != f2i(-1) {
+ if v_1.AuxInt != auxFrom64F(-1) {
break
}
v.reset(OpNeg64F)
v.AddArg(x)
return true
}
- // match: (Mul64F (Const64F [f2i(-1)]) x)
+ // match: (Mul64F (Const64F [auxFrom64F(-1)]) x)
// cond:
// result: (Neg64F x)
for {
if v_0.Op != OpConst64F {
break
}
- if v_0.AuxInt != f2i(-1) {
+ if v_0.AuxInt != auxFrom64F(-1) {
break
}
x := v.Args[1]
v.AddArg(x)
return true
}
- // match: (Mul64F x (Const64F [f2i(2)]))
+ // match: (Mul64F x (Const64F [auxFrom64F(2)]))
// cond:
// result: (Add64F x x)
for {
if v_1.Op != OpConst64F {
break
}
- if v_1.AuxInt != f2i(2) {
+ if v_1.AuxInt != auxFrom64F(2) {
break
}
v.reset(OpAdd64F)
v.AddArg(x)
return true
}
- // match: (Mul64F (Const64F [f2i(2)]) x)
+ // match: (Mul64F (Const64F [auxFrom64F(2)]) x)
// cond:
// result: (Add64F x x)
for {
if v_0.Op != OpConst64F {
break
}
- if v_0.AuxInt != f2i(2) {
+ if v_0.AuxInt != auxFrom64F(2) {
break
}
x := v.Args[1]
}
func rewriteValuegeneric_OpNeg32F_0(v *Value) bool {
// match: (Neg32F (Const32F [c]))
- // cond: i2f(c) != 0
- // result: (Const32F [f2i(-i2f(c))])
+ // cond: auxTo32F(c) != 0
+ // result: (Const32F [auxFrom32F(-auxTo32F(c))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst32F {
break
}
c := v_0.AuxInt
- if !(i2f(c) != 0) {
+ if !(auxTo32F(c) != 0) {
break
}
v.reset(OpConst32F)
- v.AuxInt = f2i(-i2f(c))
+ v.AuxInt = auxFrom32F(-auxTo32F(c))
return true
}
return false
}
func rewriteValuegeneric_OpNeg64F_0(v *Value) bool {
// match: (Neg64F (Const64F [c]))
- // cond: i2f(c) != 0
- // result: (Const64F [f2i(-i2f(c))])
+ // cond: auxTo64F(c) != 0
+ // result: (Const64F [auxFrom64F(-auxTo64F(c))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst64F {
break
}
c := v_0.AuxInt
- if !(i2f(c) != 0) {
+ if !(auxTo64F(c) != 0) {
break
}
v.reset(OpConst64F)
- v.AuxInt = f2i(-i2f(c))
+ v.AuxInt = auxFrom64F(-auxTo64F(c))
return true
}
return false
func rewriteValuegeneric_OpNeq32F_0(v *Value) bool {
// match: (Neq32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) != i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) != auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) != i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) != auxTo32F(d))
return true
}
// match: (Neq32F (Const32F [d]) (Const32F [c]))
// cond:
- // result: (ConstBool [b2i(i2f(c) != i2f(d))])
+ // result: (ConstBool [b2i(auxTo32F(c) != auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) != i2f(d))
+ v.AuxInt = b2i(auxTo32F(c) != auxTo32F(d))
return true
}
return false
func rewriteValuegeneric_OpNeq64F_0(v *Value) bool {
// match: (Neq64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (ConstBool [b2i(i2f(c) != i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) != auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) != i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) != auxTo64F(d))
return true
}
// match: (Neq64F (Const64F [d]) (Const64F [c]))
// cond:
- // result: (ConstBool [b2i(i2f(c) != i2f(d))])
+ // result: (ConstBool [b2i(auxTo64F(c) != auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
c := v_1.AuxInt
v.reset(OpConstBool)
- v.AuxInt = b2i(i2f(c) != i2f(d))
+ v.AuxInt = b2i(auxTo64F(c) != auxTo64F(d))
return true
}
return false
func rewriteValuegeneric_OpSqrt_0(v *Value) bool {
// match: (Sqrt (Const64F [c]))
// cond:
- // result: (Const64F [f2i(math.Sqrt(i2f(c)))])
+ // result: (Const64F [auxFrom64F(math.Sqrt(auxTo64F(c)))])
for {
v_0 := v.Args[0]
if v_0.Op != OpConst64F {
}
c := v_0.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(math.Sqrt(i2f(c)))
+ v.AuxInt = auxFrom64F(math.Sqrt(auxTo64F(c)))
return true
}
return false
func rewriteValuegeneric_OpSub32F_0(v *Value) bool {
// match: (Sub32F (Const32F [c]) (Const32F [d]))
// cond:
- // result: (Const32F [f2i(float64(i2f32(c) - i2f32(d)))])
+ // result: (Const32F [auxFrom32F(auxTo32F(c) - auxTo32F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst32F)
- v.AuxInt = f2i(float64(i2f32(c) - i2f32(d)))
+ v.AuxInt = auxFrom32F(auxTo32F(c) - auxTo32F(d))
return true
}
// match: (Sub32F x (Const32F [0]))
func rewriteValuegeneric_OpSub64F_0(v *Value) bool {
// match: (Sub64F (Const64F [c]) (Const64F [d]))
// cond:
- // result: (Const64F [f2i(i2f(c) - i2f(d))])
+ // result: (Const64F [auxFrom64F(auxTo64F(c) - auxTo64F(d))])
for {
_ = v.Args[1]
v_0 := v.Args[0]
}
d := v_1.AuxInt
v.reset(OpConst64F)
- v.AuxInt = f2i(i2f(c) - i2f(d))
+ v.AuxInt = auxFrom64F(auxTo64F(c) - auxTo64F(d))
return true
}
// match: (Sub64F x (Const64F [0]))