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

Unified Diff: src/compiler/machine-operator.h

Issue 681133004: [turbofan] Complete support for integer division/modulus in simplified lowering. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes Created 6 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 | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/machine-operator-reducer.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 2c87189e98eb86cee9f245ebe4ed430b98420913..f717729dbcb9b46c20bc5f3874f0389a74f0a580 100644
--- a/src/compiler/machine-operator.h
+++ b/src/compiler/machine-operator.h
@@ -60,17 +60,21 @@ class MachineOperatorBuilder FINAL : public ZoneObject {
public:
// Flags that specify which operations are available. This is useful
// for operations that are unsupported by some back-ends.
- enum class Flag : unsigned {
- kNoFlags = 0,
- kFloat64Floor = 1 << 0,
- kFloat64Ceil = 1 << 1,
- kFloat64RoundTruncate = 1 << 2,
- kFloat64RoundTiesAway = 1 << 3
+ enum Flag {
+ kNoFlags = 0u,
+ kFloat64Floor = 1u << 0,
+ kFloat64Ceil = 1u << 1,
+ kFloat64RoundTruncate = 1u << 2,
+ kFloat64RoundTiesAway = 1u << 3,
+ kInt32DivIsSafe = 1u << 4,
+ kInt32ModIsSafe = 1u << 5,
+ kUint32DivIsSafe = 1u << 6,
+ kUint32ModIsSafe = 1u << 7
};
typedef base::Flags<Flag, unsigned> Flags;
explicit MachineOperatorBuilder(MachineType word = kMachPtr,
- Flags supportedOperators = Flag::kNoFlags);
+ Flags supportedOperators = kNoFlags);
const Operator* Word32And();
const Operator* Word32Or();
@@ -104,6 +108,10 @@ class MachineOperatorBuilder FINAL : public ZoneObject {
const Operator* Uint32LessThan();
const Operator* Uint32LessThanOrEqual();
const Operator* Uint32Mod();
+ bool Int32DivIsSafe() const { return flags_ & kInt32DivIsSafe; }
+ bool Int32ModIsSafe() const { return flags_ & kInt32ModIsSafe; }
+ bool Uint32DivIsSafe() const { return flags_ & kUint32DivIsSafe; }
+ bool Uint32ModIsSafe() const { return flags_ & kUint32ModIsSafe; }
const Operator* Int64Add();
const Operator* Int64Sub();
@@ -153,14 +161,10 @@ class MachineOperatorBuilder FINAL : public ZoneObject {
const Operator* Float64Ceil();
const Operator* Float64RoundTruncate();
const Operator* Float64RoundTiesAway();
- bool HasFloat64Floor() { return flags_ & Flag::kFloat64Floor; }
- bool HasFloat64Ceil() { return flags_ & Flag::kFloat64Ceil; }
- bool HasFloat64RoundTruncate() {
- return flags_ & Flag::kFloat64RoundTruncate;
- }
- bool HasFloat64RoundTiesAway() {
- return flags_ & Flag::kFloat64RoundTiesAway;
- }
+ bool HasFloat64Floor() { return flags_ & kFloat64Floor; }
+ bool HasFloat64Ceil() { return flags_ & kFloat64Ceil; }
+ bool HasFloat64RoundTruncate() { return flags_ & kFloat64RoundTruncate; }
+ bool HasFloat64RoundTiesAway() { return flags_ & kFloat64RoundTiesAway; }
// load [base + index]
const Operator* Load(LoadRepresentation rep);
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/machine-operator-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698