move.py (5413:809f33a926c4) move.py (5433:1b0b8e9ba6a9)
1# Copyright (c) 2007-2008 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

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

232 ld t1, seg, riprel, disp, dataSize=2
233 zext t2, t1, 15
234 slli t3, t2, 2, dataSize=8
235 wrsel reg, t1
236 wrbase reg, t3
237};
238
239def macroop MOV_S_R {
1# Copyright (c) 2007-2008 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

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

232 ld t1, seg, riprel, disp, dataSize=2
233 zext t2, t1, 15
234 slli t3, t2, 2, dataSize=8
235 wrsel reg, t1
236 wrbase reg, t3
237};
238
239def macroop MOV_S_R {
240 chks t1, regm, flags=(EZF,), dataSize=8
241 bri t0, label("end"), flags=(CEZF,)
242 ld t2, flatseg, [1, t0, t1], addressSize=8, dataSize=8
243 wrdl reg, t2, regm
244end:
240 andi t0, regm, 0xFC, flags=(EZF,), dataSize=2
241 bri t0, label("processDescriptor"), flags=(CEZF,)
242 andi t2, regm, 0xF8, dataSize=8
243 andi t0, regm, 0x4, flags=(EZF,), dataSize=2
244 bri t0, label("globalDescriptor"), flags=(CEZF,)
245 ld t3, tsl, [1, t0, t2], dataSize=8
246 bri t0, label("processDescriptor")
247globalDescriptor:
248 ld t3, tsg, [1, t0, t2], dataSize=8
249processDescriptor:
250 chks regm, t3, dataSize=8
251 wrdl reg, t3, regm
245 wrsel reg, regm
246};
247
248def macroop MOV_S_M {
249 ld t1, seg, sib, disp, dataSize=2
252 wrsel reg, regm
253};
254
255def macroop MOV_S_M {
256 ld t1, seg, sib, disp, dataSize=2
250 chks t2, t1, flags=(EZF,), dataSize=8
251 bri t0, label("end"), flags=(CEZF,)
252 ld t2, flatseg, [1, t0, t1], addressSize=8, dataSize=8
253 wrdl reg, t2, t1
254end:
257 andi t0, t1, 0xFC, flags=(EZF,), dataSize=2
258 bri t0, label("processDescriptor"), flags=(CEZF,)
259 andi t2, t1, 0xF8, dataSize=8
260 andi t0, t1, 0x4, flags=(EZF,), dataSize=2
261 bri t0, label("globalDescriptor"), flags=(CEZF,)
262 ld t3, tsl, [1, t0, t2], dataSize=8
263 bri t0, label("processDescriptor")
264globalDescriptor:
265 ld t3, tsg, [1, t0, t2], dataSize=8
266processDescriptor:
267 chks t1, t3, dataSize=8
268 wrdl reg, t3, t1
255 wrsel reg, t1
256};
257
258def macroop MOV_S_P {
259 rdip t7
260 ld t1, seg, riprel, disp, dataSize=2
269 wrsel reg, t1
270};
271
272def macroop MOV_S_P {
273 rdip t7
274 ld t1, seg, riprel, disp, dataSize=2
261 chks t2, t1, flags=(EZF,), dataSize=8
262 bri t0, label("end"), flags=(CEZF,)
263 ld t2, flatseg, [1, t0, t1], addressSize=8, dataSize=8
264 wrdl reg, t2, t1
265end:
275 andi t0, t1, 0xFC, flags=(EZF,), dataSize=2
276 bri t0, label("processDescriptor"), flags=(CEZF,)
277 andi t2, t1, 0xF8, dataSize=8
278 andi t0, t1, 0x4, flags=(EZF,), dataSize=2
279 bri t0, label("globalDescriptor"), flags=(CEZF,)
280 ld t3, tsl, [1, t0, t2], dataSize=8
281 bri t0, label("processDescriptor")
282globalDescriptor:
283 ld t3, tsg, [1, t0, t2], dataSize=8
284processDescriptor:
285 chks t1, t3, dataSize=8
286 wrdl reg, t3, t1
266 wrsel reg, t1
267};
268
269def macroop MOVSS_S_R {
287 wrsel reg, t1
288};
289
290def macroop MOVSS_S_R {
270 chks t1, regm, flags=(EZF,), dataSize=8
271 # This actually needs to use the selector as the error code, but it would
272 # be hard to get that information into the instruction at the moment.
273 fault "new GeneralProtection(0)", flags=(CEZF,)
274 ld t2, flatseg, [1, t0, t1], addressSize=8, dataSize=8
275 wrdl reg, t2, regm
291 andi t0, regm, 0xFC, flags=(EZF,), dataSize=2
292 bri t0, label("processDescriptor"), flags=(CEZF,)
293 andi t2, regm, 0xF8, dataSize=8
294 andi t0, regm, 0x4, flags=(EZF,), dataSize=2
295 bri t0, label("globalDescriptor"), flags=(CEZF,)
296 ld t3, tsl, [1, t0, t2], dataSize=8
297 bri t0, label("processDescriptor")
298globalDescriptor:
299 ld t3, tsg, [1, t0, t2], dataSize=8
300processDescriptor:
301 chks regm, t3, SSCheck, dataSize=8
302 wrdl reg, t3, regm
276 wrsel reg, regm
277};
278
279def macroop MOVSS_S_M {
280 ld t1, seg, sib, disp, dataSize=2
303 wrsel reg, regm
304};
305
306def macroop MOVSS_S_M {
307 ld t1, seg, sib, disp, dataSize=2
281 chks t2, t1, flags=(EZF,), dataSize=8
282 # This actually needs to use the selector as the error code, but it would
283 # be hard to get that information into the instruction at the moment.
284 fault "new GeneralProtection(0)", flags=(CEZF,)
285 ld t2, flatseg, [1, t0, t1], addressSize=8, dataSize=8
286 wrdl reg, t2, t1
308 andi t0, t1, 0xFC, flags=(EZF,), dataSize=2
309 bri t0, label("processDescriptor"), flags=(CEZF,)
310 andi t2, t1, 0xF8, dataSize=8
311 andi t0, t1, 0x4, flags=(EZF,), dataSize=2
312 bri t0, label("globalDescriptor"), flags=(CEZF,)
313 ld t3, tsl, [1, t0, t2], dataSize=8
314 bri t0, label("processDescriptor")
315globalDescriptor:
316 ld t3, tsg, [1, t0, t2], dataSize=8
317processDescriptor:
318 chks t1, t3, SSCheck, dataSize=8
319 wrdl reg, t3, t1
287 wrsel reg, t1
288};
289
290def macroop MOVSS_S_P {
291 rdip t7
292 ld t1, seg, riprel, disp, dataSize=2
320 wrsel reg, t1
321};
322
323def macroop MOVSS_S_P {
324 rdip t7
325 ld t1, seg, riprel, disp, dataSize=2
293 chks t2, t1, flags=(EZF,), dataSize=8
294 # This actually needs to use the selector as the error code, but it would
295 # be hard to get that information into the instruction at the moment.
296 fault "new GeneralProtection(0)", flags=(CEZF,)
297 ld t2, flatseg, [1, t0, t1], addressSize=8, dataSize=8
298 wrdl reg, t2, t1
326 andi t0, t1, 0xFC, flags=(EZF,), dataSize=2
327 bri t0, label("processDescriptor"), flags=(CEZF,)
328 andi t2, t1, 0xF8, dataSize=8
329 andi t0, t1, 0x4, flags=(EZF,), dataSize=2
330 bri t0, label("globalDescriptor"), flags=(CEZF,)
331 ld t3, tsl, [1, t0, t2], dataSize=8
332 bri t0, label("processDescriptor")
333globalDescriptor:
334 ld t3, tsg, [1, t0, t2], dataSize=8
335processDescriptor:
336 chks t1, t3, SSCheck, dataSize=8
337 wrdl reg, t3, t1
299 wrsel reg, t1
300};
301'''
302#let {{
303# class MOVD(Inst):
304# "GenFault ${new UnimpInstFault}"
305# class MOVNTI(Inst):
306# "GenFault ${new UnimpInstFault}"
307#}};
338 wrsel reg, t1
339};
340'''
341#let {{
342# class MOVD(Inst):
343# "GenFault ${new UnimpInstFault}"
344# class MOVNTI(Inst):
345# "GenFault ${new UnimpInstFault}"
346#}};