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

Side by Side Diff: src/compiler/opcodes.cc

Issue 1433353006: [machine-operator-reducer] fix float truncation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: arm64: do not merge 64bit shr/sar with 32bit op Created 5 years, 1 month 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
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 #include "src/compiler/opcodes.h" 5 #include "src/compiler/opcodes.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "src/base/macros.h" 10 #include "src/base/macros.h"
(...skipping 17 matching lines...) Expand all
28 char const* IrOpcode::Mnemonic(Value value) { 28 char const* IrOpcode::Mnemonic(Value value) {
29 size_t const n = std::min<size_t>(value, arraysize(kMnemonics) - 1); 29 size_t const n = std::min<size_t>(value, arraysize(kMnemonics) - 1);
30 return kMnemonics[n]; 30 return kMnemonics[n];
31 } 31 }
32 32
33 33
34 std::ostream& operator<<(std::ostream& os, IrOpcode::Value opcode) { 34 std::ostream& operator<<(std::ostream& os, IrOpcode::Value opcode) {
35 return os << IrOpcode::Mnemonic(opcode); 35 return os << IrOpcode::Mnemonic(opcode);
36 } 36 }
37 37
38
39 // static
40 bool IrOpcode::Is64(Value value) {
titzer 2015/11/13 23:35:17 What are the semantics of this predicate? It's not
fedor.indutny 2015/11/14 00:15:52 This method returns true if the opcode output is a
41 switch (value) {
42 case kInt64Constant:
43 case kFloat64Constant:
44 case kChangeTaggedToFloat64:
45 case kWord64Equal:
46 case kInt64LessThan:
47 case kInt64LessThanOrEqual:
48 case kUint64LessThan:
49 case kUint64LessThanOrEqual:
50 case kFloat64Equal:
51 case kFloat64LessThan:
52 case kFloat64LessThanOrEqual:
53 case kChangeFloat32ToFloat64:
54 case kChangeInt32ToFloat64:
55 case kChangeInt32ToInt64:
56 case kChangeUint32ToFloat64:
57 case kChangeUint32ToUint64:
58 case kRoundInt64ToFloat64:
59 case kRoundUint64ToFloat64:
60 case kBitcastFloat64ToInt64:
61 case kBitcastInt64ToFloat64:
62 return true;
63
64 default:
65 return (value >= kWord64Popcnt && value <= kWord64Ctz) ||
66 (value >= kInt64Add && value <= kUint64Mod) ||
67 (value >= kFloat64Add && value <= kFloat64InsertHighWord32);
68 }
69 }
70
38 } // namespace compiler 71 } // namespace compiler
39 } // namespace internal 72 } // namespace internal
40 } // namespace v8 73 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698