| // autogenerated from gen/generic.rules: do not edit! |
| // generated with: cd gen; go run *.go |
| package ssa |
| |
| import "math" |
| |
| var _ = math.MinInt8 // in case not otherwise used |
| func rewriteValuegeneric(v *Value, config *Config) bool { |
| switch v.Op { |
| case OpAdd16: |
| return rewriteValuegeneric_OpAdd16(v, config) |
| case OpAdd32: |
| return rewriteValuegeneric_OpAdd32(v, config) |
| case OpAdd64: |
| return rewriteValuegeneric_OpAdd64(v, config) |
| case OpAdd8: |
| return rewriteValuegeneric_OpAdd8(v, config) |
| case OpAnd16: |
| return rewriteValuegeneric_OpAnd16(v, config) |
| case OpAnd32: |
| return rewriteValuegeneric_OpAnd32(v, config) |
| case OpAnd64: |
| return rewriteValuegeneric_OpAnd64(v, config) |
| case OpAnd8: |
| return rewriteValuegeneric_OpAnd8(v, config) |
| case OpArg: |
| return rewriteValuegeneric_OpArg(v, config) |
| case OpArrayIndex: |
| return rewriteValuegeneric_OpArrayIndex(v, config) |
| case OpCom16: |
| return rewriteValuegeneric_OpCom16(v, config) |
| case OpCom32: |
| return rewriteValuegeneric_OpCom32(v, config) |
| case OpCom64: |
| return rewriteValuegeneric_OpCom64(v, config) |
| case OpCom8: |
| return rewriteValuegeneric_OpCom8(v, config) |
| case OpComplexImag: |
| return rewriteValuegeneric_OpComplexImag(v, config) |
| case OpComplexReal: |
| return rewriteValuegeneric_OpComplexReal(v, config) |
| case OpConstInterface: |
| return rewriteValuegeneric_OpConstInterface(v, config) |
| case OpConstSlice: |
| return rewriteValuegeneric_OpConstSlice(v, config) |
| case OpConstString: |
| return rewriteValuegeneric_OpConstString(v, config) |
| case OpConvert: |
| return rewriteValuegeneric_OpConvert(v, config) |
| case OpEq16: |
| return rewriteValuegeneric_OpEq16(v, config) |
| case OpEq32: |
| return rewriteValuegeneric_OpEq32(v, config) |
| case OpEq64: |
| return rewriteValuegeneric_OpEq64(v, config) |
| case OpEq8: |
| return rewriteValuegeneric_OpEq8(v, config) |
| case OpEqInter: |
| return rewriteValuegeneric_OpEqInter(v, config) |
| case OpEqPtr: |
| return rewriteValuegeneric_OpEqPtr(v, config) |
| case OpEqSlice: |
| return rewriteValuegeneric_OpEqSlice(v, config) |
| case OpGeq16: |
| return rewriteValuegeneric_OpGeq16(v, config) |
| case OpGeq16U: |
| return rewriteValuegeneric_OpGeq16U(v, config) |
| case OpGeq32: |
| return rewriteValuegeneric_OpGeq32(v, config) |
| case OpGeq32U: |
| return rewriteValuegeneric_OpGeq32U(v, config) |
| case OpGeq64: |
| return rewriteValuegeneric_OpGeq64(v, config) |
| case OpGeq64U: |
| return rewriteValuegeneric_OpGeq64U(v, config) |
| case OpGeq8: |
| return rewriteValuegeneric_OpGeq8(v, config) |
| case OpGeq8U: |
| return rewriteValuegeneric_OpGeq8U(v, config) |
| case OpGreater16: |
| return rewriteValuegeneric_OpGreater16(v, config) |
| case OpGreater16U: |
| return rewriteValuegeneric_OpGreater16U(v, config) |
| case OpGreater32: |
| return rewriteValuegeneric_OpGreater32(v, config) |
| case OpGreater32U: |
| return rewriteValuegeneric_OpGreater32U(v, config) |
| case OpGreater64: |
| return rewriteValuegeneric_OpGreater64(v, config) |
| case OpGreater64U: |
| return rewriteValuegeneric_OpGreater64U(v, config) |
| case OpGreater8: |
| return rewriteValuegeneric_OpGreater8(v, config) |
| case OpGreater8U: |
| return rewriteValuegeneric_OpGreater8U(v, config) |
| case OpIData: |
| return rewriteValuegeneric_OpIData(v, config) |
| case OpITab: |
| return rewriteValuegeneric_OpITab(v, config) |
| case OpIsInBounds: |
| return rewriteValuegeneric_OpIsInBounds(v, config) |
| case OpIsSliceInBounds: |
| return rewriteValuegeneric_OpIsSliceInBounds(v, config) |
| case OpLeq16: |
| return rewriteValuegeneric_OpLeq16(v, config) |
| case OpLeq16U: |
| return rewriteValuegeneric_OpLeq16U(v, config) |
| case OpLeq32: |
| return rewriteValuegeneric_OpLeq32(v, config) |
| case OpLeq32U: |
| return rewriteValuegeneric_OpLeq32U(v, config) |
| case OpLeq64: |
| return rewriteValuegeneric_OpLeq64(v, config) |
| case OpLeq64U: |
| return rewriteValuegeneric_OpLeq64U(v, config) |
| case OpLeq8: |
| return rewriteValuegeneric_OpLeq8(v, config) |
| case OpLeq8U: |
| return rewriteValuegeneric_OpLeq8U(v, config) |
| case OpLess16: |
| return rewriteValuegeneric_OpLess16(v, config) |
| case OpLess16U: |
| return rewriteValuegeneric_OpLess16U(v, config) |
| case OpLess32: |
| return rewriteValuegeneric_OpLess32(v, config) |
| case OpLess32U: |
| return rewriteValuegeneric_OpLess32U(v, config) |
| case OpLess64: |
| return rewriteValuegeneric_OpLess64(v, config) |
| case OpLess64U: |
| return rewriteValuegeneric_OpLess64U(v, config) |
| case OpLess8: |
| return rewriteValuegeneric_OpLess8(v, config) |
| case OpLess8U: |
| return rewriteValuegeneric_OpLess8U(v, config) |
| case OpLoad: |
| return rewriteValuegeneric_OpLoad(v, config) |
| case OpMul16: |
| return rewriteValuegeneric_OpMul16(v, config) |
| case OpMul32: |
| return rewriteValuegeneric_OpMul32(v, config) |
| case OpMul64: |
| return rewriteValuegeneric_OpMul64(v, config) |
| case OpMul8: |
| return rewriteValuegeneric_OpMul8(v, config) |
| case OpNeq16: |
| return rewriteValuegeneric_OpNeq16(v, config) |
| case OpNeq32: |
| return rewriteValuegeneric_OpNeq32(v, config) |
| case OpNeq64: |
| return rewriteValuegeneric_OpNeq64(v, config) |
| case OpNeq8: |
| return rewriteValuegeneric_OpNeq8(v, config) |
| case OpNeqInter: |
| return rewriteValuegeneric_OpNeqInter(v, config) |
| case OpNeqPtr: |
| return rewriteValuegeneric_OpNeqPtr(v, config) |
| case OpNeqSlice: |
| return rewriteValuegeneric_OpNeqSlice(v, config) |
| case OpOr16: |
| return rewriteValuegeneric_OpOr16(v, config) |
| case OpOr32: |
| return rewriteValuegeneric_OpOr32(v, config) |
| case OpOr64: |
| return rewriteValuegeneric_OpOr64(v, config) |
| case OpOr8: |
| return rewriteValuegeneric_OpOr8(v, config) |
| case OpPtrIndex: |
| return rewriteValuegeneric_OpPtrIndex(v, config) |
| case OpSliceCap: |
| return rewriteValuegeneric_OpSliceCap(v, config) |
| case OpSliceLen: |
| return rewriteValuegeneric_OpSliceLen(v, config) |
| case OpSlicePtr: |
| return rewriteValuegeneric_OpSlicePtr(v, config) |
| case OpStore: |
| return rewriteValuegeneric_OpStore(v, config) |
| case OpStringLen: |
| return rewriteValuegeneric_OpStringLen(v, config) |
| case OpStringPtr: |
| return rewriteValuegeneric_OpStringPtr(v, config) |
| case OpStructSelect: |
| return rewriteValuegeneric_OpStructSelect(v, config) |
| case OpSub16: |
| return rewriteValuegeneric_OpSub16(v, config) |
| case OpSub32: |
| return rewriteValuegeneric_OpSub32(v, config) |
| case OpSub64: |
| return rewriteValuegeneric_OpSub64(v, config) |
| case OpSub8: |
| return rewriteValuegeneric_OpSub8(v, config) |
| case OpXor16: |
| return rewriteValuegeneric_OpXor16(v, config) |
| case OpXor32: |
| return rewriteValuegeneric_OpXor32(v, config) |
| case OpXor64: |
| return rewriteValuegeneric_OpXor64(v, config) |
| case OpXor8: |
| return rewriteValuegeneric_OpXor8(v, config) |
| } |
| return false |
| } |
| func rewriteValuegeneric_OpAdd16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (Const16 [c+d]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end359c546ef662b7990116329cb30d6892 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end359c546ef662b7990116329cb30d6892 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst16 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c + d |
| return true |
| } |
| goto end359c546ef662b7990116329cb30d6892 |
| end359c546ef662b7990116329cb30d6892: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpAdd32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (Const32 [c+d]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto enda3edaa9a512bd1d7a95f002c890bfb88 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto enda3edaa9a512bd1d7a95f002c890bfb88 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst32 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c + d |
| return true |
| } |
| goto enda3edaa9a512bd1d7a95f002c890bfb88 |
| enda3edaa9a512bd1d7a95f002c890bfb88: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpAdd64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (Const64 [c+d]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end8c46df6f85a11cb1d594076b0e467908 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end8c46df6f85a11cb1d594076b0e467908 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst64 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c + d |
| return true |
| } |
| goto end8c46df6f85a11cb1d594076b0e467908 |
| end8c46df6f85a11cb1d594076b0e467908: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpAdd8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Add8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (Const8 [c+d]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto end60c66721511a442aade8e4da2fb326bd |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto end60c66721511a442aade8e4da2fb326bd |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst8 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c + d |
| return true |
| } |
| goto end60c66721511a442aade8e4da2fb326bd |
| end60c66721511a442aade8e4da2fb326bd: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpAnd16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (And16 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end69ed6ee2a4fb0491b56c17f3c1926b10 |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end69ed6ee2a4fb0491b56c17f3c1926b10 |
| end69ed6ee2a4fb0491b56c17f3c1926b10: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpAnd32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (And32 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto endbbe8c3c5b2ca8f013aa178d856f3a99c |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto endbbe8c3c5b2ca8f013aa178d856f3a99c |
| endbbe8c3c5b2ca8f013aa178d856f3a99c: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpAnd64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (And64 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto endc9736bf24d2e5cd8d662e1bcf3164640 |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto endc9736bf24d2e5cd8d662e1bcf3164640 |
| endc9736bf24d2e5cd8d662e1bcf3164640: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpAnd8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (And8 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto endeaf127389bd0d4b0e0e297830f8f463b |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto endeaf127389bd0d4b0e0e297830f8f463b |
| endeaf127389bd0d4b0e0e297830f8f463b: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpArg(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Arg {n} [off]) |
| // cond: v.Type.IsString() |
| // result: (StringMake (Arg <config.fe.TypeBytePtr()> {n} [off]) (Arg <config.fe.TypeInt()> {n} [off+config.PtrSize])) |
| { |
| n := v.Aux |
| off := v.AuxInt |
| if !(v.Type.IsString()) { |
| goto end939d3f946bf61eb85b46b374e7afa9e9 |
| } |
| v.Op = OpStringMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.Aux = n |
| v0.AuxInt = off |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v1.Aux = n |
| v1.AuxInt = off + config.PtrSize |
| v.AddArg(v1) |
| return true |
| } |
| goto end939d3f946bf61eb85b46b374e7afa9e9 |
| end939d3f946bf61eb85b46b374e7afa9e9: |
| ; |
| // match: (Arg {n} [off]) |
| // cond: v.Type.IsSlice() |
| // result: (SliceMake (Arg <config.fe.TypeBytePtr()> {n} [off]) (Arg <config.fe.TypeInt()> {n} [off+config.PtrSize]) (Arg <config.fe.TypeInt()> {n} [off+2*config.PtrSize])) |
| { |
| n := v.Aux |
| off := v.AuxInt |
| if !(v.Type.IsSlice()) { |
| goto endab4b93ad3b1cf55e5bf25d1fd9cd498e |
| } |
| v.Op = OpSliceMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.Aux = n |
| v0.AuxInt = off |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v1.Aux = n |
| v1.AuxInt = off + config.PtrSize |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v2.Type = config.fe.TypeInt() |
| v2.Aux = n |
| v2.AuxInt = off + 2*config.PtrSize |
| v.AddArg(v2) |
| return true |
| } |
| goto endab4b93ad3b1cf55e5bf25d1fd9cd498e |
| endab4b93ad3b1cf55e5bf25d1fd9cd498e: |
| ; |
| // match: (Arg {n} [off]) |
| // cond: v.Type.IsInterface() |
| // result: (IMake (Arg <config.fe.TypeBytePtr()> {n} [off]) (Arg <config.fe.TypeBytePtr()> {n} [off+config.PtrSize])) |
| { |
| n := v.Aux |
| off := v.AuxInt |
| if !(v.Type.IsInterface()) { |
| goto end851de8e588a39e81b4e2aef06566bf3e |
| } |
| v.Op = OpIMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.Aux = n |
| v0.AuxInt = off |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v1.Type = config.fe.TypeBytePtr() |
| v1.Aux = n |
| v1.AuxInt = off + config.PtrSize |
| v.AddArg(v1) |
| return true |
| } |
| goto end851de8e588a39e81b4e2aef06566bf3e |
| end851de8e588a39e81b4e2aef06566bf3e: |
| ; |
| // match: (Arg {n} [off]) |
| // cond: v.Type.IsComplex() && v.Type.Size() == 16 |
| // result: (ComplexMake (Arg <config.fe.TypeFloat64()> {n} [off]) (Arg <config.fe.TypeFloat64()> {n} [off+8])) |
| { |
| n := v.Aux |
| off := v.AuxInt |
| if !(v.Type.IsComplex() && v.Type.Size() == 16) { |
| goto end0988fc6a62c810b2f4976cb6cf44387f |
| } |
| v.Op = OpComplexMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v0.Type = config.fe.TypeFloat64() |
| v0.Aux = n |
| v0.AuxInt = off |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v1.Type = config.fe.TypeFloat64() |
| v1.Aux = n |
| v1.AuxInt = off + 8 |
| v.AddArg(v1) |
| return true |
| } |
| goto end0988fc6a62c810b2f4976cb6cf44387f |
| end0988fc6a62c810b2f4976cb6cf44387f: |
| ; |
| // match: (Arg {n} [off]) |
| // cond: v.Type.IsComplex() && v.Type.Size() == 8 |
| // result: (ComplexMake (Arg <config.fe.TypeFloat32()> {n} [off]) (Arg <config.fe.TypeFloat32()> {n} [off+4])) |
| { |
| n := v.Aux |
| off := v.AuxInt |
| if !(v.Type.IsComplex() && v.Type.Size() == 8) { |
| goto enda348e93e0036873dd7089a2939c22e3e |
| } |
| v.Op = OpComplexMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v0.Type = config.fe.TypeFloat32() |
| v0.Aux = n |
| v0.AuxInt = off |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpArg, TypeInvalid) |
| v1.Type = config.fe.TypeFloat32() |
| v1.Aux = n |
| v1.AuxInt = off + 4 |
| v.AddArg(v1) |
| return true |
| } |
| goto enda348e93e0036873dd7089a2939c22e3e |
| enda348e93e0036873dd7089a2939c22e3e: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpArrayIndex(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ArrayIndex (Load ptr mem) idx) |
| // cond: b == v.Args[0].Block |
| // result: (Load (PtrIndex <v.Type.PtrTo()> ptr idx) mem) |
| { |
| if v.Args[0].Op != OpLoad { |
| goto end68b373270d9d605c420497edefaa71df |
| } |
| ptr := v.Args[0].Args[0] |
| mem := v.Args[0].Args[1] |
| idx := v.Args[1] |
| if !(b == v.Args[0].Block) { |
| goto end68b373270d9d605c420497edefaa71df |
| } |
| v.Op = OpLoad |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpPtrIndex, TypeInvalid) |
| v0.Type = v.Type.PtrTo() |
| v0.AddArg(ptr) |
| v0.AddArg(idx) |
| v.AddArg(v0) |
| v.AddArg(mem) |
| return true |
| } |
| goto end68b373270d9d605c420497edefaa71df |
| end68b373270d9d605c420497edefaa71df: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpCom16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com16 (Com16 x)) |
| // cond: |
| // result: x |
| { |
| if v.Args[0].Op != OpCom16 { |
| goto end1ea17710dd4dd7ba4e710e0e4c7b5a56 |
| } |
| x := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end1ea17710dd4dd7ba4e710e0e4c7b5a56 |
| end1ea17710dd4dd7ba4e710e0e4c7b5a56: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpCom32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com32 (Com32 x)) |
| // cond: |
| // result: x |
| { |
| if v.Args[0].Op != OpCom32 { |
| goto end9a04ed536496e292c27bef4414128cbf |
| } |
| x := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end9a04ed536496e292c27bef4414128cbf |
| end9a04ed536496e292c27bef4414128cbf: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpCom64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com64 (Com64 x)) |
| // cond: |
| // result: x |
| { |
| if v.Args[0].Op != OpCom64 { |
| goto ended44e29d5968f0f7b86972b7bf417ab3 |
| } |
| x := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto ended44e29d5968f0f7b86972b7bf417ab3 |
| ended44e29d5968f0f7b86972b7bf417ab3: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpCom8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Com8 (Com8 x)) |
| // cond: |
| // result: x |
| { |
| if v.Args[0].Op != OpCom8 { |
| goto end4d92ff3ba567d9afd38fc9ca113602ad |
| } |
| x := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end4d92ff3ba567d9afd38fc9ca113602ad |
| end4d92ff3ba567d9afd38fc9ca113602ad: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpComplexImag(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ComplexImag (ComplexMake _ imag )) |
| // cond: |
| // result: imag |
| { |
| if v.Args[0].Op != OpComplexMake { |
| goto endec3009fd8727d03002021997936e091f |
| } |
| imag := v.Args[0].Args[1] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = imag.Type |
| v.AddArg(imag) |
| return true |
| } |
| goto endec3009fd8727d03002021997936e091f |
| endec3009fd8727d03002021997936e091f: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpComplexReal(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ComplexReal (ComplexMake real _ )) |
| // cond: |
| // result: real |
| { |
| if v.Args[0].Op != OpComplexMake { |
| goto end8db3e16bd59af1adaa4b734c8adcc71d |
| } |
| real := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = real.Type |
| v.AddArg(real) |
| return true |
| } |
| goto end8db3e16bd59af1adaa4b734c8adcc71d |
| end8db3e16bd59af1adaa4b734c8adcc71d: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpConstInterface(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ConstInterface) |
| // cond: |
| // result: (IMake (ConstNil <config.fe.TypeBytePtr()>) (ConstNil <config.fe.TypeBytePtr()>)) |
| { |
| v.Op = OpIMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpConstNil, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpConstNil, TypeInvalid) |
| v1.Type = config.fe.TypeBytePtr() |
| v.AddArg(v1) |
| return true |
| } |
| goto end0367bd8f20a320cc41568f2b28657f6b |
| end0367bd8f20a320cc41568f2b28657f6b: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpConstSlice(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ConstSlice) |
| // cond: config.PtrSize == 4 |
| // result: (SliceMake (ConstNil <config.fe.TypeBytePtr()>) (Const32 <config.fe.TypeInt()> [0]) (Const32 <config.fe.TypeInt()> [0])) |
| { |
| if !(config.PtrSize == 4) { |
| goto end9ba6baf9c7247b1f5ba4099c0c3910ce |
| } |
| v.Op = OpSliceMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpConstNil, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpConst32, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v1.AuxInt = 0 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpConst32, TypeInvalid) |
| v2.Type = config.fe.TypeInt() |
| v2.AuxInt = 0 |
| v.AddArg(v2) |
| return true |
| } |
| goto end9ba6baf9c7247b1f5ba4099c0c3910ce |
| end9ba6baf9c7247b1f5ba4099c0c3910ce: |
| ; |
| // match: (ConstSlice) |
| // cond: config.PtrSize == 8 |
| // result: (SliceMake (ConstNil <config.fe.TypeBytePtr()>) (Const64 <config.fe.TypeInt()> [0]) (Const64 <config.fe.TypeInt()> [0])) |
| { |
| if !(config.PtrSize == 8) { |
| goto endabee2aa6bd3e3261628f677221ad2640 |
| } |
| v.Op = OpSliceMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpConstNil, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpConst64, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v1.AuxInt = 0 |
| v.AddArg(v1) |
| v2 := b.NewValue0(v.Line, OpConst64, TypeInvalid) |
| v2.Type = config.fe.TypeInt() |
| v2.AuxInt = 0 |
| v.AddArg(v2) |
| return true |
| } |
| goto endabee2aa6bd3e3261628f677221ad2640 |
| endabee2aa6bd3e3261628f677221ad2640: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpConstString(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ConstString {s}) |
| // cond: config.PtrSize == 4 |
| // result: (StringMake (Addr <config.fe.TypeBytePtr()> {config.fe.StringData(s.(string))} (SB)) (Const32 <config.fe.TypeInt()> [int64(len(s.(string)))])) |
| { |
| s := v.Aux |
| if !(config.PtrSize == 4) { |
| goto endaa2b20a40588873f370c5a12f084505a |
| } |
| v.Op = OpStringMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpAddr, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.Aux = config.fe.StringData(s.(string)) |
| v1 := b.NewValue0(v.Line, OpSB, TypeInvalid) |
| v1.Type = config.fe.TypeUintptr() |
| v0.AddArg(v1) |
| v.AddArg(v0) |
| v2 := b.NewValue0(v.Line, OpConst32, TypeInvalid) |
| v2.Type = config.fe.TypeInt() |
| v2.AuxInt = int64(len(s.(string))) |
| v.AddArg(v2) |
| return true |
| } |
| goto endaa2b20a40588873f370c5a12f084505a |
| endaa2b20a40588873f370c5a12f084505a: |
| ; |
| // match: (ConstString {s}) |
| // cond: config.PtrSize == 8 |
| // result: (StringMake (Addr <config.fe.TypeBytePtr()> {config.fe.StringData(s.(string))} (SB)) (Const64 <config.fe.TypeInt()> [int64(len(s.(string)))])) |
| { |
| s := v.Aux |
| if !(config.PtrSize == 8) { |
| goto endab37d89f3959d3cf1e71b57a3c61b8eb |
| } |
| v.Op = OpStringMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpAddr, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.Aux = config.fe.StringData(s.(string)) |
| v1 := b.NewValue0(v.Line, OpSB, TypeInvalid) |
| v1.Type = config.fe.TypeUintptr() |
| v0.AddArg(v1) |
| v.AddArg(v0) |
| v2 := b.NewValue0(v.Line, OpConst64, TypeInvalid) |
| v2.Type = config.fe.TypeInt() |
| v2.AuxInt = int64(len(s.(string))) |
| v.AddArg(v2) |
| return true |
| } |
| goto endab37d89f3959d3cf1e71b57a3c61b8eb |
| endab37d89f3959d3cf1e71b57a3c61b8eb: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpConvert(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Convert (Add64 (Convert ptr) off)) |
| // cond: |
| // result: (Add64 ptr off) |
| { |
| if v.Args[0].Op != OpAdd64 { |
| goto end913a7ecf456c00ffbee36c2dbbf0e1af |
| } |
| if v.Args[0].Args[0].Op != OpConvert { |
| goto end913a7ecf456c00ffbee36c2dbbf0e1af |
| } |
| ptr := v.Args[0].Args[0].Args[0] |
| off := v.Args[0].Args[1] |
| v.Op = OpAdd64 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AddArg(ptr) |
| v.AddArg(off) |
| return true |
| } |
| goto end913a7ecf456c00ffbee36c2dbbf0e1af |
| end913a7ecf456c00ffbee36c2dbbf0e1af: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpEq16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq16 x x) |
| // cond: |
| // result: (ConstBool [1]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end0c0fe5fdfba3821add3448fd3f1fc6b7 |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 1 |
| return true |
| } |
| goto end0c0fe5fdfba3821add3448fd3f1fc6b7 |
| end0c0fe5fdfba3821add3448fd3f1fc6b7: |
| ; |
| // match: (Eq16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int16(c) == int16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end4532e1d01c10d8906fe1da14f9dfaa88 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end4532e1d01c10d8906fe1da14f9dfaa88 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int16(c) == int16(d)) |
| return true |
| } |
| goto end4532e1d01c10d8906fe1da14f9dfaa88 |
| end4532e1d01c10d8906fe1da14f9dfaa88: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpEq32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq32 x x) |
| // cond: |
| // result: (ConstBool [1]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end6da547ec4ee93d787434f3bda873e4a0 |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 1 |
| return true |
| } |
| goto end6da547ec4ee93d787434f3bda873e4a0 |
| end6da547ec4ee93d787434f3bda873e4a0: |
| ; |
| // match: (Eq32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int32(c) == int32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end00a2464e02c9ca00e8d0077acacbb5ad |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end00a2464e02c9ca00e8d0077acacbb5ad |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int32(c) == int32(d)) |
| return true |
| } |
| goto end00a2464e02c9ca00e8d0077acacbb5ad |
| end00a2464e02c9ca00e8d0077acacbb5ad: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpEq64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq64 x x) |
| // cond: |
| // result: (ConstBool [1]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto endb1d471cc503ba8bb05440f01dbf33d81 |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 1 |
| return true |
| } |
| goto endb1d471cc503ba8bb05440f01dbf33d81 |
| endb1d471cc503ba8bb05440f01dbf33d81: |
| ; |
| // match: (Eq64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int64(c) == int64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end405568a707dbbc86432e91f4ce7d97d7 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end405568a707dbbc86432e91f4ce7d97d7 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int64(c) == int64(d)) |
| return true |
| } |
| goto end405568a707dbbc86432e91f4ce7d97d7 |
| end405568a707dbbc86432e91f4ce7d97d7: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpEq8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Eq8 x x) |
| // cond: |
| // result: (ConstBool [1]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto enda66da0d3e7e51624ee46527727c48a9a |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 1 |
| return true |
| } |
| goto enda66da0d3e7e51624ee46527727c48a9a |
| enda66da0d3e7e51624ee46527727c48a9a: |
| ; |
| // match: (Eq8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int8(c) == int8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto endd49f3700ba2d1e500d3ab4fa34fd090d |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto endd49f3700ba2d1e500d3ab4fa34fd090d |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int8(c) == int8(d)) |
| return true |
| } |
| goto endd49f3700ba2d1e500d3ab4fa34fd090d |
| endd49f3700ba2d1e500d3ab4fa34fd090d: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpEqInter(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (EqInter x y) |
| // cond: |
| // result: (EqPtr (ITab x) (ITab y)) |
| { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.Op = OpEqPtr |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpITab, TypeInvalid) |
| v0.AddArg(x) |
| v0.Type = config.fe.TypeBytePtr() |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpITab, TypeInvalid) |
| v1.AddArg(y) |
| v1.Type = config.fe.TypeBytePtr() |
| v.AddArg(v1) |
| return true |
| } |
| goto end1cc40483caab33ece971ab7e6c8fdfca |
| end1cc40483caab33ece971ab7e6c8fdfca: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpEqPtr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (EqPtr p (ConstNil)) |
| // cond: |
| // result: (Not (IsNonNil p)) |
| { |
| p := v.Args[0] |
| if v.Args[1].Op != OpConstNil { |
| goto ende701cdb6a2c1fff4d4b283b7f8f6178b |
| } |
| v.Op = OpNot |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpIsNonNil, TypeInvalid) |
| v0.AddArg(p) |
| v0.Type = config.fe.TypeBool() |
| v.AddArg(v0) |
| return true |
| } |
| goto ende701cdb6a2c1fff4d4b283b7f8f6178b |
| ende701cdb6a2c1fff4d4b283b7f8f6178b: |
| ; |
| // match: (EqPtr (ConstNil) p) |
| // cond: |
| // result: (Not (IsNonNil p)) |
| { |
| if v.Args[0].Op != OpConstNil { |
| goto end7cdc0d5c38fbffe6287c8928803b038e |
| } |
| p := v.Args[1] |
| v.Op = OpNot |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpIsNonNil, TypeInvalid) |
| v0.AddArg(p) |
| v0.Type = config.fe.TypeBool() |
| v.AddArg(v0) |
| return true |
| } |
| goto end7cdc0d5c38fbffe6287c8928803b038e |
| end7cdc0d5c38fbffe6287c8928803b038e: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpEqSlice(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (EqSlice x y) |
| // cond: |
| // result: (EqPtr (SlicePtr x) (SlicePtr y)) |
| { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.Op = OpEqPtr |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpSlicePtr, TypeInvalid) |
| v0.AddArg(x) |
| v0.Type = config.fe.TypeBytePtr() |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpSlicePtr, TypeInvalid) |
| v1.AddArg(y) |
| v1.Type = config.fe.TypeBytePtr() |
| v.AddArg(v1) |
| return true |
| } |
| goto end9cd53ca57ee90aa09c54f8071c8e8769 |
| end9cd53ca57ee90aa09c54f8071c8e8769: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int16(c) >= int16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto endbac100e9f1065e7d2ff863951f686f4b |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto endbac100e9f1065e7d2ff863951f686f4b |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int16(c) >= int16(d)) |
| return true |
| } |
| goto endbac100e9f1065e7d2ff863951f686f4b |
| endbac100e9f1065e7d2ff863951f686f4b: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq16U (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint16(c) >= uint16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end11c6acbc5827fc9508424b0ffcf98b34 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end11c6acbc5827fc9508424b0ffcf98b34 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint16(c) >= uint16(d)) |
| return true |
| } |
| goto end11c6acbc5827fc9508424b0ffcf98b34 |
| end11c6acbc5827fc9508424b0ffcf98b34: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int32(c) >= int32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end89ced97524ac75045911ca7cf6d44b28 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end89ced97524ac75045911ca7cf6d44b28 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int32(c) >= int32(d)) |
| return true |
| } |
| goto end89ced97524ac75045911ca7cf6d44b28 |
| end89ced97524ac75045911ca7cf6d44b28: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq32U (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint32(c) >= uint32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end92fbe85c7bbbf0db287932822bdde991 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end92fbe85c7bbbf0db287932822bdde991 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint32(c) >= uint32(d)) |
| return true |
| } |
| goto end92fbe85c7bbbf0db287932822bdde991 |
| end92fbe85c7bbbf0db287932822bdde991: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int64(c) >= int64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end08a5a4bff12a346befe05ad561b080ac |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end08a5a4bff12a346befe05ad561b080ac |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int64(c) >= int64(d)) |
| return true |
| } |
| goto end08a5a4bff12a346befe05ad561b080ac |
| end08a5a4bff12a346befe05ad561b080ac: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq64U (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint64(c) >= uint64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto endd72c497b6cc2b01d43a39ec12d5010b3 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto endd72c497b6cc2b01d43a39ec12d5010b3 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint64(c) >= uint64(d)) |
| return true |
| } |
| goto endd72c497b6cc2b01d43a39ec12d5010b3 |
| endd72c497b6cc2b01d43a39ec12d5010b3: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int8(c) >= int8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto endea141068e84038c63cbdd87a8cb227d7 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto endea141068e84038c63cbdd87a8cb227d7 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int8(c) >= int8(d)) |
| return true |
| } |
| goto endea141068e84038c63cbdd87a8cb227d7 |
| endea141068e84038c63cbdd87a8cb227d7: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGeq8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Geq8U (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint8(c) >= uint8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto end47c128ccdc54151a243c5856b0c52ef1 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto end47c128ccdc54151a243c5856b0c52ef1 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint8(c) >= uint8(d)) |
| return true |
| } |
| goto end47c128ccdc54151a243c5856b0c52ef1 |
| end47c128ccdc54151a243c5856b0c52ef1: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int16(c) > int16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end390bae49463ace4d703dd24e18920f66 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end390bae49463ace4d703dd24e18920f66 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int16(c) > int16(d)) |
| return true |
| } |
| goto end390bae49463ace4d703dd24e18920f66 |
| end390bae49463ace4d703dd24e18920f66: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater16U (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint16(c) > uint16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end89ba3caf5c156fa6d908ac04c058187b |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end89ba3caf5c156fa6d908ac04c058187b |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint16(c) > uint16(d)) |
| return true |
| } |
| goto end89ba3caf5c156fa6d908ac04c058187b |
| end89ba3caf5c156fa6d908ac04c058187b: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int32(c) > int32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end86482a9dc6439e8470da5352dd74d68d |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end86482a9dc6439e8470da5352dd74d68d |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int32(c) > int32(d)) |
| return true |
| } |
| goto end86482a9dc6439e8470da5352dd74d68d |
| end86482a9dc6439e8470da5352dd74d68d: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater32U (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint32(c) > uint32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end1bf3f05c1e3599a969b8be1f5f6949e4 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end1bf3f05c1e3599a969b8be1f5f6949e4 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint32(c) > uint32(d)) |
| return true |
| } |
| goto end1bf3f05c1e3599a969b8be1f5f6949e4 |
| end1bf3f05c1e3599a969b8be1f5f6949e4: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int64(c) > int64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end96a82e893fda4882f23b6bab5f7fbff7 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end96a82e893fda4882f23b6bab5f7fbff7 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int64(c) > int64(d)) |
| return true |
| } |
| goto end96a82e893fda4882f23b6bab5f7fbff7 |
| end96a82e893fda4882f23b6bab5f7fbff7: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater64U (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint64(c) > uint64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end2d8f5ad85fbffeb92af985a888f6fa69 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end2d8f5ad85fbffeb92af985a888f6fa69 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint64(c) > uint64(d)) |
| return true |
| } |
| goto end2d8f5ad85fbffeb92af985a888f6fa69 |
| end2d8f5ad85fbffeb92af985a888f6fa69: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int8(c) > int8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto ende221967c7516b7749109cf8343fe9c83 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto ende221967c7516b7749109cf8343fe9c83 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int8(c) > int8(d)) |
| return true |
| } |
| goto ende221967c7516b7749109cf8343fe9c83 |
| ende221967c7516b7749109cf8343fe9c83: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpGreater8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Greater8U (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint8(c) > uint8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto enda9398c8188156dd46689fa2939147525 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto enda9398c8188156dd46689fa2939147525 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint8(c) > uint8(d)) |
| return true |
| } |
| goto enda9398c8188156dd46689fa2939147525 |
| enda9398c8188156dd46689fa2939147525: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpIData(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (IData (IMake _ data)) |
| // cond: |
| // result: data |
| { |
| if v.Args[0].Op != OpIMake { |
| goto endbfa1bb944cdc07933effb16a35152e12 |
| } |
| data := v.Args[0].Args[1] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = data.Type |
| v.AddArg(data) |
| return true |
| } |
| goto endbfa1bb944cdc07933effb16a35152e12 |
| endbfa1bb944cdc07933effb16a35152e12: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpITab(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (ITab (IMake itab _)) |
| // cond: |
| // result: itab |
| { |
| if v.Args[0].Op != OpIMake { |
| goto endfcbb9414a776ff9c8512da3e0f4d8fbd |
| } |
| itab := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = itab.Type |
| v.AddArg(itab) |
| return true |
| } |
| goto endfcbb9414a776ff9c8512da3e0f4d8fbd |
| endfcbb9414a776ff9c8512da3e0f4d8fbd: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpIsInBounds(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (IsInBounds (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(inBounds32(c,d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto endf0a2ecfe84b293de6ff0919e45d19d9d |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto endf0a2ecfe84b293de6ff0919e45d19d9d |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(inBounds32(c, d)) |
| return true |
| } |
| goto endf0a2ecfe84b293de6ff0919e45d19d9d |
| endf0a2ecfe84b293de6ff0919e45d19d9d: |
| ; |
| // match: (IsInBounds (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(inBounds64(c,d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end4b406f402c135f50f71effcc904ecb2b |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end4b406f402c135f50f71effcc904ecb2b |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(inBounds64(c, d)) |
| return true |
| } |
| goto end4b406f402c135f50f71effcc904ecb2b |
| end4b406f402c135f50f71effcc904ecb2b: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpIsSliceInBounds(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (IsSliceInBounds (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(sliceInBounds32(c,d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end5e84a230c28cac987437cfed8f432cc3 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end5e84a230c28cac987437cfed8f432cc3 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(sliceInBounds32(c, d)) |
| return true |
| } |
| goto end5e84a230c28cac987437cfed8f432cc3 |
| end5e84a230c28cac987437cfed8f432cc3: |
| ; |
| // match: (IsSliceInBounds (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(sliceInBounds64(c,d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end3880a6fe20ad4152e98f76d84da233a7 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end3880a6fe20ad4152e98f76d84da233a7 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(sliceInBounds64(c, d)) |
| return true |
| } |
| goto end3880a6fe20ad4152e98f76d84da233a7 |
| end3880a6fe20ad4152e98f76d84da233a7: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int16(c) <= int16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end76b1c51f9b7cd7ee2f75b9f7057569de |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end76b1c51f9b7cd7ee2f75b9f7057569de |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int16(c) <= int16(d)) |
| return true |
| } |
| goto end76b1c51f9b7cd7ee2f75b9f7057569de |
| end76b1c51f9b7cd7ee2f75b9f7057569de: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq16U (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint16(c) <= uint16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto endf010fdf7f2c438ec18c33f493dd062aa |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto endf010fdf7f2c438ec18c33f493dd062aa |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint16(c) <= uint16(d)) |
| return true |
| } |
| goto endf010fdf7f2c438ec18c33f493dd062aa |
| endf010fdf7f2c438ec18c33f493dd062aa: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int32(c) <= int32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end6c7d61cfd188680bea8a5e23f08ca1de |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end6c7d61cfd188680bea8a5e23f08ca1de |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int32(c) <= int32(d)) |
| return true |
| } |
| goto end6c7d61cfd188680bea8a5e23f08ca1de |
| end6c7d61cfd188680bea8a5e23f08ca1de: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq32U (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint32(c) <= uint32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end4363555333511ee9b649b36f1a0ba34e |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end4363555333511ee9b649b36f1a0ba34e |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint32(c) <= uint32(d)) |
| return true |
| } |
| goto end4363555333511ee9b649b36f1a0ba34e |
| end4363555333511ee9b649b36f1a0ba34e: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int64(c) <= int64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto enddc865cd7ac2093abc7617bedbf371c22 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto enddc865cd7ac2093abc7617bedbf371c22 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int64(c) <= int64(d)) |
| return true |
| } |
| goto enddc865cd7ac2093abc7617bedbf371c22 |
| enddc865cd7ac2093abc7617bedbf371c22: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq64U (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint64(c) <= uint64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end412eadb168738ba92f3f0705d4495305 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end412eadb168738ba92f3f0705d4495305 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint64(c) <= uint64(d)) |
| return true |
| } |
| goto end412eadb168738ba92f3f0705d4495305 |
| end412eadb168738ba92f3f0705d4495305: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int8(c) <= int8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto endb5a459da8e18c40abc0c7a20e71d0187 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto endb5a459da8e18c40abc0c7a20e71d0187 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int8(c) <= int8(d)) |
| return true |
| } |
| goto endb5a459da8e18c40abc0c7a20e71d0187 |
| endb5a459da8e18c40abc0c7a20e71d0187: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLeq8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Leq8U (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint8(c) <= uint8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto endd6622d55fcdf3fa7b08e7511cd3b7d85 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto endd6622d55fcdf3fa7b08e7511cd3b7d85 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint8(c) <= uint8(d)) |
| return true |
| } |
| goto endd6622d55fcdf3fa7b08e7511cd3b7d85 |
| endd6622d55fcdf3fa7b08e7511cd3b7d85: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int16(c) < int16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end0dc915d089f05e79589ebb5c498cc360 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end0dc915d089f05e79589ebb5c498cc360 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int16(c) < int16(d)) |
| return true |
| } |
| goto end0dc915d089f05e79589ebb5c498cc360 |
| end0dc915d089f05e79589ebb5c498cc360: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess16U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less16U (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint16(c) < uint16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto endd2bb8249443788690946fc184631a00a |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto endd2bb8249443788690946fc184631a00a |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint16(c) < uint16(d)) |
| return true |
| } |
| goto endd2bb8249443788690946fc184631a00a |
| endd2bb8249443788690946fc184631a00a: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int32(c) < int32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto endc86f65e499688809d414f03539bec5bf |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto endc86f65e499688809d414f03539bec5bf |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int32(c) < int32(d)) |
| return true |
| } |
| goto endc86f65e499688809d414f03539bec5bf |
| endc86f65e499688809d414f03539bec5bf: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess32U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less32U (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint32(c) < uint32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end2cc68b5247b1afb90a9d3923b28ff247 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end2cc68b5247b1afb90a9d3923b28ff247 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint32(c) < uint32(d)) |
| return true |
| } |
| goto end2cc68b5247b1afb90a9d3923b28ff247 |
| end2cc68b5247b1afb90a9d3923b28ff247: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int64(c) < int64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end505de73cd15125dbb59b05d8975d3128 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end505de73cd15125dbb59b05d8975d3128 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int64(c) < int64(d)) |
| return true |
| } |
| goto end505de73cd15125dbb59b05d8975d3128 |
| end505de73cd15125dbb59b05d8975d3128: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess64U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less64U (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint64(c) < uint64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto endeb249ef36416cd1abf4f807026c059cd |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto endeb249ef36416cd1abf4f807026c059cd |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint64(c) < uint64(d)) |
| return true |
| } |
| goto endeb249ef36416cd1abf4f807026c059cd |
| endeb249ef36416cd1abf4f807026c059cd: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int8(c) < int8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto endef134de03bc8537ac1f38d5eccff7673 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto endef134de03bc8537ac1f38d5eccff7673 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int8(c) < int8(d)) |
| return true |
| } |
| goto endef134de03bc8537ac1f38d5eccff7673 |
| endef134de03bc8537ac1f38d5eccff7673: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLess8U(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Less8U (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(uint8(c) < uint8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto end263ecdc279924bff8771dd1ac3f42222 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto end263ecdc279924bff8771dd1ac3f42222 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(uint8(c) < uint8(d)) |
| return true |
| } |
| goto end263ecdc279924bff8771dd1ac3f42222 |
| end263ecdc279924bff8771dd1ac3f42222: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpLoad(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Load <t> ptr mem) |
| // cond: t.IsComplex() && t.Size() == 8 |
| // result: (ComplexMake (Load <config.fe.TypeFloat32()> ptr mem) (Load <config.fe.TypeFloat32()> (OffPtr <config.fe.TypeFloat32().PtrTo()> [4] ptr) mem) ) |
| { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(t.IsComplex() && t.Size() == 8) { |
| goto end665854b31b828893d90b36bb462ff381 |
| } |
| v.Op = OpComplexMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v0.Type = config.fe.TypeFloat32() |
| v0.AddArg(ptr) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v1.Type = config.fe.TypeFloat32() |
| v2 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v2.Type = config.fe.TypeFloat32().PtrTo() |
| v2.AuxInt = 4 |
| v2.AddArg(ptr) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| goto end665854b31b828893d90b36bb462ff381 |
| end665854b31b828893d90b36bb462ff381: |
| ; |
| // match: (Load <t> ptr mem) |
| // cond: t.IsComplex() && t.Size() == 16 |
| // result: (ComplexMake (Load <config.fe.TypeFloat64()> ptr mem) (Load <config.fe.TypeFloat64()> (OffPtr <config.fe.TypeFloat64().PtrTo()> [8] ptr) mem) ) |
| { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(t.IsComplex() && t.Size() == 16) { |
| goto end1b106f89e0e3e26c613b957a7c98d8ad |
| } |
| v.Op = OpComplexMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v0.Type = config.fe.TypeFloat64() |
| v0.AddArg(ptr) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v1.Type = config.fe.TypeFloat64() |
| v2 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v2.Type = config.fe.TypeFloat64().PtrTo() |
| v2.AuxInt = 8 |
| v2.AddArg(ptr) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| goto end1b106f89e0e3e26c613b957a7c98d8ad |
| end1b106f89e0e3e26c613b957a7c98d8ad: |
| ; |
| // match: (Load <t> ptr mem) |
| // cond: t.IsString() |
| // result: (StringMake (Load <config.fe.TypeBytePtr()> ptr mem) (Load <config.fe.TypeInt()> (OffPtr <config.fe.TypeInt().PtrTo()> [config.PtrSize] ptr) mem)) |
| { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(t.IsString()) { |
| goto enddd15a6f3d53a6ce7a19d4e181dd1c13a |
| } |
| v.Op = OpStringMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.AddArg(ptr) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v2 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v2.Type = config.fe.TypeInt().PtrTo() |
| v2.AuxInt = config.PtrSize |
| v2.AddArg(ptr) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| goto enddd15a6f3d53a6ce7a19d4e181dd1c13a |
| enddd15a6f3d53a6ce7a19d4e181dd1c13a: |
| ; |
| // match: (Load <t> ptr mem) |
| // cond: t.IsSlice() |
| // result: (SliceMake (Load <config.fe.TypeBytePtr()> ptr mem) (Load <config.fe.TypeInt()> (OffPtr <config.fe.TypeInt().PtrTo()> [config.PtrSize] ptr) mem) (Load <config.fe.TypeInt()> (OffPtr <config.fe.TypeInt().PtrTo()> [2*config.PtrSize] ptr) mem)) |
| { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(t.IsSlice()) { |
| goto end65e8b0055aa7491b9b6066d9fe1b2c13 |
| } |
| v.Op = OpSliceMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.AddArg(ptr) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v2 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v2.Type = config.fe.TypeInt().PtrTo() |
| v2.AuxInt = config.PtrSize |
| v2.AddArg(ptr) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| v3 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v3.Type = config.fe.TypeInt() |
| v4 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v4.Type = config.fe.TypeInt().PtrTo() |
| v4.AuxInt = 2 * config.PtrSize |
| v4.AddArg(ptr) |
| v3.AddArg(v4) |
| v3.AddArg(mem) |
| v.AddArg(v3) |
| return true |
| } |
| goto end65e8b0055aa7491b9b6066d9fe1b2c13 |
| end65e8b0055aa7491b9b6066d9fe1b2c13: |
| ; |
| // match: (Load <t> ptr mem) |
| // cond: t.IsInterface() |
| // result: (IMake (Load <config.fe.TypeBytePtr()> ptr mem) (Load <config.fe.TypeBytePtr()> (OffPtr <config.fe.TypeBytePtr().PtrTo()> [config.PtrSize] ptr) mem)) |
| { |
| t := v.Type |
| ptr := v.Args[0] |
| mem := v.Args[1] |
| if !(t.IsInterface()) { |
| goto end12671c83ebe3ccbc8e53383765ee7675 |
| } |
| v.Op = OpIMake |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr() |
| v0.AddArg(ptr) |
| v0.AddArg(mem) |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v1.Type = config.fe.TypeBytePtr() |
| v2 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v2.Type = config.fe.TypeBytePtr().PtrTo() |
| v2.AuxInt = config.PtrSize |
| v2.AddArg(ptr) |
| v1.AddArg(v2) |
| v1.AddArg(mem) |
| v.AddArg(v1) |
| return true |
| } |
| goto end12671c83ebe3ccbc8e53383765ee7675 |
| end12671c83ebe3ccbc8e53383765ee7675: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpMul16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (Const16 [c*d]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto ende8dd468add3015aea24531cf3c89ccb7 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto ende8dd468add3015aea24531cf3c89ccb7 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst16 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c * d |
| return true |
| } |
| goto ende8dd468add3015aea24531cf3c89ccb7 |
| ende8dd468add3015aea24531cf3c89ccb7: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpMul32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (Const32 [c*d]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end60b4523099fa7b55e2e872e05bd497a7 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end60b4523099fa7b55e2e872e05bd497a7 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst32 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c * d |
| return true |
| } |
| goto end60b4523099fa7b55e2e872e05bd497a7 |
| end60b4523099fa7b55e2e872e05bd497a7: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpMul64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (Const64 [c*d]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end7aea1048b5d1230974b97f17238380ae |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end7aea1048b5d1230974b97f17238380ae |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst64 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c * d |
| return true |
| } |
| goto end7aea1048b5d1230974b97f17238380ae |
| end7aea1048b5d1230974b97f17238380ae: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpMul8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Mul8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (Const8 [c*d]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto end2f1952fd654c4a62ff00511041728809 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto end2f1952fd654c4a62ff00511041728809 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst8 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c * d |
| return true |
| } |
| goto end2f1952fd654c4a62ff00511041728809 |
| end2f1952fd654c4a62ff00511041728809: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpNeq16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Neq16 x x) |
| // cond: |
| // result: (ConstBool [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto ende76a50b524aeb16c7aeccf5f5cc60c06 |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto ende76a50b524aeb16c7aeccf5f5cc60c06 |
| ende76a50b524aeb16c7aeccf5f5cc60c06: |
| ; |
| // match: (Neq16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int16(c) != int16(d))]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end6302c9b645bb191982d28c2f846904d6 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end6302c9b645bb191982d28c2f846904d6 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int16(c) != int16(d)) |
| return true |
| } |
| goto end6302c9b645bb191982d28c2f846904d6 |
| end6302c9b645bb191982d28c2f846904d6: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpNeq32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Neq32 x x) |
| // cond: |
| // result: (ConstBool [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end3713a608cffd29b40ff7c3b3f2585cbb |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end3713a608cffd29b40ff7c3b3f2585cbb |
| end3713a608cffd29b40ff7c3b3f2585cbb: |
| ; |
| // match: (Neq32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int32(c) != int32(d))]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto endf9f3d0814854d2d0879d331e9bdfcae2 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto endf9f3d0814854d2d0879d331e9bdfcae2 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int32(c) != int32(d)) |
| return true |
| } |
| goto endf9f3d0814854d2d0879d331e9bdfcae2 |
| endf9f3d0814854d2d0879d331e9bdfcae2: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpNeq64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Neq64 x x) |
| // cond: |
| // result: (ConstBool [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end3601ad382705ea12b79d2008c1e5725c |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end3601ad382705ea12b79d2008c1e5725c |
| end3601ad382705ea12b79d2008c1e5725c: |
| ; |
| // match: (Neq64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int64(c) != int64(d))]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto endf07433ecd3c150b1b75e943aa44a7203 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto endf07433ecd3c150b1b75e943aa44a7203 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int64(c) != int64(d)) |
| return true |
| } |
| goto endf07433ecd3c150b1b75e943aa44a7203 |
| endf07433ecd3c150b1b75e943aa44a7203: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpNeq8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Neq8 x x) |
| // cond: |
| // result: (ConstBool [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end09a0deaf3c42627d0d2d3efa96e30745 |
| } |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end09a0deaf3c42627d0d2d3efa96e30745 |
| end09a0deaf3c42627d0d2d3efa96e30745: |
| ; |
| // match: (Neq8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (ConstBool [b2i(int8(c) != int8(d))]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto end72ebdaf2de9b3aa57cf0cb8e068b5f9c |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto end72ebdaf2de9b3aa57cf0cb8e068b5f9c |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConstBool |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = b2i(int8(c) != int8(d)) |
| return true |
| } |
| goto end72ebdaf2de9b3aa57cf0cb8e068b5f9c |
| end72ebdaf2de9b3aa57cf0cb8e068b5f9c: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpNeqInter(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (NeqInter x y) |
| // cond: |
| // result: (NeqPtr (ITab x) (ITab y)) |
| { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.Op = OpNeqPtr |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpITab, TypeInvalid) |
| v0.AddArg(x) |
| v0.Type = config.fe.TypeBytePtr() |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpITab, TypeInvalid) |
| v1.AddArg(y) |
| v1.Type = config.fe.TypeBytePtr() |
| v.AddArg(v1) |
| return true |
| } |
| goto end17b2333bf57e9fe81a671be02f9c4c14 |
| end17b2333bf57e9fe81a671be02f9c4c14: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpNeqPtr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (NeqPtr p (ConstNil)) |
| // cond: |
| // result: (IsNonNil p) |
| { |
| p := v.Args[0] |
| if v.Args[1].Op != OpConstNil { |
| goto endba798520b4d41172b110347158c44791 |
| } |
| v.Op = OpIsNonNil |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AddArg(p) |
| return true |
| } |
| goto endba798520b4d41172b110347158c44791 |
| endba798520b4d41172b110347158c44791: |
| ; |
| // match: (NeqPtr (ConstNil) p) |
| // cond: |
| // result: (IsNonNil p) |
| { |
| if v.Args[0].Op != OpConstNil { |
| goto enddd95e9c3606d9fd48034f1a703561e45 |
| } |
| p := v.Args[1] |
| v.Op = OpIsNonNil |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AddArg(p) |
| return true |
| } |
| goto enddd95e9c3606d9fd48034f1a703561e45 |
| enddd95e9c3606d9fd48034f1a703561e45: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpNeqSlice(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (NeqSlice x y) |
| // cond: |
| // result: (NeqPtr (SlicePtr x) (SlicePtr y)) |
| { |
| x := v.Args[0] |
| y := v.Args[1] |
| v.Op = OpNeqPtr |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v0 := b.NewValue0(v.Line, OpSlicePtr, TypeInvalid) |
| v0.AddArg(x) |
| v0.Type = config.fe.TypeBytePtr() |
| v.AddArg(v0) |
| v1 := b.NewValue0(v.Line, OpSlicePtr, TypeInvalid) |
| v1.AddArg(y) |
| v1.Type = config.fe.TypeBytePtr() |
| v.AddArg(v1) |
| return true |
| } |
| goto endc6bc83c506e491236ca66ea1081231a2 |
| endc6bc83c506e491236ca66ea1081231a2: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpOr16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Or16 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end47a2f25fd31a76807aced3e2b126acdc |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end47a2f25fd31a76807aced3e2b126acdc |
| end47a2f25fd31a76807aced3e2b126acdc: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpOr32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Or32 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end231e283e568e90bd9a3e6a4fa328c8a4 |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end231e283e568e90bd9a3e6a4fa328c8a4 |
| end231e283e568e90bd9a3e6a4fa328c8a4: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpOr64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Or64 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end6b0efc212016dc97d0e3939db04c81d9 |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end6b0efc212016dc97d0e3939db04c81d9 |
| end6b0efc212016dc97d0e3939db04c81d9: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpOr8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Or8 x x) |
| // cond: |
| // result: x |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end05295dbfafd6869af79b4daee9fda000 |
| } |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = x.Type |
| v.AddArg(x) |
| return true |
| } |
| goto end05295dbfafd6869af79b4daee9fda000 |
| end05295dbfafd6869af79b4daee9fda000: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpPtrIndex(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (PtrIndex <t> ptr idx) |
| // cond: config.PtrSize == 4 |
| // result: (AddPtr ptr (Mul32 <config.fe.TypeInt()> idx (Const32 <config.fe.TypeInt()> [t.Elem().Size()]))) |
| { |
| t := v.Type |
| ptr := v.Args[0] |
| idx := v.Args[1] |
| if !(config.PtrSize == 4) { |
| goto endd902622aaa1e7545b5a2a0c08b47d287 |
| } |
| v.Op = OpAddPtr |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AddArg(ptr) |
| v0 := b.NewValue0(v.Line, OpMul32, TypeInvalid) |
| v0.Type = config.fe.TypeInt() |
| v0.AddArg(idx) |
| v1 := b.NewValue0(v.Line, OpConst32, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v1.AuxInt = t.Elem().Size() |
| v0.AddArg(v1) |
| v.AddArg(v0) |
| return true |
| } |
| goto endd902622aaa1e7545b5a2a0c08b47d287 |
| endd902622aaa1e7545b5a2a0c08b47d287: |
| ; |
| // match: (PtrIndex <t> ptr idx) |
| // cond: config.PtrSize == 8 |
| // result: (AddPtr ptr (Mul64 <config.fe.TypeInt()> idx (Const64 <config.fe.TypeInt()> [t.Elem().Size()]))) |
| { |
| t := v.Type |
| ptr := v.Args[0] |
| idx := v.Args[1] |
| if !(config.PtrSize == 8) { |
| goto end47a5f1d1b158914fa383de024bbe3b08 |
| } |
| v.Op = OpAddPtr |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AddArg(ptr) |
| v0 := b.NewValue0(v.Line, OpMul64, TypeInvalid) |
| v0.Type = config.fe.TypeInt() |
| v0.AddArg(idx) |
| v1 := b.NewValue0(v.Line, OpConst64, TypeInvalid) |
| v1.Type = config.fe.TypeInt() |
| v1.AuxInt = t.Elem().Size() |
| v0.AddArg(v1) |
| v.AddArg(v0) |
| return true |
| } |
| goto end47a5f1d1b158914fa383de024bbe3b08 |
| end47a5f1d1b158914fa383de024bbe3b08: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpSliceCap(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (SliceCap (SliceMake _ _ cap)) |
| // cond: |
| // result: cap |
| { |
| if v.Args[0].Op != OpSliceMake { |
| goto end1bd11616743632b33b410964667fb3c6 |
| } |
| cap := v.Args[0].Args[2] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = cap.Type |
| v.AddArg(cap) |
| return true |
| } |
| goto end1bd11616743632b33b410964667fb3c6 |
| end1bd11616743632b33b410964667fb3c6: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpSliceLen(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (SliceLen (SliceMake _ len _)) |
| // cond: |
| // result: len |
| { |
| if v.Args[0].Op != OpSliceMake { |
| goto endebb2090199d13e4c2ae52fb3e778f7fd |
| } |
| len := v.Args[0].Args[1] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = len.Type |
| v.AddArg(len) |
| return true |
| } |
| goto endebb2090199d13e4c2ae52fb3e778f7fd |
| endebb2090199d13e4c2ae52fb3e778f7fd: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpSlicePtr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (SlicePtr (SliceMake ptr _ _ )) |
| // cond: |
| // result: ptr |
| { |
| if v.Args[0].Op != OpSliceMake { |
| goto end526acc0a705137a5d25577499206720b |
| } |
| ptr := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = ptr.Type |
| v.AddArg(ptr) |
| return true |
| } |
| goto end526acc0a705137a5d25577499206720b |
| end526acc0a705137a5d25577499206720b: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpStore(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Store [8] dst (ComplexMake real imag) mem) |
| // cond: |
| // result: (Store [4] (OffPtr <config.fe.TypeFloat32().PtrTo()> [4] dst) imag (Store [4] dst real mem)) |
| { |
| if v.AuxInt != 8 { |
| goto endced898cb0a165662afe48ea44ad3318a |
| } |
| dst := v.Args[0] |
| if v.Args[1].Op != OpComplexMake { |
| goto endced898cb0a165662afe48ea44ad3318a |
| } |
| real := v.Args[1].Args[0] |
| imag := v.Args[1].Args[1] |
| mem := v.Args[2] |
| v.Op = OpStore |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 4 |
| v0 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v0.Type = config.fe.TypeFloat32().PtrTo() |
| v0.AuxInt = 4 |
| v0.AddArg(dst) |
| v.AddArg(v0) |
| v.AddArg(imag) |
| v1 := b.NewValue0(v.Line, OpStore, TypeInvalid) |
| v1.AuxInt = 4 |
| v1.AddArg(dst) |
| v1.AddArg(real) |
| v1.AddArg(mem) |
| v1.Type = TypeMem |
| v.AddArg(v1) |
| return true |
| } |
| goto endced898cb0a165662afe48ea44ad3318a |
| endced898cb0a165662afe48ea44ad3318a: |
| ; |
| // match: (Store [16] dst (ComplexMake real imag) mem) |
| // cond: |
| // result: (Store [8] (OffPtr <config.fe.TypeFloat64().PtrTo()> [8] dst) imag (Store [8] dst real mem)) |
| { |
| if v.AuxInt != 16 { |
| goto end3851a482d7bd37a93c4d81581e85b3ab |
| } |
| dst := v.Args[0] |
| if v.Args[1].Op != OpComplexMake { |
| goto end3851a482d7bd37a93c4d81581e85b3ab |
| } |
| real := v.Args[1].Args[0] |
| imag := v.Args[1].Args[1] |
| mem := v.Args[2] |
| v.Op = OpStore |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 8 |
| v0 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v0.Type = config.fe.TypeFloat64().PtrTo() |
| v0.AuxInt = 8 |
| v0.AddArg(dst) |
| v.AddArg(v0) |
| v.AddArg(imag) |
| v1 := b.NewValue0(v.Line, OpStore, TypeInvalid) |
| v1.AuxInt = 8 |
| v1.AddArg(dst) |
| v1.AddArg(real) |
| v1.AddArg(mem) |
| v1.Type = TypeMem |
| v.AddArg(v1) |
| return true |
| } |
| goto end3851a482d7bd37a93c4d81581e85b3ab |
| end3851a482d7bd37a93c4d81581e85b3ab: |
| ; |
| // match: (Store [2*config.PtrSize] dst (StringMake ptr len) mem) |
| // cond: |
| // result: (Store [config.PtrSize] (OffPtr <config.fe.TypeInt().PtrTo()> [config.PtrSize] dst) len (Store [config.PtrSize] dst ptr mem)) |
| { |
| if v.AuxInt != 2*config.PtrSize { |
| goto endd3a6ecebdad5899570a79fe5c62f34f1 |
| } |
| dst := v.Args[0] |
| if v.Args[1].Op != OpStringMake { |
| goto endd3a6ecebdad5899570a79fe5c62f34f1 |
| } |
| ptr := v.Args[1].Args[0] |
| len := v.Args[1].Args[1] |
| mem := v.Args[2] |
| v.Op = OpStore |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = config.PtrSize |
| v0 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v0.Type = config.fe.TypeInt().PtrTo() |
| v0.AuxInt = config.PtrSize |
| v0.AddArg(dst) |
| v.AddArg(v0) |
| v.AddArg(len) |
| v1 := b.NewValue0(v.Line, OpStore, TypeInvalid) |
| v1.AuxInt = config.PtrSize |
| v1.AddArg(dst) |
| v1.AddArg(ptr) |
| v1.AddArg(mem) |
| v1.Type = TypeMem |
| v.AddArg(v1) |
| return true |
| } |
| goto endd3a6ecebdad5899570a79fe5c62f34f1 |
| endd3a6ecebdad5899570a79fe5c62f34f1: |
| ; |
| // match: (Store [3*config.PtrSize] dst (SliceMake ptr len cap) mem) |
| // cond: |
| // result: (Store [config.PtrSize] (OffPtr <config.fe.TypeInt().PtrTo()> [2*config.PtrSize] dst) cap (Store [config.PtrSize] (OffPtr <config.fe.TypeInt().PtrTo()> [config.PtrSize] dst) len (Store [config.PtrSize] dst ptr mem))) |
| { |
| if v.AuxInt != 3*config.PtrSize { |
| goto endd5cc8c3dad7d24c845b0b88fc51487ae |
| } |
| dst := v.Args[0] |
| if v.Args[1].Op != OpSliceMake { |
| goto endd5cc8c3dad7d24c845b0b88fc51487ae |
| } |
| ptr := v.Args[1].Args[0] |
| len := v.Args[1].Args[1] |
| cap := v.Args[1].Args[2] |
| mem := v.Args[2] |
| v.Op = OpStore |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = config.PtrSize |
| v0 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v0.Type = config.fe.TypeInt().PtrTo() |
| v0.AuxInt = 2 * config.PtrSize |
| v0.AddArg(dst) |
| v.AddArg(v0) |
| v.AddArg(cap) |
| v1 := b.NewValue0(v.Line, OpStore, TypeInvalid) |
| v1.AuxInt = config.PtrSize |
| v2 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v2.Type = config.fe.TypeInt().PtrTo() |
| v2.AuxInt = config.PtrSize |
| v2.AddArg(dst) |
| v1.AddArg(v2) |
| v1.AddArg(len) |
| v3 := b.NewValue0(v.Line, OpStore, TypeInvalid) |
| v3.AuxInt = config.PtrSize |
| v3.AddArg(dst) |
| v3.AddArg(ptr) |
| v3.AddArg(mem) |
| v3.Type = TypeMem |
| v1.AddArg(v3) |
| v1.Type = TypeMem |
| v.AddArg(v1) |
| return true |
| } |
| goto endd5cc8c3dad7d24c845b0b88fc51487ae |
| endd5cc8c3dad7d24c845b0b88fc51487ae: |
| ; |
| // match: (Store [2*config.PtrSize] dst (IMake itab data) mem) |
| // cond: |
| // result: (Store [config.PtrSize] (OffPtr <config.fe.TypeBytePtr().PtrTo()> [config.PtrSize] dst) data (Store [config.PtrSize] dst itab mem)) |
| { |
| if v.AuxInt != 2*config.PtrSize { |
| goto endaa801a871178ae3256b3f6f5d9f13514 |
| } |
| dst := v.Args[0] |
| if v.Args[1].Op != OpIMake { |
| goto endaa801a871178ae3256b3f6f5d9f13514 |
| } |
| itab := v.Args[1].Args[0] |
| data := v.Args[1].Args[1] |
| mem := v.Args[2] |
| v.Op = OpStore |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = config.PtrSize |
| v0 := b.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v0.Type = config.fe.TypeBytePtr().PtrTo() |
| v0.AuxInt = config.PtrSize |
| v0.AddArg(dst) |
| v.AddArg(v0) |
| v.AddArg(data) |
| v1 := b.NewValue0(v.Line, OpStore, TypeInvalid) |
| v1.AuxInt = config.PtrSize |
| v1.AddArg(dst) |
| v1.AddArg(itab) |
| v1.AddArg(mem) |
| v1.Type = TypeMem |
| v.AddArg(v1) |
| return true |
| } |
| goto endaa801a871178ae3256b3f6f5d9f13514 |
| endaa801a871178ae3256b3f6f5d9f13514: |
| ; |
| // match: (Store [size] dst (Load <t> src mem) mem) |
| // cond: !config.fe.CanSSA(t) |
| // result: (Move [size] dst src mem) |
| { |
| size := v.AuxInt |
| dst := v.Args[0] |
| if v.Args[1].Op != OpLoad { |
| goto end45295326269ba18413dceb7b608a0b9d |
| } |
| t := v.Args[1].Type |
| src := v.Args[1].Args[0] |
| mem := v.Args[1].Args[1] |
| if v.Args[2] != mem { |
| goto end45295326269ba18413dceb7b608a0b9d |
| } |
| if !(!config.fe.CanSSA(t)) { |
| goto end45295326269ba18413dceb7b608a0b9d |
| } |
| v.Op = OpMove |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = size |
| v.AddArg(dst) |
| v.AddArg(src) |
| v.AddArg(mem) |
| return true |
| } |
| goto end45295326269ba18413dceb7b608a0b9d |
| end45295326269ba18413dceb7b608a0b9d: |
| ; |
| // match: (Store [size] dst (Load <t> src mem) (VarDef {x} mem)) |
| // cond: !config.fe.CanSSA(t) |
| // result: (Move [size] dst src (VarDef {x} mem)) |
| { |
| size := v.AuxInt |
| dst := v.Args[0] |
| if v.Args[1].Op != OpLoad { |
| goto end7f3cc0baffb82ba3ee879599b189a512 |
| } |
| t := v.Args[1].Type |
| src := v.Args[1].Args[0] |
| mem := v.Args[1].Args[1] |
| if v.Args[2].Op != OpVarDef { |
| goto end7f3cc0baffb82ba3ee879599b189a512 |
| } |
| x := v.Args[2].Aux |
| if v.Args[2].Args[0] != mem { |
| goto end7f3cc0baffb82ba3ee879599b189a512 |
| } |
| if !(!config.fe.CanSSA(t)) { |
| goto end7f3cc0baffb82ba3ee879599b189a512 |
| } |
| v.Op = OpMove |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = size |
| v.AddArg(dst) |
| v.AddArg(src) |
| v0 := b.NewValue0(v.Line, OpVarDef, TypeInvalid) |
| v0.Aux = x |
| v0.AddArg(mem) |
| v0.Type = TypeMem |
| v.AddArg(v0) |
| return true |
| } |
| goto end7f3cc0baffb82ba3ee879599b189a512 |
| end7f3cc0baffb82ba3ee879599b189a512: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpStringLen(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (StringLen (StringMake _ len)) |
| // cond: |
| // result: len |
| { |
| if v.Args[0].Op != OpStringMake { |
| goto end0d922460b7e5ca88324034f4bd6c027c |
| } |
| len := v.Args[0].Args[1] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = len.Type |
| v.AddArg(len) |
| return true |
| } |
| goto end0d922460b7e5ca88324034f4bd6c027c |
| end0d922460b7e5ca88324034f4bd6c027c: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpStringPtr(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (StringPtr (StringMake ptr _)) |
| // cond: |
| // result: ptr |
| { |
| if v.Args[0].Op != OpStringMake { |
| goto end061edc5d85c73ad909089af2556d9380 |
| } |
| ptr := v.Args[0].Args[0] |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.Type = ptr.Type |
| v.AddArg(ptr) |
| return true |
| } |
| goto end061edc5d85c73ad909089af2556d9380 |
| end061edc5d85c73ad909089af2556d9380: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpStructSelect(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (StructSelect [idx] (Load ptr mem)) |
| // cond: |
| // result: @v.Args[0].Block (Load <v.Type> (OffPtr <v.Type.PtrTo()> [idx] ptr) mem) |
| { |
| idx := v.AuxInt |
| if v.Args[0].Op != OpLoad { |
| goto end27abc5bf0299ce1bd5457af6ce8e3fba |
| } |
| ptr := v.Args[0].Args[0] |
| mem := v.Args[0].Args[1] |
| v0 := v.Args[0].Block.NewValue0(v.Line, OpLoad, TypeInvalid) |
| v.Op = OpCopy |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AddArg(v0) |
| v0.Type = v.Type |
| v1 := v.Args[0].Block.NewValue0(v.Line, OpOffPtr, TypeInvalid) |
| v1.Type = v.Type.PtrTo() |
| v1.AuxInt = idx |
| v1.AddArg(ptr) |
| v0.AddArg(v1) |
| v0.AddArg(mem) |
| return true |
| } |
| goto end27abc5bf0299ce1bd5457af6ce8e3fba |
| end27abc5bf0299ce1bd5457af6ce8e3fba: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpSub16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Sub16 (Const16 [c]) (Const16 [d])) |
| // cond: |
| // result: (Const16 [c-d]) |
| { |
| if v.Args[0].Op != OpConst16 { |
| goto end5c6fab95c9dbeff5973119096bfd4e78 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst16 { |
| goto end5c6fab95c9dbeff5973119096bfd4e78 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst16 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c - d |
| return true |
| } |
| goto end5c6fab95c9dbeff5973119096bfd4e78 |
| end5c6fab95c9dbeff5973119096bfd4e78: |
| ; |
| // match: (Sub16 x x) |
| // cond: |
| // result: (Const16 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end83da541391be564f2a08464e674a49e7 |
| } |
| v.Op = OpConst16 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end83da541391be564f2a08464e674a49e7 |
| end83da541391be564f2a08464e674a49e7: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpSub32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Sub32 (Const32 [c]) (Const32 [d])) |
| // cond: |
| // result: (Const32 [c-d]) |
| { |
| if v.Args[0].Op != OpConst32 { |
| goto end7623799db780e1bcc42c6ea0df9c49d3 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst32 { |
| goto end7623799db780e1bcc42c6ea0df9c49d3 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst32 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c - d |
| return true |
| } |
| goto end7623799db780e1bcc42c6ea0df9c49d3 |
| end7623799db780e1bcc42c6ea0df9c49d3: |
| ; |
| // match: (Sub32 x x) |
| // cond: |
| // result: (Const32 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto enda747581e798f199e07f4ad69747cd069 |
| } |
| v.Op = OpConst32 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto enda747581e798f199e07f4ad69747cd069 |
| enda747581e798f199e07f4ad69747cd069: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpSub64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Sub64 (Const64 [c]) (Const64 [d])) |
| // cond: |
| // result: (Const64 [c-d]) |
| { |
| if v.Args[0].Op != OpConst64 { |
| goto end5a84a285ff0ff48b8ad3c64b15e3459f |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst64 { |
| goto end5a84a285ff0ff48b8ad3c64b15e3459f |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst64 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c - d |
| return true |
| } |
| goto end5a84a285ff0ff48b8ad3c64b15e3459f |
| end5a84a285ff0ff48b8ad3c64b15e3459f: |
| ; |
| // match: (Sub64 x x) |
| // cond: |
| // result: (Const64 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end0387dc2b7bbe57d4aa54eab5d959da4b |
| } |
| v.Op = OpConst64 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end0387dc2b7bbe57d4aa54eab5d959da4b |
| end0387dc2b7bbe57d4aa54eab5d959da4b: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpSub8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Sub8 (Const8 [c]) (Const8 [d])) |
| // cond: |
| // result: (Const8 [c-d]) |
| { |
| if v.Args[0].Op != OpConst8 { |
| goto endc00ea11c7535529e211710574f5cff24 |
| } |
| c := v.Args[0].AuxInt |
| if v.Args[1].Op != OpConst8 { |
| goto endc00ea11c7535529e211710574f5cff24 |
| } |
| d := v.Args[1].AuxInt |
| v.Op = OpConst8 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = c - d |
| return true |
| } |
| goto endc00ea11c7535529e211710574f5cff24 |
| endc00ea11c7535529e211710574f5cff24: |
| ; |
| // match: (Sub8 x x) |
| // cond: |
| // result: (Const8 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end4e2ee15ef17611919a1a6b5f80bbfe18 |
| } |
| v.Op = OpConst8 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end4e2ee15ef17611919a1a6b5f80bbfe18 |
| end4e2ee15ef17611919a1a6b5f80bbfe18: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpXor16(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Xor16 x x) |
| // cond: |
| // result: (Const16 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end5733ceb1903b8140248d8e2cac02fefe |
| } |
| v.Op = OpConst16 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end5733ceb1903b8140248d8e2cac02fefe |
| end5733ceb1903b8140248d8e2cac02fefe: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpXor32(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Xor32 x x) |
| // cond: |
| // result: (Const32 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end268ca02df6515d648e0bfb4e90981d25 |
| } |
| v.Op = OpConst32 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end268ca02df6515d648e0bfb4e90981d25 |
| end268ca02df6515d648e0bfb4e90981d25: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpXor64(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Xor64 x x) |
| // cond: |
| // result: (Const64 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto endaf44e7f9fc58af30df69070953fb45ce |
| } |
| v.Op = OpConst64 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto endaf44e7f9fc58af30df69070953fb45ce |
| endaf44e7f9fc58af30df69070953fb45ce: |
| ; |
| return false |
| } |
| func rewriteValuegeneric_OpXor8(v *Value, config *Config) bool { |
| b := v.Block |
| _ = b |
| // match: (Xor8 x x) |
| // cond: |
| // result: (Const8 [0]) |
| { |
| x := v.Args[0] |
| if v.Args[1] != x { |
| goto end949b3a60b7d181688e6f79f93c782fc8 |
| } |
| v.Op = OpConst8 |
| v.AuxInt = 0 |
| v.Aux = nil |
| v.resetArgs() |
| v.AuxInt = 0 |
| return true |
| } |
| goto end949b3a60b7d181688e6f79f93c782fc8 |
| end949b3a60b7d181688e6f79f93c782fc8: |
| ; |
| return false |
| } |
| func rewriteBlockgeneric(b *Block) bool { |
| switch b.Kind { |
| case BlockCheck: |
| // match: (Check (NilCheck (GetG _) _) next) |
| // cond: |
| // result: (Plain nil next) |
| { |
| v := b.Control |
| if v.Op != OpNilCheck { |
| goto end6e20d932d6961903b0dcf16eac513826 |
| } |
| if v.Args[0].Op != OpGetG { |
| goto end6e20d932d6961903b0dcf16eac513826 |
| } |
| next := b.Succs[0] |
| b.Kind = BlockPlain |
| b.Control = nil |
| b.Succs[0] = next |
| b.Likely = BranchUnknown |
| return true |
| } |
| goto end6e20d932d6961903b0dcf16eac513826 |
| end6e20d932d6961903b0dcf16eac513826: |
| ; |
| case BlockIf: |
| // match: (If (Not cond) yes no) |
| // cond: |
| // result: (If cond no yes) |
| { |
| v := b.Control |
| if v.Op != OpNot { |
| goto endebe19c1c3c3bec068cdb2dd29ef57f96 |
| } |
| cond := v.Args[0] |
| yes := b.Succs[0] |
| no := b.Succs[1] |
| b.Kind = BlockIf |
| b.Control = cond |
| b.Succs[0] = no |
| b.Succs[1] = yes |
| b.Likely *= -1 |
| return true |
| } |
| goto endebe19c1c3c3bec068cdb2dd29ef57f96 |
| endebe19c1c3c3bec068cdb2dd29ef57f96: |
| ; |
| // match: (If (ConstBool [c]) yes no) |
| // cond: c == 1 |
| // result: (First nil yes no) |
| { |
| v := b.Control |
| if v.Op != OpConstBool { |
| goto endc58ecbb85af78c0d58bb232ca86b67a4 |
| } |
| c := v.AuxInt |
| yes := b.Succs[0] |
| no := b.Succs[1] |
| if !(c == 1) { |
| goto endc58ecbb85af78c0d58bb232ca86b67a4 |
| } |
| b.Kind = BlockFirst |
| b.Control = nil |
| b.Succs[0] = yes |
| b.Succs[1] = no |
| return true |
| } |
| goto endc58ecbb85af78c0d58bb232ca86b67a4 |
| endc58ecbb85af78c0d58bb232ca86b67a4: |
| ; |
| // match: (If (ConstBool [c]) yes no) |
| // cond: c == 0 |
| // result: (First nil no yes) |
| { |
| v := b.Control |
| if v.Op != OpConstBool { |
| goto end4c3e297e275dd7e2e67f8ccd348c4bb5 |
| } |
| c := v.AuxInt |
| yes := b.Succs[0] |
| no := b.Succs[1] |
| if !(c == 0) { |
| goto end4c3e297e275dd7e2e67f8ccd348c4bb5 |
| } |
| b.Kind = BlockFirst |
| b.Control = nil |
| b.Succs[0] = no |
| b.Succs[1] = yes |
| b.Likely *= -1 |
| return true |
| } |
| goto end4c3e297e275dd7e2e67f8ccd348c4bb5 |
| end4c3e297e275dd7e2e67f8ccd348c4bb5: |
| } |
| return false |
| } |