Index: src/x64/assembler-x64.h |
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h |
index 77a1a57889985c52941c46cac7fb4e0ea4951f28..4df1801801458acd7359650f7368a9cb9f128875 100644 |
--- a/src/x64/assembler-x64.h |
+++ b/src/x64/assembler-x64.h |
@@ -421,11 +421,11 @@ class Operand BASE_EMBEDDED { |
friend class Assembler; |
}; |
- |
#define ASSEMBLER_INSTRUCTION_LIST(V) \ |
V(add) \ |
V(and) \ |
V(cmp) \ |
+ V(cmpxchg) \ |
V(dec) \ |
V(idiv) \ |
V(div) \ |
@@ -445,7 +445,6 @@ class Operand BASE_EMBEDDED { |
V(xchg) \ |
V(xor) |
- |
// Shift instructions on operands/registers with kPointerSize, kInt32Size and |
// kInt64Size. |
#define SHIFT_INSTRUCTION_LIST(V) \ |
@@ -788,9 +787,15 @@ class Assembler : public AssemblerBase { |
void decb(Register dst); |
void decb(const Operand& dst); |
+ // Lock prefix. |
+ void lock(); |
+ |
void xchgb(Register reg, const Operand& op); |
void xchgw(Register reg, const Operand& op); |
+ void cmpxchgb(const Operand& dst, Register src); |
+ void cmpxchgw(const Operand& dst, Register src); |
+ |
// Sign-extends rax into rdx:rax. |
void cqo(); |
// Sign-extends eax into edx:eax. |
@@ -2054,6 +2059,11 @@ class Assembler : public AssemblerBase { |
immediate_arithmetic_op(0x7, dst, src, size); |
} |
+ // Compare {al,ax,eax,rax} with src. If equal, set ZF and write dst into |
+ // src. Otherwise clear ZF and write src into {al,ax,eax,rax}. This |
+ // operation is only atomic if prefixed by the lock instruction. |
+ void emit_cmpxchg(const Operand& dst, Register src, int size); |
+ |
void emit_dec(Register dst, int size); |
void emit_dec(const Operand& dst, int size); |