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

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

Issue 677483005: [turbofan] Implement the correct semantics for integer division/modulus. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes and tests Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/base/bits.cc ('k') | src/compiler/machine-operator-reducer.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 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_MACHINE_OPERATOR_REDUCER_H_ 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_
6 #define V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ 6 #define V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_
7 7
8 #include "src/compiler/graph-reducer.h" 8 #include "src/compiler/graph-reducer.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 10
(...skipping 19 matching lines...) Expand all
30 Node* Float32Constant(volatile float value); 30 Node* Float32Constant(volatile float value);
31 Node* Float64Constant(volatile double value); 31 Node* Float64Constant(volatile double value);
32 Node* Int32Constant(int32_t value); 32 Node* Int32Constant(int32_t value);
33 Node* Int64Constant(int64_t value); 33 Node* Int64Constant(int64_t value);
34 Node* Uint32Constant(uint32_t value) { 34 Node* Uint32Constant(uint32_t value) {
35 return Int32Constant(bit_cast<uint32_t>(value)); 35 return Int32Constant(bit_cast<uint32_t>(value));
36 } 36 }
37 Node* Word32And(Node* lhs, uint32_t rhs); 37 Node* Word32And(Node* lhs, uint32_t rhs);
38 Node* Word32Sar(Node* lhs, uint32_t rhs); 38 Node* Word32Sar(Node* lhs, uint32_t rhs);
39 Node* Word32Shr(Node* lhs, uint32_t rhs); 39 Node* Word32Shr(Node* lhs, uint32_t rhs);
40 Node* Word32Equal(Node* lhs, Node* rhs);
40 Node* Int32Add(Node* lhs, Node* rhs); 41 Node* Int32Add(Node* lhs, Node* rhs);
41 Node* Int32Sub(Node* lhs, Node* rhs); 42 Node* Int32Sub(Node* lhs, Node* rhs);
42 Node* Int32Mul(Node* lhs, Node* rhs); 43 Node* Int32Mul(Node* lhs, Node* rhs);
43 44
44 Node* TruncatingDiv(Node* dividend, int32_t divisor); 45 Node* TruncatingDiv(Node* dividend, int32_t divisor);
45 46
46 Reduction ReplaceBool(bool value) { return ReplaceInt32(value ? 1 : 0); } 47 Reduction ReplaceBool(bool value) { return ReplaceInt32(value ? 1 : 0); }
47 Reduction ReplaceFloat32(volatile float value) { 48 Reduction ReplaceFloat32(volatile float value) {
48 return Replace(Float32Constant(value)); 49 return Replace(Float32Constant(value));
49 } 50 }
50 Reduction ReplaceFloat64(volatile double value) { 51 Reduction ReplaceFloat64(volatile double value) {
51 return Replace(Float64Constant(value)); 52 return Replace(Float64Constant(value));
52 } 53 }
53 Reduction ReplaceInt32(int32_t value) { 54 Reduction ReplaceInt32(int32_t value) {
54 return Replace(Int32Constant(value)); 55 return Replace(Int32Constant(value));
55 } 56 }
57 Reduction ReplaceUint32(uint32_t value) {
58 return Replace(Uint32Constant(value));
59 }
56 Reduction ReplaceInt64(int64_t value) { 60 Reduction ReplaceInt64(int64_t value) {
57 return Replace(Int64Constant(value)); 61 return Replace(Int64Constant(value));
58 } 62 }
59 63
60 Reduction ReduceInt32Div(Node* node); 64 Reduction ReduceInt32Div(Node* node);
65 Reduction ReduceUint32Div(Node* node);
61 Reduction ReduceInt32Mod(Node* node); 66 Reduction ReduceInt32Mod(Node* node);
67 Reduction ReduceUint32Mod(Node* node);
62 Reduction ReduceProjection(size_t index, Node* node); 68 Reduction ReduceProjection(size_t index, Node* node);
63 69
64 Graph* graph() const; 70 Graph* graph() const;
65 JSGraph* jsgraph() const { return jsgraph_; } 71 JSGraph* jsgraph() const { return jsgraph_; }
66 CommonOperatorBuilder* common() const; 72 CommonOperatorBuilder* common() const;
67 MachineOperatorBuilder* machine() const; 73 MachineOperatorBuilder* machine() const;
68 74
69 JSGraph* jsgraph_; 75 JSGraph* jsgraph_;
70 }; 76 };
71 77
72 } // namespace compiler 78 } // namespace compiler
73 } // namespace internal 79 } // namespace internal
74 } // namespace v8 80 } // namespace v8
75 81
76 #endif // V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_ 82 #endif // V8_COMPILER_MACHINE_OPERATOR_REDUCER_H_
OLDNEW
« no previous file with comments | « src/base/bits.cc ('k') | src/compiler/machine-operator-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698