[ppc] cleaned up atomic64 ops
Change-Id: Id27bfca6f49d4ec351988a597307558cd75ecf56 Reviewed-on: https://chromium-review.googlesource.com/c/1278499 Reviewed-by: Junliang Yan <jyan@ca.ibm.com> Commit-Queue: Junliang Yan <jyan@ca.ibm.com> Cr-Commit-Position: refs/heads/master@{#56868}
This commit is contained in:
parent
4b2282b316
commit
1d5013f96d
@ -1979,82 +1979,69 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx);
|
||||
__ extsb(i.OutputRegister(), i.OutputRegister());
|
||||
break;
|
||||
case kPPC_Word64AtomicLoadUint8:
|
||||
case kWord32AtomicLoadUint8:
|
||||
case kPPC_AtomicLoadUint8:
|
||||
ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx);
|
||||
break;
|
||||
case kWord32AtomicLoadInt16:
|
||||
ASSEMBLE_ATOMIC_LOAD_INTEGER(lha, lhax);
|
||||
break;
|
||||
case kPPC_Word64AtomicLoadUint16:
|
||||
case kWord32AtomicLoadUint16:
|
||||
case kPPC_AtomicLoadUint16:
|
||||
ASSEMBLE_ATOMIC_LOAD_INTEGER(lhz, lhzx);
|
||||
break;
|
||||
case kPPC_Word64AtomicLoadUint32:
|
||||
case kWord32AtomicLoadWord32:
|
||||
case kPPC_AtomicLoadWord32:
|
||||
ASSEMBLE_ATOMIC_LOAD_INTEGER(lwz, lwzx);
|
||||
break;
|
||||
case kPPC_Word64AtomicLoadUint64:
|
||||
case kPPC_AtomicLoadWord64:
|
||||
ASSEMBLE_ATOMIC_LOAD_INTEGER(ld, ldx);
|
||||
break;
|
||||
|
||||
case kPPC_Word64AtomicStoreUint8:
|
||||
case kWord32AtomicStoreWord8:
|
||||
case kPPC_AtomicStoreUint8:
|
||||
ASSEMBLE_ATOMIC_STORE_INTEGER(stb, stbx);
|
||||
break;
|
||||
case kPPC_Word64AtomicStoreUint16:
|
||||
case kWord32AtomicStoreWord16:
|
||||
case kPPC_AtomicStoreUint16:
|
||||
ASSEMBLE_ATOMIC_STORE_INTEGER(sth, sthx);
|
||||
break;
|
||||
case kPPC_Word64AtomicStoreUint32:
|
||||
case kWord32AtomicStoreWord32:
|
||||
case kPPC_AtomicStoreWord32:
|
||||
ASSEMBLE_ATOMIC_STORE_INTEGER(stw, stwx);
|
||||
break;
|
||||
case kPPC_Word64AtomicStoreUint64:
|
||||
case kPPC_AtomicStoreWord64:
|
||||
ASSEMBLE_ATOMIC_STORE_INTEGER(std, stdx);
|
||||
break;
|
||||
case kWord32AtomicExchangeInt8:
|
||||
ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lbarx, stbcx);
|
||||
__ extsb(i.OutputRegister(0), i.OutputRegister(0));
|
||||
break;
|
||||
case kPPC_Word64AtomicExchangeUint8:
|
||||
case kWord32AtomicExchangeUint8:
|
||||
case kPPC_AtomicExchangeUint8:
|
||||
ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lbarx, stbcx);
|
||||
break;
|
||||
case kWord32AtomicExchangeInt16:
|
||||
ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lharx, sthcx);
|
||||
__ extsh(i.OutputRegister(0), i.OutputRegister(0));
|
||||
break;
|
||||
case kPPC_Word64AtomicExchangeUint16:
|
||||
case kWord32AtomicExchangeUint16:
|
||||
case kPPC_AtomicExchangeUint16:
|
||||
ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lharx, sthcx);
|
||||
break;
|
||||
case kPPC_Word64AtomicExchangeUint32:
|
||||
case kWord32AtomicExchangeWord32:
|
||||
case kPPC_AtomicExchangeWord32:
|
||||
ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(lwarx, stwcx);
|
||||
break;
|
||||
case kPPC_Word64AtomicExchangeUint64:
|
||||
case kPPC_AtomicExchangeWord64:
|
||||
ASSEMBLE_ATOMIC_EXCHANGE_INTEGER(ldarx, stdcx);
|
||||
break;
|
||||
case kWord32AtomicCompareExchangeInt8:
|
||||
ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_SIGN_EXT(cmp, lbarx, stbcx, extsb);
|
||||
break;
|
||||
case kPPC_Word64AtomicCompareExchangeUint8:
|
||||
case kWord32AtomicCompareExchangeUint8:
|
||||
case kPPC_AtomicCompareExchangeUint8:
|
||||
ASSEMBLE_ATOMIC_COMPARE_EXCHANGE(cmp, lbarx, stbcx);
|
||||
break;
|
||||
case kWord32AtomicCompareExchangeInt16:
|
||||
ASSEMBLE_ATOMIC_COMPARE_EXCHANGE_SIGN_EXT(cmp, lharx, sthcx, extsh);
|
||||
break;
|
||||
case kPPC_Word64AtomicCompareExchangeUint16:
|
||||
case kWord32AtomicCompareExchangeUint16:
|
||||
case kPPC_AtomicCompareExchangeUint16:
|
||||
ASSEMBLE_ATOMIC_COMPARE_EXCHANGE(cmp, lharx, sthcx);
|
||||
break;
|
||||
case kPPC_Word64AtomicCompareExchangeUint32:
|
||||
case kWord32AtomicCompareExchangeWord32:
|
||||
case kPPC_AtomicCompareExchangeWord32:
|
||||
ASSEMBLE_ATOMIC_COMPARE_EXCHANGE(cmpw, lwarx, stwcx);
|
||||
break;
|
||||
case kPPC_Word64AtomicCompareExchangeUint64:
|
||||
case kPPC_AtomicCompareExchangeWord64:
|
||||
ASSEMBLE_ATOMIC_COMPARE_EXCHANGE(cmp, ldarx, stdcx);
|
||||
break;
|
||||
|
||||
@ -2062,20 +2049,20 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kWord32Atomic##op##Int8: \
|
||||
ASSEMBLE_ATOMIC_BINOP_SIGN_EXT(inst, lbarx, stbcx, extsb); \
|
||||
break; \
|
||||
case kPPC_Word64Atomic##op##Uint8: \
|
||||
case kWord32Atomic##op##Uint8: \
|
||||
case kPPC_Atomic##op##Uint8: \
|
||||
ASSEMBLE_ATOMIC_BINOP(inst, lbarx, stbcx); \
|
||||
break; \
|
||||
case kWord32Atomic##op##Int16: \
|
||||
ASSEMBLE_ATOMIC_BINOP_SIGN_EXT(inst, lharx, sthcx, extsh); \
|
||||
break; \
|
||||
case kPPC_Word64Atomic##op##Uint16: \
|
||||
case kWord32Atomic##op##Uint16: \
|
||||
case kPPC_Atomic##op##Uint16: \
|
||||
ASSEMBLE_ATOMIC_BINOP(inst, lharx, sthcx); \
|
||||
break; \
|
||||
case kPPC_Word64Atomic##op##Uint32: \
|
||||
case kWord32Atomic##op##Word32: \
|
||||
case kPPC_Atomic##op##Word32: \
|
||||
ASSEMBLE_ATOMIC_BINOP(inst, lwarx, stwcx); \
|
||||
break; \
|
||||
case kPPC_Atomic##op##Word64: \
|
||||
ASSEMBLE_ATOMIC_BINOP(inst, ldarx, stdcx); \
|
||||
break;
|
||||
ATOMIC_BINOP_CASE(Add, add)
|
||||
ATOMIC_BINOP_CASE(Sub, sub)
|
||||
@ -2084,17 +2071,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
ATOMIC_BINOP_CASE(Xor, xor_)
|
||||
#undef ATOMIC_BINOP_CASE
|
||||
|
||||
#define ATOMIC64_BINOP_CASE(op, inst) \
|
||||
case kPPC_Word64Atomic##op##Uint64: \
|
||||
ASSEMBLE_ATOMIC_BINOP(inst, ldarx, stdcx); \
|
||||
break;
|
||||
ATOMIC64_BINOP_CASE(Add, add)
|
||||
ATOMIC64_BINOP_CASE(Sub, sub)
|
||||
ATOMIC64_BINOP_CASE(And, and_)
|
||||
ATOMIC64_BINOP_CASE(Or, orx)
|
||||
ATOMIC64_BINOP_CASE(Xor, xor_)
|
||||
#undef ATOMIC64_BINOP_CASE
|
||||
|
||||
case kPPC_ByteRev32: {
|
||||
Register input = i.InputRegister(0);
|
||||
Register output = i.OutputRegister();
|
||||
|
@ -11,158 +11,158 @@ namespace compiler {
|
||||
|
||||
// PPC-specific opcodes that specify which assembly sequence to emit.
|
||||
// Most opcodes specify a single instruction.
|
||||
#define TARGET_ARCH_OPCODE_LIST(V) \
|
||||
V(PPC_And) \
|
||||
V(PPC_AndComplement) \
|
||||
V(PPC_Or) \
|
||||
V(PPC_OrComplement) \
|
||||
V(PPC_Xor) \
|
||||
V(PPC_ShiftLeft32) \
|
||||
V(PPC_ShiftLeft64) \
|
||||
V(PPC_ShiftLeftPair) \
|
||||
V(PPC_ShiftRight32) \
|
||||
V(PPC_ShiftRight64) \
|
||||
V(PPC_ShiftRightPair) \
|
||||
V(PPC_ShiftRightAlg32) \
|
||||
V(PPC_ShiftRightAlg64) \
|
||||
V(PPC_ShiftRightAlgPair) \
|
||||
V(PPC_RotRight32) \
|
||||
V(PPC_RotRight64) \
|
||||
V(PPC_Not) \
|
||||
V(PPC_RotLeftAndMask32) \
|
||||
V(PPC_RotLeftAndClear64) \
|
||||
V(PPC_RotLeftAndClearLeft64) \
|
||||
V(PPC_RotLeftAndClearRight64) \
|
||||
V(PPC_Add32) \
|
||||
V(PPC_Add64) \
|
||||
V(PPC_AddWithOverflow32) \
|
||||
V(PPC_AddPair) \
|
||||
V(PPC_AddDouble) \
|
||||
V(PPC_Sub) \
|
||||
V(PPC_SubWithOverflow32) \
|
||||
V(PPC_SubPair) \
|
||||
V(PPC_SubDouble) \
|
||||
V(PPC_Mul32) \
|
||||
V(PPC_Mul32WithHigh32) \
|
||||
V(PPC_Mul64) \
|
||||
V(PPC_MulHigh32) \
|
||||
V(PPC_MulHighU32) \
|
||||
V(PPC_MulPair) \
|
||||
V(PPC_MulDouble) \
|
||||
V(PPC_Div32) \
|
||||
V(PPC_Div64) \
|
||||
V(PPC_DivU32) \
|
||||
V(PPC_DivU64) \
|
||||
V(PPC_DivDouble) \
|
||||
V(PPC_Mod32) \
|
||||
V(PPC_Mod64) \
|
||||
V(PPC_ModU32) \
|
||||
V(PPC_ModU64) \
|
||||
V(PPC_ModDouble) \
|
||||
V(PPC_Neg) \
|
||||
V(PPC_NegDouble) \
|
||||
V(PPC_SqrtDouble) \
|
||||
V(PPC_FloorDouble) \
|
||||
V(PPC_CeilDouble) \
|
||||
V(PPC_TruncateDouble) \
|
||||
V(PPC_RoundDouble) \
|
||||
V(PPC_MaxDouble) \
|
||||
V(PPC_MinDouble) \
|
||||
V(PPC_AbsDouble) \
|
||||
V(PPC_Cntlz32) \
|
||||
V(PPC_Cntlz64) \
|
||||
V(PPC_Popcnt32) \
|
||||
V(PPC_Popcnt64) \
|
||||
V(PPC_Cmp32) \
|
||||
V(PPC_Cmp64) \
|
||||
V(PPC_CmpDouble) \
|
||||
V(PPC_Tst32) \
|
||||
V(PPC_Tst64) \
|
||||
V(PPC_Push) \
|
||||
V(PPC_PushFrame) \
|
||||
V(PPC_StoreToStackSlot) \
|
||||
V(PPC_ExtendSignWord8) \
|
||||
V(PPC_ExtendSignWord16) \
|
||||
V(PPC_ExtendSignWord32) \
|
||||
V(PPC_Uint32ToUint64) \
|
||||
V(PPC_Int64ToInt32) \
|
||||
V(PPC_Int64ToFloat32) \
|
||||
V(PPC_Int64ToDouble) \
|
||||
V(PPC_Uint64ToFloat32) \
|
||||
V(PPC_Uint64ToDouble) \
|
||||
V(PPC_Int32ToFloat32) \
|
||||
V(PPC_Int32ToDouble) \
|
||||
V(PPC_Uint32ToFloat32) \
|
||||
V(PPC_Uint32ToDouble) \
|
||||
V(PPC_Float32ToDouble) \
|
||||
V(PPC_Float64SilenceNaN) \
|
||||
V(PPC_DoubleToInt32) \
|
||||
V(PPC_DoubleToUint32) \
|
||||
V(PPC_DoubleToInt64) \
|
||||
V(PPC_DoubleToUint64) \
|
||||
V(PPC_DoubleToFloat32) \
|
||||
V(PPC_DoubleExtractLowWord32) \
|
||||
V(PPC_DoubleExtractHighWord32) \
|
||||
V(PPC_DoubleInsertLowWord32) \
|
||||
V(PPC_DoubleInsertHighWord32) \
|
||||
V(PPC_DoubleConstruct) \
|
||||
V(PPC_BitcastInt32ToFloat32) \
|
||||
V(PPC_BitcastFloat32ToInt32) \
|
||||
V(PPC_BitcastInt64ToDouble) \
|
||||
V(PPC_BitcastDoubleToInt64) \
|
||||
V(PPC_LoadWordS8) \
|
||||
V(PPC_LoadWordU8) \
|
||||
V(PPC_LoadWordS16) \
|
||||
V(PPC_LoadWordU16) \
|
||||
V(PPC_LoadWordS32) \
|
||||
V(PPC_LoadWordU32) \
|
||||
V(PPC_LoadWord64) \
|
||||
V(PPC_LoadFloat32) \
|
||||
V(PPC_LoadDouble) \
|
||||
V(PPC_StoreWord8) \
|
||||
V(PPC_StoreWord16) \
|
||||
V(PPC_StoreWord32) \
|
||||
V(PPC_StoreWord64) \
|
||||
V(PPC_StoreFloat32) \
|
||||
V(PPC_StoreDouble) \
|
||||
V(PPC_ByteRev32) \
|
||||
V(PPC_ByteRev64) \
|
||||
V(PPC_Word64AtomicStoreUint8) \
|
||||
V(PPC_Word64AtomicStoreUint16) \
|
||||
V(PPC_Word64AtomicStoreUint32) \
|
||||
V(PPC_Word64AtomicStoreUint64) \
|
||||
V(PPC_Word64AtomicLoadUint8) \
|
||||
V(PPC_Word64AtomicLoadUint16) \
|
||||
V(PPC_Word64AtomicLoadUint32) \
|
||||
V(PPC_Word64AtomicLoadUint64) \
|
||||
V(PPC_Word64AtomicExchangeUint8) \
|
||||
V(PPC_Word64AtomicExchangeUint16) \
|
||||
V(PPC_Word64AtomicExchangeUint32) \
|
||||
V(PPC_Word64AtomicExchangeUint64) \
|
||||
V(PPC_Word64AtomicCompareExchangeUint8) \
|
||||
V(PPC_Word64AtomicCompareExchangeUint16) \
|
||||
V(PPC_Word64AtomicCompareExchangeUint32) \
|
||||
V(PPC_Word64AtomicCompareExchangeUint64) \
|
||||
V(PPC_Word64AtomicAddUint8) \
|
||||
V(PPC_Word64AtomicAddUint16) \
|
||||
V(PPC_Word64AtomicAddUint32) \
|
||||
V(PPC_Word64AtomicAddUint64) \
|
||||
V(PPC_Word64AtomicSubUint8) \
|
||||
V(PPC_Word64AtomicSubUint16) \
|
||||
V(PPC_Word64AtomicSubUint32) \
|
||||
V(PPC_Word64AtomicSubUint64) \
|
||||
V(PPC_Word64AtomicAndUint8) \
|
||||
V(PPC_Word64AtomicAndUint16) \
|
||||
V(PPC_Word64AtomicAndUint32) \
|
||||
V(PPC_Word64AtomicAndUint64) \
|
||||
V(PPC_Word64AtomicOrUint8) \
|
||||
V(PPC_Word64AtomicOrUint16) \
|
||||
V(PPC_Word64AtomicOrUint32) \
|
||||
V(PPC_Word64AtomicOrUint64) \
|
||||
V(PPC_Word64AtomicXorUint8) \
|
||||
V(PPC_Word64AtomicXorUint16) \
|
||||
V(PPC_Word64AtomicXorUint32) \
|
||||
V(PPC_Word64AtomicXorUint64)
|
||||
#define TARGET_ARCH_OPCODE_LIST(V) \
|
||||
V(PPC_And) \
|
||||
V(PPC_AndComplement) \
|
||||
V(PPC_Or) \
|
||||
V(PPC_OrComplement) \
|
||||
V(PPC_Xor) \
|
||||
V(PPC_ShiftLeft32) \
|
||||
V(PPC_ShiftLeft64) \
|
||||
V(PPC_ShiftLeftPair) \
|
||||
V(PPC_ShiftRight32) \
|
||||
V(PPC_ShiftRight64) \
|
||||
V(PPC_ShiftRightPair) \
|
||||
V(PPC_ShiftRightAlg32) \
|
||||
V(PPC_ShiftRightAlg64) \
|
||||
V(PPC_ShiftRightAlgPair) \
|
||||
V(PPC_RotRight32) \
|
||||
V(PPC_RotRight64) \
|
||||
V(PPC_Not) \
|
||||
V(PPC_RotLeftAndMask32) \
|
||||
V(PPC_RotLeftAndClear64) \
|
||||
V(PPC_RotLeftAndClearLeft64) \
|
||||
V(PPC_RotLeftAndClearRight64) \
|
||||
V(PPC_Add32) \
|
||||
V(PPC_Add64) \
|
||||
V(PPC_AddWithOverflow32) \
|
||||
V(PPC_AddPair) \
|
||||
V(PPC_AddDouble) \
|
||||
V(PPC_Sub) \
|
||||
V(PPC_SubWithOverflow32) \
|
||||
V(PPC_SubPair) \
|
||||
V(PPC_SubDouble) \
|
||||
V(PPC_Mul32) \
|
||||
V(PPC_Mul32WithHigh32) \
|
||||
V(PPC_Mul64) \
|
||||
V(PPC_MulHigh32) \
|
||||
V(PPC_MulHighU32) \
|
||||
V(PPC_MulPair) \
|
||||
V(PPC_MulDouble) \
|
||||
V(PPC_Div32) \
|
||||
V(PPC_Div64) \
|
||||
V(PPC_DivU32) \
|
||||
V(PPC_DivU64) \
|
||||
V(PPC_DivDouble) \
|
||||
V(PPC_Mod32) \
|
||||
V(PPC_Mod64) \
|
||||
V(PPC_ModU32) \
|
||||
V(PPC_ModU64) \
|
||||
V(PPC_ModDouble) \
|
||||
V(PPC_Neg) \
|
||||
V(PPC_NegDouble) \
|
||||
V(PPC_SqrtDouble) \
|
||||
V(PPC_FloorDouble) \
|
||||
V(PPC_CeilDouble) \
|
||||
V(PPC_TruncateDouble) \
|
||||
V(PPC_RoundDouble) \
|
||||
V(PPC_MaxDouble) \
|
||||
V(PPC_MinDouble) \
|
||||
V(PPC_AbsDouble) \
|
||||
V(PPC_Cntlz32) \
|
||||
V(PPC_Cntlz64) \
|
||||
V(PPC_Popcnt32) \
|
||||
V(PPC_Popcnt64) \
|
||||
V(PPC_Cmp32) \
|
||||
V(PPC_Cmp64) \
|
||||
V(PPC_CmpDouble) \
|
||||
V(PPC_Tst32) \
|
||||
V(PPC_Tst64) \
|
||||
V(PPC_Push) \
|
||||
V(PPC_PushFrame) \
|
||||
V(PPC_StoreToStackSlot) \
|
||||
V(PPC_ExtendSignWord8) \
|
||||
V(PPC_ExtendSignWord16) \
|
||||
V(PPC_ExtendSignWord32) \
|
||||
V(PPC_Uint32ToUint64) \
|
||||
V(PPC_Int64ToInt32) \
|
||||
V(PPC_Int64ToFloat32) \
|
||||
V(PPC_Int64ToDouble) \
|
||||
V(PPC_Uint64ToFloat32) \
|
||||
V(PPC_Uint64ToDouble) \
|
||||
V(PPC_Int32ToFloat32) \
|
||||
V(PPC_Int32ToDouble) \
|
||||
V(PPC_Uint32ToFloat32) \
|
||||
V(PPC_Uint32ToDouble) \
|
||||
V(PPC_Float32ToDouble) \
|
||||
V(PPC_Float64SilenceNaN) \
|
||||
V(PPC_DoubleToInt32) \
|
||||
V(PPC_DoubleToUint32) \
|
||||
V(PPC_DoubleToInt64) \
|
||||
V(PPC_DoubleToUint64) \
|
||||
V(PPC_DoubleToFloat32) \
|
||||
V(PPC_DoubleExtractLowWord32) \
|
||||
V(PPC_DoubleExtractHighWord32) \
|
||||
V(PPC_DoubleInsertLowWord32) \
|
||||
V(PPC_DoubleInsertHighWord32) \
|
||||
V(PPC_DoubleConstruct) \
|
||||
V(PPC_BitcastInt32ToFloat32) \
|
||||
V(PPC_BitcastFloat32ToInt32) \
|
||||
V(PPC_BitcastInt64ToDouble) \
|
||||
V(PPC_BitcastDoubleToInt64) \
|
||||
V(PPC_LoadWordS8) \
|
||||
V(PPC_LoadWordU8) \
|
||||
V(PPC_LoadWordS16) \
|
||||
V(PPC_LoadWordU16) \
|
||||
V(PPC_LoadWordS32) \
|
||||
V(PPC_LoadWordU32) \
|
||||
V(PPC_LoadWord64) \
|
||||
V(PPC_LoadFloat32) \
|
||||
V(PPC_LoadDouble) \
|
||||
V(PPC_StoreWord8) \
|
||||
V(PPC_StoreWord16) \
|
||||
V(PPC_StoreWord32) \
|
||||
V(PPC_StoreWord64) \
|
||||
V(PPC_StoreFloat32) \
|
||||
V(PPC_StoreDouble) \
|
||||
V(PPC_ByteRev32) \
|
||||
V(PPC_ByteRev64) \
|
||||
V(PPC_AtomicStoreUint8) \
|
||||
V(PPC_AtomicStoreUint16) \
|
||||
V(PPC_AtomicStoreWord32) \
|
||||
V(PPC_AtomicStoreWord64) \
|
||||
V(PPC_AtomicLoadUint8) \
|
||||
V(PPC_AtomicLoadUint16) \
|
||||
V(PPC_AtomicLoadWord32) \
|
||||
V(PPC_AtomicLoadWord64) \
|
||||
V(PPC_AtomicExchangeUint8) \
|
||||
V(PPC_AtomicExchangeUint16) \
|
||||
V(PPC_AtomicExchangeWord32) \
|
||||
V(PPC_AtomicExchangeWord64) \
|
||||
V(PPC_AtomicCompareExchangeUint8) \
|
||||
V(PPC_AtomicCompareExchangeUint16) \
|
||||
V(PPC_AtomicCompareExchangeWord32) \
|
||||
V(PPC_AtomicCompareExchangeWord64) \
|
||||
V(PPC_AtomicAddUint8) \
|
||||
V(PPC_AtomicAddUint16) \
|
||||
V(PPC_AtomicAddWord32) \
|
||||
V(PPC_AtomicAddWord64) \
|
||||
V(PPC_AtomicSubUint8) \
|
||||
V(PPC_AtomicSubUint16) \
|
||||
V(PPC_AtomicSubWord32) \
|
||||
V(PPC_AtomicSubWord64) \
|
||||
V(PPC_AtomicAndUint8) \
|
||||
V(PPC_AtomicAndUint16) \
|
||||
V(PPC_AtomicAndWord32) \
|
||||
V(PPC_AtomicAndWord64) \
|
||||
V(PPC_AtomicOrUint8) \
|
||||
V(PPC_AtomicOrUint16) \
|
||||
V(PPC_AtomicOrWord32) \
|
||||
V(PPC_AtomicOrWord64) \
|
||||
V(PPC_AtomicXorUint8) \
|
||||
V(PPC_AtomicXorUint16) \
|
||||
V(PPC_AtomicXorWord32) \
|
||||
V(PPC_AtomicXorWord64)
|
||||
|
||||
// Addressing modes represent the "shape" of inputs to an instruction.
|
||||
// Many instructions support multiple addressing modes. Addressing modes
|
||||
|
@ -135,44 +135,44 @@ int InstructionScheduler::GetTargetInstructionFlags(
|
||||
case kPPC_StoreToStackSlot:
|
||||
return kHasSideEffect;
|
||||
|
||||
case kPPC_Word64AtomicLoadUint8:
|
||||
case kPPC_Word64AtomicLoadUint16:
|
||||
case kPPC_Word64AtomicLoadUint32:
|
||||
case kPPC_Word64AtomicLoadUint64:
|
||||
case kPPC_AtomicLoadUint8:
|
||||
case kPPC_AtomicLoadUint16:
|
||||
case kPPC_AtomicLoadWord32:
|
||||
case kPPC_AtomicLoadWord64:
|
||||
return kIsLoadOperation;
|
||||
|
||||
case kPPC_Word64AtomicStoreUint8:
|
||||
case kPPC_Word64AtomicStoreUint16:
|
||||
case kPPC_Word64AtomicStoreUint32:
|
||||
case kPPC_Word64AtomicStoreUint64:
|
||||
case kPPC_Word64AtomicExchangeUint8:
|
||||
case kPPC_Word64AtomicExchangeUint16:
|
||||
case kPPC_Word64AtomicExchangeUint32:
|
||||
case kPPC_Word64AtomicExchangeUint64:
|
||||
case kPPC_Word64AtomicCompareExchangeUint8:
|
||||
case kPPC_Word64AtomicCompareExchangeUint16:
|
||||
case kPPC_Word64AtomicCompareExchangeUint32:
|
||||
case kPPC_Word64AtomicCompareExchangeUint64:
|
||||
case kPPC_Word64AtomicAddUint8:
|
||||
case kPPC_Word64AtomicAddUint16:
|
||||
case kPPC_Word64AtomicAddUint32:
|
||||
case kPPC_Word64AtomicAddUint64:
|
||||
case kPPC_Word64AtomicSubUint8:
|
||||
case kPPC_Word64AtomicSubUint16:
|
||||
case kPPC_Word64AtomicSubUint32:
|
||||
case kPPC_Word64AtomicSubUint64:
|
||||
case kPPC_Word64AtomicAndUint8:
|
||||
case kPPC_Word64AtomicAndUint16:
|
||||
case kPPC_Word64AtomicAndUint32:
|
||||
case kPPC_Word64AtomicAndUint64:
|
||||
case kPPC_Word64AtomicOrUint8:
|
||||
case kPPC_Word64AtomicOrUint16:
|
||||
case kPPC_Word64AtomicOrUint32:
|
||||
case kPPC_Word64AtomicOrUint64:
|
||||
case kPPC_Word64AtomicXorUint8:
|
||||
case kPPC_Word64AtomicXorUint16:
|
||||
case kPPC_Word64AtomicXorUint32:
|
||||
case kPPC_Word64AtomicXorUint64:
|
||||
case kPPC_AtomicStoreUint8:
|
||||
case kPPC_AtomicStoreUint16:
|
||||
case kPPC_AtomicStoreWord32:
|
||||
case kPPC_AtomicStoreWord64:
|
||||
case kPPC_AtomicExchangeUint8:
|
||||
case kPPC_AtomicExchangeUint16:
|
||||
case kPPC_AtomicExchangeWord32:
|
||||
case kPPC_AtomicExchangeWord64:
|
||||
case kPPC_AtomicCompareExchangeUint8:
|
||||
case kPPC_AtomicCompareExchangeUint16:
|
||||
case kPPC_AtomicCompareExchangeWord32:
|
||||
case kPPC_AtomicCompareExchangeWord64:
|
||||
case kPPC_AtomicAddUint8:
|
||||
case kPPC_AtomicAddUint16:
|
||||
case kPPC_AtomicAddWord32:
|
||||
case kPPC_AtomicAddWord64:
|
||||
case kPPC_AtomicSubUint8:
|
||||
case kPPC_AtomicSubUint16:
|
||||
case kPPC_AtomicSubWord32:
|
||||
case kPPC_AtomicSubWord64:
|
||||
case kPPC_AtomicAndUint8:
|
||||
case kPPC_AtomicAndUint16:
|
||||
case kPPC_AtomicAndWord32:
|
||||
case kPPC_AtomicAndWord64:
|
||||
case kPPC_AtomicOrUint8:
|
||||
case kPPC_AtomicOrUint16:
|
||||
case kPPC_AtomicOrWord32:
|
||||
case kPPC_AtomicOrWord64:
|
||||
case kPPC_AtomicXorUint8:
|
||||
case kPPC_AtomicXorUint16:
|
||||
case kPPC_AtomicXorWord32:
|
||||
case kPPC_AtomicXorWord64:
|
||||
return kHasSideEffect;
|
||||
|
||||
#define CASE(Name) case k##Name:
|
||||
|
@ -1940,14 +1940,14 @@ void InstructionSelector::VisitWord32AtomicLoad(Node* node) {
|
||||
switch (load_rep.representation()) {
|
||||
case MachineRepresentation::kWord8:
|
||||
opcode =
|
||||
load_rep.IsSigned() ? kWord32AtomicLoadInt8 : kWord32AtomicLoadUint8;
|
||||
load_rep.IsSigned() ? kWord32AtomicLoadInt8 : kPPC_AtomicLoadUint8;
|
||||
break;
|
||||
case MachineRepresentation::kWord16:
|
||||
opcode = load_rep.IsSigned() ? kWord32AtomicLoadInt16
|
||||
: kWord32AtomicLoadUint16;
|
||||
opcode =
|
||||
load_rep.IsSigned() ? kWord32AtomicLoadInt16 : kPPC_AtomicLoadUint16;
|
||||
break;
|
||||
case MachineRepresentation::kWord32:
|
||||
opcode = kWord32AtomicLoadWord32;
|
||||
opcode = kPPC_AtomicLoadWord32;
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
@ -1965,16 +1965,16 @@ void InstructionSelector::VisitWord64AtomicLoad(Node* node) {
|
||||
ArchOpcode opcode = kArchNop;
|
||||
switch (load_rep.representation()) {
|
||||
case MachineRepresentation::kWord8:
|
||||
opcode = kPPC_Word64AtomicLoadUint8;
|
||||
opcode = kPPC_AtomicLoadUint8;
|
||||
break;
|
||||
case MachineRepresentation::kWord16:
|
||||
opcode = kPPC_Word64AtomicLoadUint16;
|
||||
opcode = kPPC_AtomicLoadUint16;
|
||||
break;
|
||||
case MachineRepresentation::kWord32:
|
||||
opcode = kPPC_Word64AtomicLoadUint32;
|
||||
opcode = kPPC_AtomicLoadWord32;
|
||||
break;
|
||||
case MachineRepresentation::kWord64:
|
||||
opcode = kPPC_Word64AtomicLoadUint64;
|
||||
opcode = kPPC_AtomicLoadWord64;
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
@ -1993,13 +1993,13 @@ void InstructionSelector::VisitWord32AtomicStore(Node* node) {
|
||||
ArchOpcode opcode = kArchNop;
|
||||
switch (rep) {
|
||||
case MachineRepresentation::kWord8:
|
||||
opcode = kWord32AtomicStoreWord8;
|
||||
opcode = kPPC_AtomicStoreUint8;
|
||||
break;
|
||||
case MachineRepresentation::kWord16:
|
||||
opcode = kWord32AtomicStoreWord16;
|
||||
opcode = kPPC_AtomicStoreUint16;
|
||||
break;
|
||||
case MachineRepresentation::kWord32:
|
||||
opcode = kWord32AtomicStoreWord32;
|
||||
opcode = kPPC_AtomicStoreWord32;
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
@ -2024,16 +2024,16 @@ void InstructionSelector::VisitWord64AtomicStore(Node* node) {
|
||||
ArchOpcode opcode = kArchNop;
|
||||
switch (rep) {
|
||||
case MachineRepresentation::kWord8:
|
||||
opcode = kPPC_Word64AtomicStoreUint8;
|
||||
opcode = kPPC_AtomicStoreUint8;
|
||||
break;
|
||||
case MachineRepresentation::kWord16:
|
||||
opcode = kPPC_Word64AtomicStoreUint16;
|
||||
opcode = kPPC_AtomicStoreUint16;
|
||||
break;
|
||||
case MachineRepresentation::kWord32:
|
||||
opcode = kPPC_Word64AtomicStoreUint32;
|
||||
opcode = kPPC_AtomicStoreWord32;
|
||||
break;
|
||||
case MachineRepresentation::kWord64:
|
||||
opcode = kPPC_Word64AtomicStoreUint64;
|
||||
opcode = kPPC_AtomicStoreWord64;
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
@ -2074,13 +2074,13 @@ void InstructionSelector::VisitWord32AtomicExchange(Node* node) {
|
||||
if (type == MachineType::Int8()) {
|
||||
opcode = kWord32AtomicExchangeInt8;
|
||||
} else if (type == MachineType::Uint8()) {
|
||||
opcode = kWord32AtomicExchangeUint8;
|
||||
opcode = kPPC_AtomicExchangeUint8;
|
||||
} else if (type == MachineType::Int16()) {
|
||||
opcode = kWord32AtomicExchangeInt16;
|
||||
} else if (type == MachineType::Uint16()) {
|
||||
opcode = kWord32AtomicExchangeUint16;
|
||||
opcode = kPPC_AtomicExchangeUint16;
|
||||
} else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
|
||||
opcode = kWord32AtomicExchangeWord32;
|
||||
opcode = kPPC_AtomicExchangeWord32;
|
||||
} else {
|
||||
UNREACHABLE();
|
||||
return;
|
||||
@ -2092,13 +2092,13 @@ void InstructionSelector::VisitWord64AtomicExchange(Node* node) {
|
||||
ArchOpcode opcode = kArchNop;
|
||||
MachineType type = AtomicOpType(node->op());
|
||||
if (type == MachineType::Uint8()) {
|
||||
opcode = kPPC_Word64AtomicExchangeUint8;
|
||||
opcode = kPPC_AtomicExchangeUint8;
|
||||
} else if (type == MachineType::Uint16()) {
|
||||
opcode = kPPC_Word64AtomicExchangeUint16;
|
||||
opcode = kPPC_AtomicExchangeUint16;
|
||||
} else if (type == MachineType::Uint32()) {
|
||||
opcode = kPPC_Word64AtomicExchangeUint32;
|
||||
opcode = kPPC_AtomicExchangeWord32;
|
||||
} else if (type == MachineType::Uint64()) {
|
||||
opcode = kPPC_Word64AtomicExchangeUint64;
|
||||
opcode = kPPC_AtomicExchangeWord64;
|
||||
} else {
|
||||
UNREACHABLE();
|
||||
return;
|
||||
@ -2137,13 +2137,13 @@ void InstructionSelector::VisitWord32AtomicCompareExchange(Node* node) {
|
||||
if (type == MachineType::Int8()) {
|
||||
opcode = kWord32AtomicCompareExchangeInt8;
|
||||
} else if (type == MachineType::Uint8()) {
|
||||
opcode = kWord32AtomicCompareExchangeUint8;
|
||||
opcode = kPPC_AtomicCompareExchangeUint8;
|
||||
} else if (type == MachineType::Int16()) {
|
||||
opcode = kWord32AtomicCompareExchangeInt16;
|
||||
} else if (type == MachineType::Uint16()) {
|
||||
opcode = kWord32AtomicCompareExchangeUint16;
|
||||
opcode = kPPC_AtomicCompareExchangeUint16;
|
||||
} else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
|
||||
opcode = kWord32AtomicCompareExchangeWord32;
|
||||
opcode = kPPC_AtomicCompareExchangeWord32;
|
||||
} else {
|
||||
UNREACHABLE();
|
||||
return;
|
||||
@ -2155,13 +2155,13 @@ void InstructionSelector::VisitWord64AtomicCompareExchange(Node* node) {
|
||||
MachineType type = AtomicOpType(node->op());
|
||||
ArchOpcode opcode = kArchNop;
|
||||
if (type == MachineType::Uint8()) {
|
||||
opcode = kPPC_Word64AtomicCompareExchangeUint8;
|
||||
opcode = kPPC_AtomicCompareExchangeUint8;
|
||||
} else if (type == MachineType::Uint16()) {
|
||||
opcode = kPPC_Word64AtomicCompareExchangeUint16;
|
||||
opcode = kPPC_AtomicCompareExchangeUint16;
|
||||
} else if (type == MachineType::Uint32()) {
|
||||
opcode = kPPC_Word64AtomicCompareExchangeUint32;
|
||||
opcode = kPPC_AtomicCompareExchangeWord32;
|
||||
} else if (type == MachineType::Uint64()) {
|
||||
opcode = kPPC_Word64AtomicCompareExchangeUint64;
|
||||
opcode = kPPC_AtomicCompareExchangeWord64;
|
||||
} else {
|
||||
UNREACHABLE();
|
||||
return;
|
||||
@ -2215,12 +2215,12 @@ void InstructionSelector::VisitWord32AtomicBinaryOperation(
|
||||
VisitAtomicBinaryOperation(this, node, opcode);
|
||||
}
|
||||
|
||||
#define VISIT_ATOMIC_BINOP(op) \
|
||||
void InstructionSelector::VisitWord32Atomic##op(Node* node) { \
|
||||
VisitWord32AtomicBinaryOperation( \
|
||||
node, kWord32Atomic##op##Int8, kWord32Atomic##op##Uint8, \
|
||||
kWord32Atomic##op##Int16, kWord32Atomic##op##Uint16, \
|
||||
kWord32Atomic##op##Word32); \
|
||||
#define VISIT_ATOMIC_BINOP(op) \
|
||||
void InstructionSelector::VisitWord32Atomic##op(Node* node) { \
|
||||
VisitWord32AtomicBinaryOperation( \
|
||||
node, kWord32Atomic##op##Int8, kPPC_Atomic##op##Uint8, \
|
||||
kWord32Atomic##op##Int16, kPPC_Atomic##op##Uint16, \
|
||||
kPPC_Atomic##op##Word32); \
|
||||
}
|
||||
VISIT_ATOMIC_BINOP(Add)
|
||||
VISIT_ATOMIC_BINOP(Sub)
|
||||
@ -2234,7 +2234,6 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
|
||||
ArchOpcode uint64_op) {
|
||||
MachineType type = AtomicOpType(node->op());
|
||||
ArchOpcode opcode = kArchNop;
|
||||
|
||||
if (type == MachineType::Uint8()) {
|
||||
opcode = uint8_op;
|
||||
} else if (type == MachineType::Uint16()) {
|
||||
@ -2250,11 +2249,11 @@ void InstructionSelector::VisitWord64AtomicBinaryOperation(
|
||||
VisitAtomicBinaryOperation(this, node, opcode);
|
||||
}
|
||||
|
||||
#define VISIT_ATOMIC64_BINOP(op) \
|
||||
void InstructionSelector::VisitWord64Atomic##op(Node* node) { \
|
||||
VisitWord64AtomicBinaryOperation( \
|
||||
node, kPPC_Word64Atomic##op##Uint8, kPPC_Word64Atomic##op##Uint16, \
|
||||
kPPC_Word64Atomic##op##Uint32, kPPC_Word64Atomic##op##Uint64); \
|
||||
#define VISIT_ATOMIC64_BINOP(op) \
|
||||
void InstructionSelector::VisitWord64Atomic##op(Node* node) { \
|
||||
VisitWord64AtomicBinaryOperation( \
|
||||
node, kPPC_Atomic##op##Uint8, kPPC_Atomic##op##Uint16, \
|
||||
kPPC_Atomic##op##Word32, kPPC_Atomic##op##Word64); \
|
||||
}
|
||||
VISIT_ATOMIC64_BINOP(Add)
|
||||
VISIT_ATOMIC64_BINOP(Sub)
|
||||
|
Loading…
Reference in New Issue
Block a user