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

Side by Side Diff: src/compiler/machine-operator.h

Issue 2785773002: [turbofan] introduce Int32/64AbsWithOverflow optional operator (Closed)
Patch Set: add base impl Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/base/flags.h" 9 #include "src/base/flags.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 kUint32DivIsSafe = 1u << 10, 124 kUint32DivIsSafe = 1u << 10,
125 kWord32ShiftIsSafe = 1u << 11, 125 kWord32ShiftIsSafe = 1u << 11,
126 kWord32Ctz = 1u << 12, 126 kWord32Ctz = 1u << 12,
127 kWord64Ctz = 1u << 13, 127 kWord64Ctz = 1u << 13,
128 kWord32Popcnt = 1u << 14, 128 kWord32Popcnt = 1u << 14,
129 kWord64Popcnt = 1u << 15, 129 kWord64Popcnt = 1u << 15,
130 kWord32ReverseBits = 1u << 16, 130 kWord32ReverseBits = 1u << 16,
131 kWord64ReverseBits = 1u << 17, 131 kWord64ReverseBits = 1u << 17,
132 kWord32ReverseBytes = 1u << 18, 132 kWord32ReverseBytes = 1u << 18,
133 kWord64ReverseBytes = 1u << 19, 133 kWord64ReverseBytes = 1u << 19,
134 kAllOptionalOps = kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | 134 kInt32AbsWithOverflow = 1u << 20,
135 kFloat64RoundUp | kFloat32RoundTruncate | 135 kInt64AbsWithOverflow = 1u << 21,
136 kFloat64RoundTruncate | kFloat64RoundTiesAway | 136 kAllOptionalOps =
137 kFloat32RoundTiesEven | kFloat64RoundTiesEven | 137 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp |
138 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | 138 kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate |
139 kWord32ReverseBits | kWord64ReverseBits | 139 kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven |
140 kWord32ReverseBytes | kWord64ReverseBytes 140 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt |
141 kWord32ReverseBits | kWord64ReverseBits | kWord32ReverseBytes |
142 kWord64ReverseBytes | kInt32AbsWithOverflow | kInt64AbsWithOverflow
141 }; 143 };
142 typedef base::Flags<Flag, unsigned> Flags; 144 typedef base::Flags<Flag, unsigned> Flags;
143 145
144 class AlignmentRequirements { 146 class AlignmentRequirements {
145 public: 147 public:
146 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport }; 148 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport };
147 149
148 bool IsUnalignedLoadSupported(const MachineType& machineType, 150 bool IsUnalignedLoadSupported(const MachineType& machineType,
149 uint8_t alignment) const { 151 uint8_t alignment) const {
150 return IsUnalignedSupported(unalignedLoadUnsupportedTypes_, machineType, 152 return IsUnalignedSupported(unalignedLoadUnsupportedTypes_, machineType,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 const Operator* Word32Ror(); 225 const Operator* Word32Ror();
224 const Operator* Word32Equal(); 226 const Operator* Word32Equal();
225 const Operator* Word32Clz(); 227 const Operator* Word32Clz();
226 const OptionalOperator Word32Ctz(); 228 const OptionalOperator Word32Ctz();
227 const OptionalOperator Word32Popcnt(); 229 const OptionalOperator Word32Popcnt();
228 const OptionalOperator Word64Popcnt(); 230 const OptionalOperator Word64Popcnt();
229 const OptionalOperator Word32ReverseBits(); 231 const OptionalOperator Word32ReverseBits();
230 const OptionalOperator Word64ReverseBits(); 232 const OptionalOperator Word64ReverseBits();
231 const OptionalOperator Word32ReverseBytes(); 233 const OptionalOperator Word32ReverseBytes();
232 const OptionalOperator Word64ReverseBytes(); 234 const OptionalOperator Word64ReverseBytes();
235 const OptionalOperator Int32AbsWithOverflow();
236 const OptionalOperator Int64AbsWithOverflow();
233 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; } 237 bool Word32ShiftIsSafe() const { return flags_ & kWord32ShiftIsSafe; }
234 238
235 const Operator* Word64And(); 239 const Operator* Word64And();
236 const Operator* Word64Or(); 240 const Operator* Word64Or();
237 const Operator* Word64Xor(); 241 const Operator* Word64Xor();
238 const Operator* Word64Shl(); 242 const Operator* Word64Shl();
239 const Operator* Word64Shr(); 243 const Operator* Word64Shr();
240 const Operator* Word64Sar(); 244 const Operator* Word64Sar();
241 const Operator* Word64Ror(); 245 const Operator* Word64Ror();
242 const Operator* Word64Clz(); 246 const Operator* Word64Clz();
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 }; 678 };
675 679
676 680
677 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 681 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
678 682
679 } // namespace compiler 683 } // namespace compiler
680 } // namespace internal 684 } // namespace internal
681 } // namespace v8 685 } // namespace v8
682 686
683 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 687 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698