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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 // Interface for building machine-level operators. These operators are | 99 // Interface for building machine-level operators. These operators are |
100 // machine-level but machine-independent and thus define a language suitable | 100 // machine-level but machine-independent and thus define a language suitable |
101 // for generating code to run on architectures such as ia32, x64, arm, etc. | 101 // for generating code to run on architectures such as ia32, x64, arm, etc. |
102 class MachineOperatorBuilder final : public ZoneObject { | 102 class MachineOperatorBuilder final : public ZoneObject { |
103 public: | 103 public: |
104 // Flags that specify which operations are available. This is useful | 104 // Flags that specify which operations are available. This is useful |
105 // for operations that are unsupported by some back-ends. | 105 // for operations that are unsupported by some back-ends. |
106 enum Flag { | 106 enum Flag { |
107 kNoFlags = 0u, | 107 kNoFlags = 0u, |
108 // Note that Float*Max behaves like `(a < b) ? b : a`, not like Math.max(). | 108 // Note that Float*Max behaves like `(b < a) ? a : b`, not like Math.max(). |
109 // Note that Float*Min behaves like `(a < b) ? a : b`, not like Math.min(). | 109 // Note that Float*Min behaves like `(a < b) ? a : b`, not like Math.min(). |
110 kFloat32Max = 1u << 0, | 110 kFloat32Max = 1u << 0, |
111 kFloat32Min = 1u << 1, | 111 kFloat32Min = 1u << 1, |
112 kFloat64Max = 1u << 2, | 112 kFloat64Max = 1u << 2, |
113 kFloat64Min = 1u << 3, | 113 kFloat64Min = 1u << 3, |
114 kFloat64RoundDown = 1u << 4, | 114 kFloat64RoundDown = 1u << 4, |
115 kFloat64RoundTruncate = 1u << 5, | 115 kFloat64RoundTruncate = 1u << 5, |
116 kFloat64RoundTiesAway = 1u << 6, | 116 kFloat64RoundTiesAway = 1u << 6, |
117 kInt32DivIsSafe = 1u << 7, | 117 kInt32DivIsSafe = 1u << 7, |
118 kUint32DivIsSafe = 1u << 8, | 118 kUint32DivIsSafe = 1u << 8, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 }; | 316 }; |
317 | 317 |
318 | 318 |
319 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 319 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
320 | 320 |
321 } // namespace compiler | 321 } // namespace compiler |
322 } // namespace internal | 322 } // namespace internal |
323 } // namespace v8 | 323 } // namespace v8 |
324 | 324 |
325 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 325 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |