Chromium Code Reviews| Index: src/compiler/x64/code-generator-x64.cc |
| diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc |
| index cd4eeedf10dcec10fc9bc0aa34dda01645ca73e5..1970cded70fdf3fb66d33208f6f4f77b973ed224 100644 |
| --- a/src/compiler/x64/code-generator-x64.cc |
| +++ b/src/compiler/x64/code-generator-x64.cc |
| @@ -2134,24 +2134,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
| } |
| break; |
| } |
| - case kX64Xchgb: { |
| - size_t index = 0; |
| - Operand operand = i.MemoryOperand(&index); |
| - __ xchgb(i.InputRegister(index), operand); |
| - break; |
| - } |
| - case kX64Xchgw: { |
| - size_t index = 0; |
| - Operand operand = i.MemoryOperand(&index); |
| - __ xchgw(i.InputRegister(index), operand); |
| - break; |
| - } |
| - case kX64Xchgl: { |
| - size_t index = 0; |
| - Operand operand = i.MemoryOperand(&index); |
| - __ xchgl(i.InputRegister(index), operand); |
| - break; |
| - } |
| case kX64Int32x4Create: { |
| CpuFeatureScope sse_scope(masm(), SSE4_1); |
| XMMRegister dst = i.OutputSimd128Register(); |
| @@ -2229,6 +2211,36 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
| case kX64StackCheck: |
| __ CompareRoot(rsp, Heap::kStackLimitRootIndex); |
| break; |
| +#define EXCHANGE_OPERANDS \ |
| + size_t index = 0; \ |
| + Register r = i.InputRegister(index++); \ |
| + Operand operand = i.MemoryOperand(&index); |
| + case kAtomicExchangeInt8: { |
| + EXCHANGE_OPERANDS |
| + __ xchgb(r, operand, true); |
|
binji
2017/01/17 21:45:50
just add the appropriate extension instruction her
aseemgarg
2017/01/21 08:40:37
Done.
|
| + break; |
| + } |
| + case kAtomicExchangeUint8: { |
| + EXCHANGE_OPERANDS |
| + __ xchgb(r, operand, false); |
| + break; |
| + } |
| + case kAtomicExchangeInt16: { |
| + EXCHANGE_OPERANDS |
| + __ xchgw(r, operand, true); |
| + break; |
| + } |
| + case kAtomicExchangeUint16: { |
| + EXCHANGE_OPERANDS |
| + __ xchgw(r, operand, false); |
| + break; |
| + } |
| + case kAtomicExchangeWord32: { |
| + EXCHANGE_OPERANDS |
| + __ xchgl(r, operand); |
| + break; |
| + } |
| +#undef EXCHANGE_OPERANDS |
| case kAtomicLoadInt8: |
| case kAtomicLoadUint8: |
| case kAtomicLoadInt16: |