From: Gabe Black Date: Tue, 12 Jun 2007 16:47:10 +0000 (+0000) Subject: Make use of some of the REX prefix. X-Git-Tag: m5_2.0_beta4~359^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d8d3f988f835e58e5e53b6ee2be871e7bff9132;p=gem5.git Make use of some of the REX prefix. --HG-- extra : convert_revision : 948eceb59a1cd9b02ad9355dd5894af0bbec4e83 --- diff --git a/src/arch/x86/isa/specialize.isa b/src/arch/x86/isa/specialize.isa index 3b4e09daa..fe3730b77 100644 --- a/src/arch/x86/isa/specialize.isa +++ b/src/arch/x86/isa/specialize.isa @@ -95,6 +95,9 @@ let {{ self.size = match.group("size") self.rsize = match.group("rsize") + ModRMRegIndex = "(MODRM_REG | (REX_R << 3))" + ModRMRMIndex = "(MODRM_RM | (REX_B << 3))" + # This function specializes the given piece of code to use a particular # set of argument types described by "opTypes". def specializeInst(Name, opTypes, env): @@ -121,14 +124,14 @@ let {{ raise Exception, "Problem parsing operand tag: %s" % opType.tag elif opType.tag in ("C", "D", "G", "P", "S", "T", "V"): # Use the "reg" field of the ModRM byte to select the register - env.addReg("(uint8_t)MODRM_REG") + env.addReg(ModRMRegIndex) elif opType.tag in ("E", "Q", "W"): # This might refer to memory or to a register. We need to # divide it up farther. regTypes = copy.copy(opTypes) regTypes.pop(0) regEnv = copy.copy(env) - regEnv.addReg("(uint8_t)MODRM_RM") + regEnv.addReg(ModRMRMIndex) # This needs to refer to memory, but we'll fill in the details # later. It needs to take into account unaligned memory # addresses. @@ -149,7 +152,7 @@ let {{ elif opType.tag in ("PR", "R", "VR"): # There should probably be a check here to verify that mod # is equal to 11b - env.addReg("(uint8_t)MODRM_RM") + env.addReg(ModRMRMIndex) else: raise Exception, "Unrecognized tag %s." % opType.tag opTypes.pop(0)