1// Code generated from gen/386splitload.rules; DO NOT EDIT.
2// generated with: cd gen; go run *.go
3
4package ssa
5
6func rewriteValue386splitload(v *Value) bool {
7	switch v.Op {
8	case Op386CMPBconstload:
9		return rewriteValue386splitload_Op386CMPBconstload(v)
10	case Op386CMPBload:
11		return rewriteValue386splitload_Op386CMPBload(v)
12	case Op386CMPLconstload:
13		return rewriteValue386splitload_Op386CMPLconstload(v)
14	case Op386CMPLload:
15		return rewriteValue386splitload_Op386CMPLload(v)
16	case Op386CMPWconstload:
17		return rewriteValue386splitload_Op386CMPWconstload(v)
18	case Op386CMPWload:
19		return rewriteValue386splitload_Op386CMPWload(v)
20	}
21	return false
22}
23func rewriteValue386splitload_Op386CMPBconstload(v *Value) bool {
24	v_1 := v.Args[1]
25	v_0 := v.Args[0]
26	b := v.Block
27	typ := &b.Func.Config.Types
28	// match: (CMPBconstload {sym} [vo] ptr mem)
29	// result: (CMPBconst (MOVBload {sym} [vo.Off()] ptr mem) [vo.Val8()])
30	for {
31		vo := auxIntToValAndOff(v.AuxInt)
32		sym := auxToSym(v.Aux)
33		ptr := v_0
34		mem := v_1
35		v.reset(Op386CMPBconst)
36		v.AuxInt = int8ToAuxInt(vo.Val8())
37		v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
38		v0.AuxInt = int32ToAuxInt(vo.Off())
39		v0.Aux = symToAux(sym)
40		v0.AddArg2(ptr, mem)
41		v.AddArg(v0)
42		return true
43	}
44}
45func rewriteValue386splitload_Op386CMPBload(v *Value) bool {
46	v_2 := v.Args[2]
47	v_1 := v.Args[1]
48	v_0 := v.Args[0]
49	b := v.Block
50	typ := &b.Func.Config.Types
51	// match: (CMPBload {sym} [off] ptr x mem)
52	// result: (CMPB (MOVBload {sym} [off] ptr mem) x)
53	for {
54		off := auxIntToInt32(v.AuxInt)
55		sym := auxToSym(v.Aux)
56		ptr := v_0
57		x := v_1
58		mem := v_2
59		v.reset(Op386CMPB)
60		v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
61		v0.AuxInt = int32ToAuxInt(off)
62		v0.Aux = symToAux(sym)
63		v0.AddArg2(ptr, mem)
64		v.AddArg2(v0, x)
65		return true
66	}
67}
68func rewriteValue386splitload_Op386CMPLconstload(v *Value) bool {
69	v_1 := v.Args[1]
70	v_0 := v.Args[0]
71	b := v.Block
72	typ := &b.Func.Config.Types
73	// match: (CMPLconstload {sym} [vo] ptr mem)
74	// result: (CMPLconst (MOVLload {sym} [vo.Off()] ptr mem) [vo.Val()])
75	for {
76		vo := auxIntToValAndOff(v.AuxInt)
77		sym := auxToSym(v.Aux)
78		ptr := v_0
79		mem := v_1
80		v.reset(Op386CMPLconst)
81		v.AuxInt = int32ToAuxInt(vo.Val())
82		v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
83		v0.AuxInt = int32ToAuxInt(vo.Off())
84		v0.Aux = symToAux(sym)
85		v0.AddArg2(ptr, mem)
86		v.AddArg(v0)
87		return true
88	}
89}
90func rewriteValue386splitload_Op386CMPLload(v *Value) bool {
91	v_2 := v.Args[2]
92	v_1 := v.Args[1]
93	v_0 := v.Args[0]
94	b := v.Block
95	typ := &b.Func.Config.Types
96	// match: (CMPLload {sym} [off] ptr x mem)
97	// result: (CMPL (MOVLload {sym} [off] ptr mem) x)
98	for {
99		off := auxIntToInt32(v.AuxInt)
100		sym := auxToSym(v.Aux)
101		ptr := v_0
102		x := v_1
103		mem := v_2
104		v.reset(Op386CMPL)
105		v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
106		v0.AuxInt = int32ToAuxInt(off)
107		v0.Aux = symToAux(sym)
108		v0.AddArg2(ptr, mem)
109		v.AddArg2(v0, x)
110		return true
111	}
112}
113func rewriteValue386splitload_Op386CMPWconstload(v *Value) bool {
114	v_1 := v.Args[1]
115	v_0 := v.Args[0]
116	b := v.Block
117	typ := &b.Func.Config.Types
118	// match: (CMPWconstload {sym} [vo] ptr mem)
119	// result: (CMPWconst (MOVWload {sym} [vo.Off()] ptr mem) [vo.Val16()])
120	for {
121		vo := auxIntToValAndOff(v.AuxInt)
122		sym := auxToSym(v.Aux)
123		ptr := v_0
124		mem := v_1
125		v.reset(Op386CMPWconst)
126		v.AuxInt = int16ToAuxInt(vo.Val16())
127		v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
128		v0.AuxInt = int32ToAuxInt(vo.Off())
129		v0.Aux = symToAux(sym)
130		v0.AddArg2(ptr, mem)
131		v.AddArg(v0)
132		return true
133	}
134}
135func rewriteValue386splitload_Op386CMPWload(v *Value) bool {
136	v_2 := v.Args[2]
137	v_1 := v.Args[1]
138	v_0 := v.Args[0]
139	b := v.Block
140	typ := &b.Func.Config.Types
141	// match: (CMPWload {sym} [off] ptr x mem)
142	// result: (CMPW (MOVWload {sym} [off] ptr mem) x)
143	for {
144		off := auxIntToInt32(v.AuxInt)
145		sym := auxToSym(v.Aux)
146		ptr := v_0
147		x := v_1
148		mem := v_2
149		v.reset(Op386CMPW)
150		v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
151		v0.AuxInt = int32ToAuxInt(off)
152		v0.Aux = symToAux(sym)
153		v0.AddArg2(ptr, mem)
154		v.AddArg2(v0, x)
155		return true
156	}
157}
158func rewriteBlock386splitload(b *Block) bool {
159	return false
160}
161