| 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/machine-type.h" | 9 #include "src/machine-type.h" |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 kUint32DivIsSafe = 1u << 14, | 108 kUint32DivIsSafe = 1u << 14, |
| 109 kWord32ShiftIsSafe = 1u << 15, | 109 kWord32ShiftIsSafe = 1u << 15, |
| 110 kWord32Ctz = 1u << 16, | 110 kWord32Ctz = 1u << 16, |
| 111 kWord64Ctz = 1u << 17, | 111 kWord64Ctz = 1u << 17, |
| 112 kWord32Popcnt = 1u << 18, | 112 kWord32Popcnt = 1u << 18, |
| 113 kWord64Popcnt = 1u << 19, | 113 kWord64Popcnt = 1u << 19, |
| 114 kWord32ReverseBits = 1u << 20, | 114 kWord32ReverseBits = 1u << 20, |
| 115 kWord64ReverseBits = 1u << 21, | 115 kWord64ReverseBits = 1u << 21, |
| 116 kFloat32Neg = 1u << 22, | 116 kFloat32Neg = 1u << 22, |
| 117 kFloat64Neg = 1u << 23, | 117 kFloat64Neg = 1u << 23, |
| 118 kWord16ReverseBytes = 1u << 24, |
| 119 kWord32ReverseBytes = 1u << 25, |
| 120 kWord64ReverseBytes = 1u << 26, |
| 118 kAllOptionalOps = | 121 kAllOptionalOps = |
| 119 kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | | 122 kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | |
| 120 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | | 123 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | |
| 121 kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate | | 124 kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate | |
| 122 kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven | | 125 kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven | |
| 123 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | | 126 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | |
| 124 kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg | kFloat64Neg | 127 kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg | kFloat64Neg | |
| 128 kWord16ReverseBytes | kWord32ReverseBytes | kWord64ReverseBytes |
| 125 }; | 129 }; |
| 126 typedef base::Flags<Flag, unsigned> Flags; | 130 typedef base::Flags<Flag, unsigned> Flags; |
| 127 | 131 |
| 128 class AlignmentRequirements { | 132 class AlignmentRequirements { |
| 129 public: | 133 public: |
| 130 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport }; | 134 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport }; |
| 131 | 135 |
| 132 bool IsUnalignedLoadSupported(const MachineType& machineType, | 136 bool IsUnalignedLoadSupported(const MachineType& machineType, |
| 133 uint8_t alignment) const { | 137 uint8_t alignment) const { |
| 134 return IsUnalignedSupported(unalignedLoadSupportedTypes_, machineType, | 138 return IsUnalignedSupported(unalignedLoadSupportedTypes_, machineType, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 const Operator* Word32Sar(); | 208 const Operator* Word32Sar(); |
| 205 const Operator* Word32Ror(); | 209 const Operator* Word32Ror(); |
| 206 const Operator* Word32Equal(); | 210 const Operator* Word32Equal(); |
| 207 const Operator* Word32Clz(); | 211 const Operator* Word32Clz(); |
| 208 const OptionalOperator Word32Ctz(); | 212 const OptionalOperator Word32Ctz(); |
| 209 const OptionalOperator Word32Popcnt(); | 213 const OptionalOperator Word32Popcnt(); |
| 210 const OptionalOperator Word64Popcnt(); | 214 const OptionalOperator Word64Popcnt(); |
| 211 const Operator* Word64PopcntPlaceholder(); | 215 const Operator* Word64PopcntPlaceholder(); |
| 212 const OptionalOperator Word32ReverseBits(); | 216 const OptionalOperator Word32ReverseBits(); |
| 213 const OptionalOperator Word64ReverseBits(); | 217 const OptionalOperator Word64ReverseBits(); |
| 218 const OptionalOperator Word16ReverseBytes(); |
| 219 const OptionalOperator Word32ReverseBytes(); |
| 220 const OptionalOperator Word64ReverseBytes(); |
| 214 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; } | 221 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; } |
| 215 | 222 |
| 216 const Operator* Word64And(); | 223 const Operator* Word64And(); |
| 217 const Operator* Word64Or(); | 224 const Operator* Word64Or(); |
| 218 const Operator* Word64Xor(); | 225 const Operator* Word64Xor(); |
| 219 const Operator* Word64Shl(); | 226 const Operator* Word64Shl(); |
| 220 const Operator* Word64Shr(); | 227 const Operator* Word64Shr(); |
| 221 const Operator* Word64Sar(); | 228 const Operator* Word64Sar(); |
| 222 const Operator* Word64Ror(); | 229 const Operator* Word64Ror(); |
| 223 const Operator* Word64Clz(); | 230 const Operator* Word64Clz(); |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 }; | 647 }; |
| 641 | 648 |
| 642 | 649 |
| 643 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) | 650 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) |
| 644 | 651 |
| 645 } // namespace compiler | 652 } // namespace compiler |
| 646 } // namespace internal | 653 } // namespace internal |
| 647 } // namespace v8 | 654 } // namespace v8 |
| 648 | 655 |
| 649 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 656 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
| OLD | NEW |