Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: src/compiler/machine-operator.cc

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: remove 0 extend for arm Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/machine-operator.cc
diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc
index 8123dcef8f2e4479080973a98f2745dc08932968..e1a0dce5f3260cd2697433e60a986d3f1459f69c 100644
--- a/src/compiler/machine-operator.cc
+++ b/src/compiler/machine-operator.cc
@@ -80,6 +80,11 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
return OpParameter<MachineRepresentation>(op);
}
+MachineType AtomicExchangeRepresentationOf(Operator const* op) {
+ DCHECK_EQ(IrOpcode::kAtomicExchange, op->opcode());
+ return OpParameter<MachineType>(op);
+}
+
#define PURE_BINARY_OP_LIST_32(V) \
V(Word32And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
V(Word32Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
@@ -602,6 +607,18 @@ struct MachineOperatorGlobalCache {
ATOMIC_REPRESENTATION_LIST(ATOMIC_STORE)
#undef STORE
+#define ATOMIC_EXCHANGE(Type) \
+ struct AtomicExchange##Type##Operator : public Operator1<MachineType> { \
+ AtomicExchange##Type##Operator() \
+ : Operator1<MachineType>(IrOpcode::kAtomicExchange, \
+ Operator::kNoDeopt | Operator::kNoThrow, \
+ "AtomicExchange", 3, 1, 1, 1, 1, 0, \
+ MachineType::Type()) {} \
+ }; \
+ AtomicExchange##Type##Operator kAtomicExchange##Type;
+ ATOMIC_TYPE_LIST(ATOMIC_EXCHANGE)
+#undef ATOMIC_EXCHANGE
+
struct DebugBreakOperator : public Operator {
DebugBreakOperator()
: Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0,
@@ -841,6 +858,17 @@ const Operator* MachineOperatorBuilder::AtomicStore(MachineRepresentation rep) {
return nullptr;
}
+const Operator* MachineOperatorBuilder::AtomicExchange(MachineType rep) {
+#define EXCHANGE(kRep) \
+ if (rep == MachineType::kRep()) { \
+ return &cache_.kAtomicExchange##kRep; \
+ }
+ ATOMIC_TYPE_LIST(EXCHANGE)
+#undef EXCHANGE
+ UNREACHABLE();
+ return nullptr;
+}
+
#define SIMD_LANE_OPS(Type, lane_count) \
const Operator* MachineOperatorBuilder::Type##ExtractLane( \
int32_t lane_index) { \

Powered by Google App Engine
This is Rietveld 408576698