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