Deleted Added
sdiff udiff text old ( 5788:6d4161a36ca1 ) new ( 6518:1ad4a7774b3c )
full compact
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007 The Hewlett-Packard Development Company
4// All rights reserved.
5//
6// Redistribution and use of this software in source and binary forms,
7// with or without modification, are permitted provided that the
8// following conditions are met:

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

185 env.addToDisassembly(
186 "printSegment(out, %s);\n" % ModRMRegIndex)
187 Name += "_S"
188 elif opType.tag in ("G", "P", "T", "V"):
189 # Use the "reg" field of the ModRM byte to select the register
190 env.addReg(ModRMRegIndex)
191 env.addToDisassembly(
192 "printReg(out, %s, regSize);\n" % ModRMRegIndex)
193 Name += "_R"
194 elif opType.tag in ("E", "Q", "W"):
195 # This might refer to memory or to a register. We need to
196 # divide it up farther.
197 regEnv = copy.copy(env)
198 regEnv.addReg(ModRMRMIndex)
199 regEnv.addToDisassembly(
200 "printReg(out, %s, regSize);\n" % ModRMRMIndex)
201 # This refers to memory. The macroop constructor should set up
202 # modrm addressing.
203 memEnv = copy.copy(env)
204 memEnv.doModRM = True
205 return doSplitDecode("MODRM_MOD",
206 {"3" : (specializeInst, Name + "_R", copy.copy(opTypes), regEnv)},
207 (doRipRelativeDecode, Name, copy.copy(opTypes), memEnv))
208 elif opType.tag in ("I", "J"):
209 # Immediates
210 env.addToDisassembly(
211 "ccprintf(out, \"%#x\", machInst.immediate);\n")
212 Name += "_I"
213 elif opType.tag == "O":
214 # Immediate containing a memory offset
215 Name += "_MI"
216 elif opType.tag in ("PR", "R", "VR"):
217 # Non register modrm settings should cause an error
218 env.addReg(ModRMRMIndex)
219 env.addToDisassembly(
220 "printReg(out, %s, regSize);\n" % ModRMRMIndex)
221 Name += "_R"
222 elif opType.tag in ("X", "Y"):
223 # This type of memory addressing is for string instructions.
224 # They'll use the right index and segment internally.
225 if opType.tag == "X":
226 env.addToDisassembly(
227 '''printMem(out, env.seg,
228 1, X86ISA::ZeroReg, X86ISA::INTREG_RSI, 0,
229 env.addressSize, false);''')

--- 13 unchanged lines hidden ---