1
2
3
4 package ssa
5
6 func 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 }
23 func 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
29
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 }
45 func 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
52
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 }
68 func 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
74
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 }
90 func 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
97
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 }
113 func 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
119
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 }
135 func 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
142
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 }
158 func rewriteBlock386splitload(b *Block) bool {
159 return false
160 }
161
View as plain text