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

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

Issue 1919513002: [turbofan] Introduce TruncateTaggedToWord32 simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 73ae014a003f7d00f9f8a2d506c54658b8e032de..88f67e2f3831c5738e6da5e4033aafcdd18d5d1c 100644
--- a/src/compiler/machine-operator.cc
+++ b/src/compiler/machine-operator.cc
@@ -12,24 +12,6 @@ namespace v8 {
namespace internal {
namespace compiler {
-std::ostream& operator<<(std::ostream& os, TruncationMode mode) {
- switch (mode) {
- case TruncationMode::kJavaScript:
- return os << "JavaScript";
- case TruncationMode::kRoundToZero:
- return os << "RoundToZero";
- }
- UNREACHABLE();
- return os;
-}
-
-
-TruncationMode TruncationModeOf(Operator const* op) {
- DCHECK_EQ(IrOpcode::kTruncateFloat64ToInt32, op->opcode());
- return OpParameter<TruncationMode>(op);
-}
-
-
std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) {
switch (kind) {
case kNoWriteBarrier:
@@ -147,6 +129,7 @@ MachineRepresentation StackSlotRepresentationOf(Operator const* op) {
V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1) \
V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
V(BitcastWordToTagged, Operator::kNoProperties, 1, 0, 1) \
+ V(TruncateFloat64ToWord32, Operator::kNoProperties, 1, 0, 1) \
V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1) \
V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \
V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \
@@ -158,6 +141,7 @@ MachineRepresentation StackSlotRepresentationOf(Operator const* op) {
V(TryTruncateFloat32ToUint64, Operator::kNoProperties, 1, 0, 2) \
V(TryTruncateFloat64ToUint64, Operator::kNoProperties, 1, 0, 2) \
V(ChangeInt32ToFloat64, Operator::kNoProperties, 1, 0, 1) \
+ V(RoundFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \
V(RoundInt32ToFloat32, Operator::kNoProperties, 1, 0, 1) \
V(RoundInt64ToFloat32, Operator::kNoProperties, 1, 0, 1) \
V(RoundInt64ToFloat64, Operator::kNoProperties, 1, 0, 1) \
@@ -274,19 +258,6 @@ struct MachineOperatorGlobalCache {
PURE_OPTIONAL_OP_LIST(PURE)
#undef PURE
- template <TruncationMode kMode>
- struct TruncateFloat64ToInt32Operator final
- : public Operator1<TruncationMode> {
- TruncateFloat64ToInt32Operator()
- : Operator1<TruncationMode>(IrOpcode::kTruncateFloat64ToInt32,
- Operator::kPure, "TruncateFloat64ToInt32",
- 1, 0, 0, 1, 0, 0, kMode) {}
- };
- TruncateFloat64ToInt32Operator<TruncationMode::kJavaScript>
- kTruncateFloat64ToInt32JavaScript;
- TruncateFloat64ToInt32Operator<TruncationMode::kRoundToZero>
- kTruncateFloat64ToInt32RoundToZero;
-
#define LOAD(Type) \
struct Load##Type##Operator final : public Operator1<LoadRepresentation> { \
Load##Type##Operator() \
@@ -406,19 +377,6 @@ PURE_OPTIONAL_OP_LIST(PURE)
#undef PURE
-const Operator* MachineOperatorBuilder::TruncateFloat64ToInt32(
- TruncationMode mode) {
- switch (mode) {
- case TruncationMode::kJavaScript:
- return &cache_.kTruncateFloat64ToInt32JavaScript;
- case TruncationMode::kRoundToZero:
- return &cache_.kTruncateFloat64ToInt32RoundToZero;
- }
- UNREACHABLE();
- return nullptr;
-}
-
-
const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) {
#define LOAD(Type) \
if (rep == MachineType::Type()) { \

Powered by Google App Engine
This is Rietveld 408576698