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

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

Issue 2427483002: [turbofan][X64] Movzxbl/Movsxbl/Movzxwl/Movsxwl also zero extend to 64bit. (Closed)
Patch Set: Created 4 years, 2 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 7c72587ab69e1ad7e20707ae57bc070e9326ed2e..646d914b2eae7954483782d8444445edc712f690 100644
--- a/src/compiler/x64/instruction-selector-x64.cc
+++ b/src/compiler/x64/instruction-selector-x64.cc
@@ -1250,6 +1250,22 @@ bool ZeroExtendsWord32ToWord64(Node* node) {
return false;
}
}
+ case IrOpcode::kLoad: {
+ // The movzxbl/movsxbl/movzxwl/movsxwl operations implicitly zero-extend
+ // to 64-bit on x64,
+ // so the zero-extension is a no-op.
+ LoadRepresentation load_rep = LoadRepresentationOf(node->op());
+ ArchOpcode opcode = GetLoadOpcode(load_rep);
Benedikt Meurer 2016/10/17 08:20:42 How about pattern matching the representation inst
+ switch (opcode) {
+ case kX64Movzxbl:
+ case kX64Movsxbl:
+ case kX64Movzxwl:
+ case kX64Movsxwl:
+ return true;
+ default:
+ return false;
+ }
+ }
default:
return false;
}
@@ -1265,6 +1281,7 @@ void InstructionSelector::VisitChangeUint32ToUint64(Node* node) {
// zero-extension is a no-op.
return EmitIdentity(node);
}
+
titzer 2016/10/17 08:13:35 Spurious whitespace change.
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