OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_ | 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_ |
6 #define V8_COMPILER_MACHINE_OPERATOR_H_ | 6 #define V8_COMPILER_MACHINE_OPERATOR_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/compiler/machine-type.h" | 9 #include "src/compiler/machine-type.h" |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 public: | 60 public: |
61 // Flags that specify which operations are available. This is useful | 61 // Flags that specify which operations are available. This is useful |
62 // for operations that are unsupported by some back-ends. | 62 // for operations that are unsupported by some back-ends. |
63 enum Flag { | 63 enum Flag { |
64 kNoFlags = 0u, | 64 kNoFlags = 0u, |
65 kFloat64Floor = 1u << 0, | 65 kFloat64Floor = 1u << 0, |
66 kFloat64Ceil = 1u << 1, | 66 kFloat64Ceil = 1u << 1, |
67 kFloat64RoundTruncate = 1u << 2, | 67 kFloat64RoundTruncate = 1u << 2, |
68 kFloat64RoundTiesAway = 1u << 3, | 68 kFloat64RoundTiesAway = 1u << 3, |
69 kInt32DivIsSafe = 1u << 4, | 69 kInt32DivIsSafe = 1u << 4, |
70 kInt32ModIsSafe = 1u << 5, | 70 kUint32DivIsSafe = 1u << 5 |
71 kUint32DivIsSafe = 1u << 6, | |
72 kUint32ModIsSafe = 1u << 7 | |
73 }; | 71 }; |
74 typedef base::Flags<Flag, unsigned> Flags; | 72 typedef base::Flags<Flag, unsigned> Flags; |
75 | 73 |
76 explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr, | 74 explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr, |
77 Flags supportedOperators = kNoFlags); | 75 Flags supportedOperators = kNoFlags); |
78 | 76 |
79 const Operator* Word32And(); | 77 const Operator* Word32And(); |
80 const Operator* Word32Or(); | 78 const Operator* Word32Or(); |
81 const Operator* Word32Xor(); | 79 const Operator* Word32Xor(); |
82 const Operator* Word32Shl(); | 80 const Operator* Word32Shl(); |
(...skipping 20 matching lines...) Expand all Loading... |
103 const Operator* Int32Div(); | 101 const Operator* Int32Div(); |
104 const Operator* Int32Mod(); | 102 const Operator* Int32Mod(); |
105 const Operator* Int32LessThan(); | 103 const Operator* Int32LessThan(); |
106 const Operator* Int32LessThanOrEqual(); | 104 const Operator* Int32LessThanOrEqual(); |
107 const Operator* Uint32Div(); | 105 const Operator* Uint32Div(); |
108 const Operator* Uint32LessThan(); | 106 const Operator* Uint32LessThan(); |
109 const Operator* Uint32LessThanOrEqual(); | 107 const Operator* Uint32LessThanOrEqual(); |
110 const Operator* Uint32Mod(); | 108 const Operator* Uint32Mod(); |
111 const Operator* Uint32MulHigh(); | 109 const Operator* Uint32MulHigh(); |
112 bool Int32DivIsSafe() const { return flags_ & kInt32DivIsSafe; } | 110 bool Int32DivIsSafe() const { return flags_ & kInt32DivIsSafe; } |
113 bool Int32ModIsSafe() const { return flags_ & kInt32ModIsSafe; } | |
114 bool Uint32DivIsSafe() const { return flags_ & kUint32DivIsSafe; } | 111 bool Uint32DivIsSafe() const { return flags_ & kUint32DivIsSafe; } |
115 bool Uint32ModIsSafe() const { return flags_ & kUint32ModIsSafe; } | |
116 | 112 |
117 const Operator* Int64Add(); | 113 const Operator* Int64Add(); |
118 const Operator* Int64Sub(); | 114 const Operator* Int64Sub(); |
119 const Operator* Int64Mul(); | 115 const Operator* Int64Mul(); |
120 const Operator* Int64Div(); | 116 const Operator* Int64Div(); |
121 const Operator* Int64Mod(); | 117 const Operator* Int64Mod(); |
122 const Operator* Int64LessThan(); | 118 const Operator* Int64LessThan(); |
123 const Operator* Int64LessThanOrEqual(); | 119 const Operator* Int64LessThanOrEqual(); |
124 const Operator* Uint64Div(); | 120 const Operator* Uint64Div(); |
125 const Operator* Uint64LessThan(); | 121 const Operator* Uint64LessThan(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 DISALLOW_COPY_AND_ASSIGN(MachineOperatorBuilder); | 214 DISALLOW_COPY_AND_ASSIGN(MachineOperatorBuilder); |
219 }; | 215 }; |
220 | 216 |
221 | 217 |
222 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 218 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
223 } // namespace compiler | 219 } // namespace compiler |
224 } // namespace internal | 220 } // namespace internal |
225 } // namespace v8 | 221 } // namespace v8 |
226 | 222 |
227 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 223 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |