Skip to content

Commit

Permalink
add cmpxchg8b spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bdcht committed Feb 4, 2015
1 parent 47ed1c5 commit 5d92632
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions amoco/arch/x64/spec_ia32e.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,20 @@ def ia32_rdrand(obj,Mod,RM,data):
obj.operands = [op1]
obj.type = type_other

@ispec_ia32("*>[ {0f}{c7} /1 ]", mnemonic = "CMPXCHG8B")
def ia32_cmpxchg(obj,Mod,RM,data):
op2,data = getModRM(obj,Mod,RM,data)
if not op2._is_mem: raise InstructionError(obj)
op2.size = 64
REX = obj.misc['REX']
if REX:
W=REX[0]
if W==1:
obj.mnemonic = "CMXCHG16B"
op2.size = 128
obj.operands = [op2]
obj.type = type_data_processing

@ispec_ia32("*>[ {0f}{1f} /0 ]", mnemonic = "NOP", type=type_cpu_state)
@ispec_ia32("*>[ {0f}{ae} /4 ]", mnemonic = "XSAVE", type=type_cpu_state)
@ispec_ia32("*>[ {0f}{ae} /5 ]", mnemonic = "LFENCE", type=type_cpu_state)
Expand Down
8 changes: 8 additions & 0 deletions amoco/arch/x86/spec_ia32.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,14 @@ def ia32_rdrand(obj,Mod,RM,REG,data):
obj.operands = [op2,op1]
obj.type = type_data_processing

@ispec_ia32("*>[ {0f}{c7} /1 ]", mnemonic = "CMPXCHG8B")
def ia32_cmpxchg(obj,Mod,RM,data):
op2,data = getModRM(obj,Mod,RM,data)
if not op2._is_mem: raise InstructionError(obj)
op2.size = 64
obj.operands = [op2]
obj.type = type_data_processing

@ispec_ia32("*>[ {0f}{1f} /0 ]", mnemonic = "NOP", type=type_cpu_state)
@ispec_ia32("*>[ {0f}{ae} /4 ]", mnemonic = "XSAVE", type=type_cpu_state)
@ispec_ia32("*>[ {0f}{ae} /5 ]", mnemonic = "LFENCE", type=type_cpu_state)
Expand Down

0 comments on commit 5d92632

Please sign in to comment.