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

Unified Diff: src/machine-type.h

Issue 2122853002: Implement UnaligedLoad and UnaligedStore turbofan operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nits. Fixes some errors Created 4 years, 5 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 | « src/compiler/x87/instruction-selector-x87.cc ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/machine-type.h
diff --git a/src/machine-type.h b/src/machine-type.h
index c72ead527b2d1d9595b89299328895377a7a13a5..f2c3e75f2de2a528925c2ad8be0b4e3b565e23cc 100644
--- a/src/machine-type.h
+++ b/src/machine-type.h
@@ -159,6 +159,35 @@ class MachineType {
return MachineType(MachineRepresentation::kBit, MachineSemantic::kNone);
}
+ static MachineType TypeForRepresentation(MachineRepresentation& rep,
+ bool isSigned = true) {
+ switch (rep) {
+ case MachineRepresentation::kNone:
+ return MachineType::None();
+ case MachineRepresentation::kBit:
+ return MachineType::Bool();
+ case MachineRepresentation::kWord8:
+ return isSigned ? MachineType::Int8() : MachineType::Uint8();
+ case MachineRepresentation::kWord16:
+ return isSigned ? MachineType::Int16() : MachineType::Uint16();
+ case MachineRepresentation::kWord32:
+ return isSigned ? MachineType::Int32() : MachineType::Uint32();
+ case MachineRepresentation::kWord64:
+ return isSigned ? MachineType::Int64() : MachineType::Uint64();
+ case MachineRepresentation::kFloat32:
+ return MachineType::Float32();
+ case MachineRepresentation::kFloat64:
+ return MachineType::Float64();
+ case MachineRepresentation::kSimd128:
+ return MachineType::Simd128();
+ case MachineRepresentation::kTagged:
+ return MachineType::AnyTagged();
+ default:
+ UNREACHABLE();
+ return MachineType::None();
+ }
+ }
+
private:
MachineRepresentation representation_;
MachineSemantic semantic_;
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698