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

Side by Side Diff: src/compiler/instruction-selector-impl.h

Issue 447203002: Add Uint32AddWithOverflow and Uint32SubWithOverflow machine operators. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-node-factory.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_INSTRUCTION_SELECTOR_IMPL_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
7 7
8 #include "src/compiler/instruction.h" 8 #include "src/compiler/instruction.h"
9 #include "src/compiler/instruction-selector.h" 9 #include "src/compiler/instruction-selector.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 void Negate() { 263 void Negate() {
264 DCHECK(!IsNone()); 264 DCHECK(!IsNone());
265 condition_ = static_cast<FlagsCondition>(condition_ ^ 1); 265 condition_ = static_cast<FlagsCondition>(condition_ ^ 1);
266 } 266 }
267 267
268 void Commute() { 268 void Commute() {
269 DCHECK(!IsNone()); 269 DCHECK(!IsNone());
270 switch (condition_) { 270 switch (condition_) {
271 case kEqual: 271 case kEqual:
272 case kNotEqual: 272 case kNotEqual:
273 case kOverflow:
274 case kNotOverflow:
275 return; 273 return;
276 case kSignedLessThan: 274 case kSignedLessThan:
277 condition_ = kSignedGreaterThan; 275 condition_ = kSignedGreaterThan;
278 return; 276 return;
279 case kSignedGreaterThanOrEqual: 277 case kSignedGreaterThanOrEqual:
280 condition_ = kSignedLessThanOrEqual; 278 condition_ = kSignedLessThanOrEqual;
281 return; 279 return;
282 case kSignedLessThanOrEqual: 280 case kSignedLessThanOrEqual:
283 condition_ = kSignedGreaterThanOrEqual; 281 condition_ = kSignedGreaterThanOrEqual;
284 return; 282 return;
(...skipping 20 matching lines...) Expand all
305 return; 303 return;
306 case kUnorderedGreaterThanOrEqual: 304 case kUnorderedGreaterThanOrEqual:
307 condition_ = kUnorderedLessThanOrEqual; 305 condition_ = kUnorderedLessThanOrEqual;
308 return; 306 return;
309 case kUnorderedLessThanOrEqual: 307 case kUnorderedLessThanOrEqual:
310 condition_ = kUnorderedGreaterThanOrEqual; 308 condition_ = kUnorderedGreaterThanOrEqual;
311 return; 309 return;
312 case kUnorderedGreaterThan: 310 case kUnorderedGreaterThan:
313 condition_ = kUnorderedLessThan; 311 condition_ = kUnorderedLessThan;
314 return; 312 return;
313 case kOverflow:
314 case kNotOverflow:
315 // We cannot commute these.
316 break;
315 } 317 }
316 UNREACHABLE(); 318 UNREACHABLE();
317 } 319 }
318 320
319 void OverwriteAndNegateIfEqual(FlagsCondition condition) { 321 void OverwriteAndNegateIfEqual(FlagsCondition condition) {
320 bool negate = condition_ == kEqual; 322 bool negate = condition_ == kEqual;
321 condition_ = condition; 323 condition_ = condition;
322 if (negate) Negate(); 324 if (negate) Negate();
323 } 325 }
324 326
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 int control_count() { return descriptor->CanLazilyDeoptimize() ? 2 : 0; } 364 int control_count() { return descriptor->CanLazilyDeoptimize() ? 2 : 0; }
363 365
364 int fixed_and_control_count() { return fixed_count + control_count(); } 366 int fixed_and_control_count() { return fixed_count + control_count(); }
365 }; 367 };
366 368
367 } // namespace compiler 369 } // namespace compiler
368 } // namespace internal 370 } // namespace internal
369 } // namespace v8 371 } // namespace v8
370 372
371 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 373 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-node-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698