| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // for operations that are unsupported by some back-ends. | 110 // for operations that are unsupported by some back-ends. |
| 111 enum Flag { | 111 enum Flag { |
| 112 kNoFlags = 0u, | 112 kNoFlags = 0u, |
| 113 // Note that Float*Max behaves like `(b < a) ? a : b`, not like Math.max(). | 113 // Note that Float*Max behaves like `(b < a) ? a : b`, not like Math.max(). |
| 114 // Note that Float*Min behaves like `(a < b) ? a : b`, not like Math.min(). | 114 // Note that Float*Min behaves like `(a < b) ? a : b`, not like Math.min(). |
| 115 kFloat32Max = 1u << 0, | 115 kFloat32Max = 1u << 0, |
| 116 kFloat32Min = 1u << 1, | 116 kFloat32Min = 1u << 1, |
| 117 kFloat64Max = 1u << 2, | 117 kFloat64Max = 1u << 2, |
| 118 kFloat64Min = 1u << 3, | 118 kFloat64Min = 1u << 3, |
| 119 kFloat64RoundDown = 1u << 4, | 119 kFloat64RoundDown = 1u << 4, |
| 120 kFloat64RoundTruncate = 1u << 5, | 120 kFloat64RoundUp = 1u << 5, |
| 121 kFloat64RoundTiesAway = 1u << 6, | 121 kFloat64RoundTruncate = 1u << 6, |
| 122 kInt32DivIsSafe = 1u << 7, | 122 kFloat64RoundTiesAway = 1u << 7, |
| 123 kUint32DivIsSafe = 1u << 8, | 123 kInt32DivIsSafe = 1u << 8, |
| 124 kWord32ShiftIsSafe = 1u << 9, | 124 kUint32DivIsSafe = 1u << 9, |
| 125 kWord32Ctz = 1u << 10, | 125 kWord32ShiftIsSafe = 1u << 10, |
| 126 kWord32Popcnt = 1u << 11, | 126 kWord32Ctz = 1u << 11, |
| 127 kWord64Ctz = 1u << 12, | 127 kWord64Ctz = 1u << 12, |
| 128 kWord64Popcnt = 1u << 13, | 128 kWord32Popcnt = 1u << 13, |
| 129 kWord64Popcnt = 1u << 14, |
| 129 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | | 130 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | |
| 130 kFloat64RoundDown | kFloat64RoundTruncate | | 131 kFloat64RoundDown | kFloat64RoundUp | |
| 131 kFloat64RoundTiesAway | kWord32Ctz | kWord32Popcnt | | 132 kFloat64RoundTruncate | kFloat64RoundTiesAway | |
| 132 kWord64Ctz | kWord64Popcnt | 133 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt |
| 133 }; | 134 }; |
| 134 typedef base::Flags<Flag, unsigned> Flags; | 135 typedef base::Flags<Flag, unsigned> Flags; |
| 135 | 136 |
| 136 explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr, | 137 explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr, |
| 137 Flags supportedOperators = kNoFlags); | 138 Flags supportedOperators = kNoFlags); |
| 138 | 139 |
| 139 const Operator* Word32And(); | 140 const Operator* Word32And(); |
| 140 const Operator* Word32Or(); | 141 const Operator* Word32Or(); |
| 141 const Operator* Word32Xor(); | 142 const Operator* Word32Xor(); |
| 142 const Operator* Word32Shl(); | 143 const Operator* Word32Shl(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 const OptionalOperator Float64Min(); | 257 const OptionalOperator Float64Min(); |
| 257 | 258 |
| 258 // Floating point abs complying to IEEE 754 (single-precision). | 259 // Floating point abs complying to IEEE 754 (single-precision). |
| 259 const Operator* Float32Abs(); | 260 const Operator* Float32Abs(); |
| 260 | 261 |
| 261 // Floating point abs complying to IEEE 754 (double-precision). | 262 // Floating point abs complying to IEEE 754 (double-precision). |
| 262 const Operator* Float64Abs(); | 263 const Operator* Float64Abs(); |
| 263 | 264 |
| 264 // Floating point rounding. | 265 // Floating point rounding. |
| 265 const OptionalOperator Float64RoundDown(); | 266 const OptionalOperator Float64RoundDown(); |
| 267 const OptionalOperator Float64RoundUp(); |
| 266 const OptionalOperator Float64RoundTruncate(); | 268 const OptionalOperator Float64RoundTruncate(); |
| 267 const OptionalOperator Float64RoundTiesAway(); | 269 const OptionalOperator Float64RoundTiesAway(); |
| 268 | 270 |
| 269 // Floating point bit representation. | 271 // Floating point bit representation. |
| 270 const Operator* Float64ExtractLowWord32(); | 272 const Operator* Float64ExtractLowWord32(); |
| 271 const Operator* Float64ExtractHighWord32(); | 273 const Operator* Float64ExtractHighWord32(); |
| 272 const Operator* Float64InsertLowWord32(); | 274 const Operator* Float64InsertLowWord32(); |
| 273 const Operator* Float64InsertHighWord32(); | 275 const Operator* Float64InsertHighWord32(); |
| 274 | 276 |
| 275 // load [base + index] | 277 // load [base + index] |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 }; | 332 }; |
| 331 | 333 |
| 332 | 334 |
| 333 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 335 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
| 334 | 336 |
| 335 } // namespace compiler | 337 } // namespace compiler |
| 336 } // namespace internal | 338 } // namespace internal |
| 337 } // namespace v8 | 339 } // namespace v8 |
| 338 | 340 |
| 339 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 341 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
| OLD | NEW |