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

Unified Diff: src/compiler/machine-operator.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/int64-lowering.cc ('k') | src/compiler/machine-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator.h
diff --git a/src/compiler/machine-operator.h b/src/compiler/machine-operator.h
index 5886bd445e8b1f6c4b7d1a0e67bf88ae6e2ba517..4f8612a7acd9be07a6a54f64985bcbe3b10ac4fe 100644
--- a/src/compiler/machine-operator.h
+++ b/src/compiler/machine-operator.h
@@ -70,6 +70,15 @@ std::ostream& operator<<(std::ostream&, StoreRepresentation);
StoreRepresentation const& StoreRepresentationOf(Operator const*);
+typedef MachineType UnalignedLoadRepresentation;
+
+UnalignedLoadRepresentation UnalignedLoadRepresentationOf(Operator const*);
+
+// An UnalignedStore needs a MachineType.
+typedef MachineRepresentation UnalignedStoreRepresentation;
+
+UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
+ Operator const*);
// A CheckedLoad needs a MachineType.
typedef MachineType CheckedLoadRepresentation;
@@ -95,27 +104,34 @@ class MachineOperatorBuilder final : public ZoneObject {
// for operations that are unsupported by some back-ends.
enum Flag : unsigned {
kNoFlags = 0u,
- kFloat32RoundDown = 1u << 0,
- kFloat64RoundDown = 1u << 1,
- kFloat32RoundUp = 1u << 2,
- kFloat64RoundUp = 1u << 3,
- kFloat32RoundTruncate = 1u << 4,
- kFloat64RoundTruncate = 1u << 5,
- kFloat32RoundTiesEven = 1u << 6,
- kFloat64RoundTiesEven = 1u << 7,
- kFloat64RoundTiesAway = 1u << 8,
- kInt32DivIsSafe = 1u << 9,
- kUint32DivIsSafe = 1u << 10,
- kWord32ShiftIsSafe = 1u << 11,
- kWord32Ctz = 1u << 12,
- kWord64Ctz = 1u << 13,
- kWord32Popcnt = 1u << 14,
- kWord64Popcnt = 1u << 15,
- kWord32ReverseBits = 1u << 16,
- kWord64ReverseBits = 1u << 17,
- kFloat32Neg = 1u << 18,
- kFloat64Neg = 1u << 19,
+ // Note that Float*Max behaves like `(b < a) ? a : b`, not like Math.max().
+ // Note that Float*Min behaves like `(a < b) ? a : b`, not like Math.min().
+ kFloat32Max = 1u << 0,
+ kFloat32Min = 1u << 1,
+ kFloat64Max = 1u << 2,
+ kFloat64Min = 1u << 3,
+ kFloat32RoundDown = 1u << 4,
+ kFloat64RoundDown = 1u << 5,
+ kFloat32RoundUp = 1u << 6,
+ kFloat64RoundUp = 1u << 7,
+ kFloat32RoundTruncate = 1u << 8,
+ kFloat64RoundTruncate = 1u << 9,
+ kFloat32RoundTiesEven = 1u << 10,
+ kFloat64RoundTiesEven = 1u << 11,
+ kFloat64RoundTiesAway = 1u << 12,
+ kInt32DivIsSafe = 1u << 13,
+ kUint32DivIsSafe = 1u << 14,
+ kWord32ShiftIsSafe = 1u << 15,
+ kWord32Ctz = 1u << 16,
+ kWord64Ctz = 1u << 17,
+ kWord32Popcnt = 1u << 18,
+ kWord64Popcnt = 1u << 19,
+ kWord32ReverseBits = 1u << 20,
+ kWord64ReverseBits = 1u << 21,
+ kFloat32Neg = 1u << 22,
+ kFloat64Neg = 1u << 23,
kAllOptionalOps =
+ kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min |
kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp |
kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate |
kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven |
@@ -191,7 +207,7 @@ class MachineOperatorBuilder final : public ZoneObject {
MachineRepresentation word = MachineType::PointerRepresentation(),
Flags supportedOperators = kNoFlags,
AlignmentRequirements alignmentRequirements =
- AlignmentRequirements::NoUnalignedAccessSupport());
+ AlignmentRequirements::FullUnalignedAccessSupport());
const Operator* Comment(const char* msg);
const Operator* DebugBreak();
@@ -591,6 +607,12 @@ class MachineOperatorBuilder final : public ZoneObject {
// store [base + index], value
const Operator* Store(StoreRepresentation rep);
+ // unaligned load [base + index]
+ const Operator* UnalignedLoad(UnalignedLoadRepresentation rep);
+
+ // unaligned store [base + index], value
+ const Operator* UnalignedStore(UnalignedStoreRepresentation rep);
+
const Operator* StackSlot(MachineRepresentation rep);
// Access to the machine stack.
« no previous file with comments | « src/compiler/int64-lowering.cc ('k') | src/compiler/machine-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698