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

Unified Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 928723003: Revert of [x64] Improve instruction selection for TruncateInt64ToInt32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | test/unittests/compiler/x64/instruction-selector-x64-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/instruction-selector-x64.cc
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc
index 0689eb9adc63c029f69af82f3426cd1a4aea6ea6..db2d8cb08c7813f944a31f5ac7c8fc98ec7fb244 100644
--- a/src/compiler/x64/instruction-selector-x64.cc
+++ b/src/compiler/x64/instruction-selector-x64.cc
@@ -812,22 +812,12 @@
Node* value = node->InputAt(0);
if (CanCover(node, value)) {
switch (value->opcode()) {
- case IrOpcode::kWord64Sar: {
+ case IrOpcode::kWord64Sar:
+ case IrOpcode::kWord64Shr: {
Int64BinopMatcher m(value);
- if (m.right().IsInRange(1, 32)) {
+ if (m.right().Is(32)) {
Emit(kX64Shr, g.DefineSameAsFirst(node),
- g.UseRegister(m.left().node()),
- g.UseImmediate(m.right().node()));
- return;
- }
- break;
- }
- case IrOpcode::kWord64Shl: {
- Int64BinopMatcher m(value);
- if (m.right().IsInRange(1, 31)) {
- Emit(kX64Shl32, g.DefineSameAsFirst(node),
- g.UseRegister(m.left().node()),
- g.UseImmediate(m.right().node()));
+ g.UseRegister(m.left().node()), g.TempImmediate(32));
return;
}
break;
@@ -836,9 +826,7 @@
break;
}
}
- // Otherwise truncation from 64-bit to 32-bit is a no-nop, as 32-bit
- // operations just ignore the upper 64-bit.
- Emit(kArchNop, g.DefineAsRegister(node), g.Use(value));
+ Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value));
}
« no previous file with comments | « no previous file | test/unittests/compiler/x64/instruction-selector-x64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698