| Index: src/compiler/x64/instruction-selector-x64.cc
|
| diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc
|
| index 4094f46267f1e0fbd722b0396fc14df83df8164d..545ae633635cd08ac8e06441a01b6ebd4154bc86 100644
|
| --- a/src/compiler/x64/instruction-selector-x64.cc
|
| +++ b/src/compiler/x64/instruction-selector-x64.cc
|
| @@ -2362,13 +2362,13 @@ void InstructionSelector::VisitAtomicStore(Node* node) {
|
| ArchOpcode opcode = kArchNop;
|
| switch (rep) {
|
| case MachineRepresentation::kWord8:
|
| - opcode = kX64Xchgb;
|
| + opcode = kAtomicExchangeInt8;
|
| break;
|
| case MachineRepresentation::kWord16:
|
| - opcode = kX64Xchgw;
|
| + opcode = kAtomicExchangeInt16;
|
| break;
|
| case MachineRepresentation::kWord32:
|
| - opcode = kX64Xchgl;
|
| + opcode = kAtomicExchangeWord32;
|
| break;
|
| default:
|
| UNREACHABLE();
|
| @@ -2377,6 +2377,7 @@ void InstructionSelector::VisitAtomicStore(Node* node) {
|
| AddressingMode addressing_mode;
|
| InstructionOperand inputs[4];
|
| size_t input_count = 0;
|
| + inputs[input_count++] = g.UseUniqueRegister(value);
|
| inputs[input_count++] = g.UseUniqueRegister(base);
|
| if (g.CanBeImmediate(index)) {
|
| inputs[input_count++] = g.UseImmediate(index);
|
| @@ -2385,11 +2386,50 @@ void InstructionSelector::VisitAtomicStore(Node* node) {
|
| inputs[input_count++] = g.UseUniqueRegister(index);
|
| addressing_mode = kMode_MR1;
|
| }
|
| - inputs[input_count++] = g.UseUniqueRegister(value);
|
| InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
|
| Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs);
|
| }
|
|
|
| +void InstructionSelector::VisitAtomicExchange(Node* node) {
|
| + X64OperandGenerator g(this);
|
| + Node* base = node->InputAt(0);
|
| + Node* index = node->InputAt(1);
|
| + Node* value = node->InputAt(2);
|
| +
|
| + MachineType type = AtomicExchangeRepresentationOf(node->op());
|
| + ArchOpcode opcode = kArchNop;
|
| + if (type == MachineType::Int8()) {
|
| + opcode = kAtomicExchangeInt8;
|
| + } else if (type == MachineType::Uint8()) {
|
| + opcode = kAtomicExchangeUint8;
|
| + } else if (type == MachineType::Int16()) {
|
| + opcode = kAtomicExchangeInt16;
|
| + } else if (type == MachineType::Uint16()) {
|
| + opcode = kAtomicExchangeUint16;
|
| + } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
|
| + opcode = kAtomicExchangeWord32;
|
| + } else {
|
| + UNREACHABLE();
|
| + return;
|
| + }
|
| + InstructionOperand outputs[1];
|
| + AddressingMode addressing_mode;
|
| + InstructionOperand inputs[4];
|
| + size_t input_count = 0;
|
| + inputs[input_count++] = g.UseUniqueRegister(value);
|
| + inputs[input_count++] = g.UseUniqueRegister(base);
|
| + if (g.CanBeImmediate(index)) {
|
| + inputs[input_count++] = g.UseImmediate(index);
|
| + addressing_mode = kMode_MRI;
|
| + } else {
|
| + inputs[input_count++] = g.UseUniqueRegister(index);
|
| + addressing_mode = kMode_MR1;
|
| + }
|
| + outputs[0] = g.DefineSameAsFirst(node);
|
| + InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
|
| + Emit(code, 1, outputs, input_count, inputs);
|
| +}
|
| +
|
| void InstructionSelector::VisitCreateInt32x4(Node* node) {
|
| X64OperandGenerator g(this);
|
| Emit(kX64Int32x4Create, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
|
|
|