Commit c7ce19dc authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [Atomics] Make Atomics.exchange a builtin using TF

Port 301c1237

R=binji@chromium.org, aseemgarg@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4614
LOG=N

Review-Url: https://codereview.chromium.org/2733953004
Cr-Commit-Position: refs/heads/master@{#43680}
parent b643bb77
......@@ -291,7 +291,8 @@ void Builtins::Generate_AtomicsExchange(compiler::CodeAssemblerState* state) {
Node* value_integer = a.ToInteger(context, value);
#if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \
V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
// Node* index_integer = a.ToInteger(context, index);
a.Return(a.CallRuntime(Runtime::kAtomicsExchange, context, array,
index_integer, value_integer));
......@@ -343,7 +344,8 @@ void Builtins::Generate_AtomicsExchange(compiler::CodeAssemblerState* state) {
// This shouldn't happen, we've already validated the type.
a.Bind(&other);
a.Return(a.SmiConstant(0));
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64
// || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
}
} // namespace internal
......
......@@ -1978,6 +1978,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kAtomicStoreWord32:
ASSEMBLE_ATOMIC_STORE_INTEGER(stw, stwx);
break;
case kAtomicExchangeInt8:
case kAtomicExchangeUint8:
case kAtomicExchangeInt16:
case kAtomicExchangeUint16:
case kAtomicExchangeWord32:
UNREACHABLE();
break;
default:
UNREACHABLE();
break;
......
......@@ -2113,6 +2113,8 @@ void InstructionSelector::VisitAtomicStore(Node* node) {
0, nullptr, input_count, inputs);
}
void InstructionSelector::VisitAtomicExchange(Node* node) { UNIMPLEMENTED(); }
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
......
......@@ -2260,6 +2260,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kAtomicStoreWord32:
__ StoreW(i.InputRegister(0), i.MemoryOperand(NULL, 1));
break;
case kAtomicExchangeInt8:
case kAtomicExchangeUint8:
case kAtomicExchangeInt16:
case kAtomicExchangeUint16:
case kAtomicExchangeWord32:
UNREACHABLE();
break;
default:
UNREACHABLE();
break;
......
......@@ -2517,6 +2517,8 @@ void InstructionSelector::VisitAtomicStore(Node* node) {
inputs);
}
void InstructionSelector::VisitAtomicExchange(Node* node) { UNIMPLEMENTED(); }
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment