diff options
author | gdkchan <gab.dark.100@gmail.com> | 2020-07-30 11:29:28 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 11:29:28 -0300 |
commit | 9878fc2d3cf4c64f56c44c2a5de013acb6bcbade (patch) | |
tree | 8f5e5cde68fec213ab61dbee0e121448f0970ca2 /ARMeilleure/CodeGen/X86/Assembler.cs | |
parent | 57bb0abda3dc277dc7575250fdb080edb83abcbc (diff) |
Implement inline memory load/store exclusive and ordered (#1413)
* Implement inline memory load/store exclusive
* Fix missing REX prefix on 8-bits CMPXCHG
* Increment PTC version due to bugfix
* Remove redundant memory checks
* Address PR feedback
* Increment PPTC version
Diffstat (limited to 'ARMeilleure/CodeGen/X86/Assembler.cs')
-rw-r--r-- | ARMeilleure/CodeGen/X86/Assembler.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ARMeilleure/CodeGen/X86/Assembler.cs b/ARMeilleure/CodeGen/X86/Assembler.cs index d0ccd6f8..b855f1b1 100644 --- a/ARMeilleure/CodeGen/X86/Assembler.cs +++ b/ARMeilleure/CodeGen/X86/Assembler.cs @@ -101,6 +101,7 @@ namespace ARMeilleure.CodeGen.X86 Add(X86Instruction.Cmpss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fc2, InstructionFlags.Vex | InstructionFlags.PrefixF3)); Add(X86Instruction.Cmpxchg, new InstructionInfo(0x00000fb1, BadOp, BadOp, BadOp, BadOp, InstructionFlags.None)); Add(X86Instruction.Cmpxchg16b, new InstructionInfo(0x01000fc7, BadOp, BadOp, BadOp, BadOp, InstructionFlags.RexW)); + Add(X86Instruction.Cmpxchg8, new InstructionInfo(0x00000fb0, BadOp, BadOp, BadOp, BadOp, InstructionFlags.Reg8Src)); Add(X86Instruction.Comisd, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2f, InstructionFlags.Vex | InstructionFlags.Prefix66)); Add(X86Instruction.Comiss, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000f2f, InstructionFlags.Vex)); Add(X86Instruction.Cpuid, new InstructionInfo(BadOp, BadOp, BadOp, BadOp, 0x00000fa2, InstructionFlags.RegOnly)); @@ -353,6 +354,14 @@ namespace ARMeilleure.CodeGen.X86 WriteInstruction(memOp, src, src.Type, X86Instruction.Cmpxchg); } + public void Cmpxchg16(MemoryOperand memOp, Operand src) + { + WriteByte(LockPrefix); + WriteByte(0x66); + + WriteInstruction(memOp, src, src.Type, X86Instruction.Cmpxchg); + } + public void Cmpxchg16b(MemoryOperand memOp) { WriteByte(LockPrefix); @@ -360,6 +369,13 @@ namespace ARMeilleure.CodeGen.X86 WriteInstruction(memOp, null, OperandType.None, X86Instruction.Cmpxchg16b); } + public void Cmpxchg8(MemoryOperand memOp, Operand src) + { + WriteByte(LockPrefix); + + WriteInstruction(memOp, src, src.Type, X86Instruction.Cmpxchg8); + } + public void Comisd(Operand src1, Operand src2) { WriteInstruction(src1, null, src2, X86Instruction.Comisd); |