| Index: src/compiler/ppc/code-generator-ppc.cc
|
| diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
|
| index 2bf4860d4d7030cb8c7627cb8f176fe2e2400e55..51a8950a84dff355bb2a286a30e179fa6189a4c0 100644
|
| --- a/src/compiler/ppc/code-generator-ppc.cc
|
| +++ b/src/compiler/ppc/code-generator-ppc.cc
|
| @@ -672,6 +672,24 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
|
| DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
|
| } while (0)
|
|
|
| +#define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr, asm_instrx) \
|
| + do { \
|
| + Label done; \
|
| + Register result = i.OutputRegister(); \
|
| + AddressingMode mode = kMode_None; \
|
| + MemOperand operand = i.MemoryOperand(&mode); \
|
| + __ sync(); \
|
| + if (mode == kMode_MRI) { \
|
| + __ asm_instr(result, operand); \
|
| + } else { \
|
| + __ asm_instrx(result, operand); \
|
| + } \
|
| + __ bind(&done); \
|
| + __ cmp(result, result); \
|
| + __ bne(&done); \
|
| + __ isync(); \
|
| + } while (0)
|
| +
|
| void CodeGenerator::AssembleDeconstructFrame() {
|
| __ LeaveFrame(StackFrame::MANUAL);
|
| }
|
| @@ -1585,6 +1603,23 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| case kCheckedStoreFloat64:
|
| ASSEMBLE_CHECKED_STORE_DOUBLE();
|
| break;
|
| +
|
| + case kAtomicLoadInt8:
|
| + ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx);
|
| + __ extsb(i.OutputRegister(), i.OutputRegister());
|
| + break;
|
| + case kAtomicLoadUint8:
|
| + ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx);
|
| + break;
|
| + case kAtomicLoadInt16:
|
| + ASSEMBLE_ATOMIC_LOAD_INTEGER(lha, lhax);
|
| + break;
|
| + case kAtomicLoadUint16:
|
| + ASSEMBLE_ATOMIC_LOAD_INTEGER(lhz, lhzx);
|
| + break;
|
| + case kAtomicLoadWord32:
|
| + ASSEMBLE_ATOMIC_LOAD_INTEGER(lwa, lwax);
|
| + break;
|
| default:
|
| UNREACHABLE();
|
| break;
|
|
|