Deleted Added
sdiff udiff text old ( 5305:8b379ad9406d ) new ( 5306:79cedb731af5 )
full compact
1# Copyright (c) 2007 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use of this software in source and binary forms,
5# with or without modification, are permitted provided that the
6# following conditions are met:
7#
8# The software must be used only for Non-Commercial Use which means any

--- 45 unchanged lines hidden (view full) ---

54# Authors: Gabe Black
55
56microcode = '''
57def macroop BT_R_I {
58 sexti t0, reg, imm, flags=(CF,)
59};
60
61def macroop BT_M_I {
62 limm t1, imm
63 # This fudges just a tiny bit, but it's reasonable to expect the
64 # microcode generation logic to have the log of the various sizes
65 # floating around as well.
66 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
67 add t2, t2, base
68 ld t1, seg, [scale, index, t2], disp
69 sexti t0, t1, imm, flags=(CF,)
70};
71
72def macroop BT_P_I {
73 rdip t7
74 limm t1, imm
75 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
76 ld t1, seg, [1, t2, t7]
77 sexti t0, t1, imm, flags=(CF,)
78};
79
80def macroop BT_R_R {
81 sext t0, reg, regm, flags=(CF,)
82};
83
84def macroop BT_M_R {
85 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
86 add t2, t2, base
87 ld t1, seg, [scale, index, t2], disp
88 sext t0, t1, reg, flags=(CF,)
89};
90
91def macroop BT_P_R {
92 rdip t7
93 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
94 ld t1, seg, [1, t2, t7]
95 sext t0, t1, reg, flags=(CF,)
96};
97
98def macroop BTC_R_I {
99 sexti t0, reg, imm, flags=(CF,)
100 limm t1, 1
101 roli t1, t1, imm
102 xor reg, reg, t1
103};
104
105def macroop BTC_M_I {
106 limm t1, imm
107 # This fudges just a tiny bit, but it's reasonable to expect the
108 # microcode generation logic to have the log of the various sizes
109 # floating around as well.
110 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
111 add t2, t2, base
112 limm t3, 1
113 roli t3, t3, imm
114 ldst t1, seg, [scale, index, t2], disp
115 sexti t0, t1, imm, flags=(CF,)
116 xor t1, t1, t3
117 st t1, seg, [scale, index, t2], disp
118};
119
120def macroop BTC_P_I {
121 rdip t7
122 limm t1, imm
123 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
124 limm t3, 1
125 roli t3, t3, imm
126 ldst t1, seg, [1, t2, t7]
127 sexti t0, t1, imm, flags=(CF,)
128 xor t1, t1, t3
129 st t1, seg, [1, t2, t7], disp
130};
131
132def macroop BTC_R_R {
133 sext t0, reg, regm, flags=(CF,)
134 limm t1, 1
135 rol t1, t1, regm
136 xor reg, reg, t1
137};
138
139def macroop BTC_M_R {
140 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
141 add t2, t2, base
142 limm t3, 1
143 rol t3, t3, reg
144 ldst t1, seg, [scale, index, t2], disp
145 sext t0, t1, reg, flags=(CF,)
146 xor t1, t1, t3
147 st t1, seg, [scale, index, t2], disp
148};
149
150def macroop BTC_P_R {
151 rdip t7
152 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
153 limm t3, 1
154 rol t3, t3, reg
155 ldst t1, seg, [1, t2, t7]
156 sext t0, t1, reg, flags=(CF,)
157 xor t1, t1, t3
158 st t1, seg, [1, t2, t7], disp
159};
160
161def macroop BTR_R_I {
162 sexti t0, reg, imm, flags=(CF,)
163 limm t1, "(uint64_t(-(2ULL)))"
164 roli t1, t1, imm
165 and reg, reg, t1
166};
167
168def macroop BTR_M_I {
169 limm t1, imm
170 # This fudges just a tiny bit, but it's reasonable to expect the
171 # microcode generation logic to have the log of the various sizes
172 # floating around as well.
173 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
174 add t2, t2, base
175 limm t3, "(uint64_t(-(2ULL)))"
176 roli t3, t3, imm
177 ldst t1, seg, [scale, index, t2], disp
178 sexti t0, t1, imm, flags=(CF,)
179 and t1, t1, t3
180 st t1, seg, [scale, index, t2], disp
181};
182
183def macroop BTR_P_I {
184 rdip t7
185 limm t1, imm
186 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
187 limm t3, "(uint64_t(-(2ULL)))"
188 roli t3, t3, imm
189 ldst t1, seg, [1, t2, t7]
190 sexti t0, t1, imm, flags=(CF,)
191 and t1, t1, t3
192 st t1, seg, [1, t2, t7], disp
193};
194
195def macroop BTR_R_R {
196 sext t0, reg, regm, flags=(CF,)
197 limm t1, "(uint64_t(-(2ULL)))"
198 rol t1, t1, regm
199 and reg, reg, t1
200};
201
202def macroop BTR_M_R {
203 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
204 add t2, t2, base
205 limm t3, "(uint64_t(-(2ULL)))"
206 rol t3, t3, reg
207 ldst t1, seg, [scale, index, t2], disp
208 sext t0, t1, reg, flags=(CF,)
209 and t1, t1, t3
210 st t1, seg, [scale, index, t2], disp
211};
212
213def macroop BTR_P_R {
214 rdip t7
215 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
216 limm t3, "(uint64_t(-(2ULL)))"
217 rol t3, t3, reg
218 ldst t1, seg, [1, t2, t7]
219 sext t0, t1, reg, flags=(CF,)
220 and t1, t1, t3
221 st t1, seg, [1, t2, t7], disp
222};
223
224def macroop BTS_R_I {
225 sexti t0, reg, imm, flags=(CF,)
226 limm t1, 1
227 roli t1, t1, imm
228 or reg, reg, t1
229};
230
231def macroop BTS_M_I {
232 limm t1, imm
233 # This fudges just a tiny bit, but it's reasonable to expect the
234 # microcode generation logic to have the log of the various sizes
235 # floating around as well.
236 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
237 add t2, t2, base
238 limm t3, 1
239 roli t3, t3, imm
240 ldst t1, seg, [scale, index, t2], disp
241 sexti t0, t1, imm, flags=(CF,)
242 or t1, t1, t3
243 st t1, seg, [scale, index, t2], disp
244};
245
246def macroop BTS_P_I {
247 rdip t7
248 limm t1, imm
249 srai t2, t1, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
250 limm t3, 1
251 roli t3, t3, imm
252 ldst t1, seg, [1, t2, t7]
253 sexti t0, t1, imm, flags=(CF,)
254 or t1, t1, t3
255 st t1, seg, [1, t2, t7], disp
256};
257
258def macroop BTS_R_R {
259 sext t0, reg, regm, flags=(CF,)
260 limm t1, 1
261 rol t1, t1, regm
262 or reg, reg, t1
263};
264
265def macroop BTS_M_R {
266 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
267 add t2, t2, base
268 limm t3, 1
269 rol t3, t3, reg
270 ldst t1, seg, [scale, index, t2], disp
271 sext t0, t1, reg, flags=(CF,)
272 or t1, t1, t3
273 st t1, seg, [scale, index, t2], disp
274};
275
276def macroop BTS_P_R {
277 rdip t7
278 srai t2, reg, "(env.dataSize == 8) ? 3 : ((env.dataSize == 4) ? 2 : 1)"
279 limm t3, 1
280 rol t3, t3, reg
281 ldst t1, seg, [1, t2, t7]
282 sext t0, t1, reg, flags=(CF,)
283 or t1, t1, t3
284 st t1, seg, [1, t2, t7], disp
285};
286'''