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

Unified Diff: src/compiler/simplified-operator-reducer.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/simplified-operator-reducer.cc
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc
index 1a5b267b415f22f968192589ad72d38708e7eaed..192c6476a096c8aefaac163ab98b0d41db587f88 100644
--- a/src/compiler/simplified-operator-reducer.cc
+++ b/src/compiler/simplified-operator-reducer.cc
@@ -96,6 +96,18 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
if (m.HasValue()) return ReplaceNumber(FastUI2D(m.Value()));
break;
}
+ case IrOpcode::kTruncateTaggedToWord32: {
+ NumberMatcher m(node->InputAt(0));
+ if (m.HasValue()) return ReplaceInt32(DoubleToInt32(m.Value()));
+ if (m.IsChangeInt31ToTagged() || m.IsChangeInt32ToTagged() ||
+ m.IsChangeUint32ToTagged()) {
+ return Replace(m.InputAt(0));
+ }
+ if (m.IsChangeFloat64ToTagged()) {
+ return Change(node, machine()->TruncateFloat64ToWord32(), m.InputAt(0));
+ }
+ break;
+ }
case IrOpcode::kNumberCeil:
case IrOpcode::kNumberFloor:
case IrOpcode::kNumberRound:

Powered by Google App Engine
This is Rietveld 408576698