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/compiler/machine-type.h" | 8 #include "src/compiler/machine-type.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 const Operator* Word64Sar(); | 80 const Operator* Word64Sar(); |
81 const Operator* Word64Ror(); | 81 const Operator* Word64Ror(); |
82 const Operator* Word64Equal(); | 82 const Operator* Word64Equal(); |
83 | 83 |
84 const Operator* Int32Add(); | 84 const Operator* Int32Add(); |
85 const Operator* Int32AddWithOverflow(); | 85 const Operator* Int32AddWithOverflow(); |
86 const Operator* Int32Sub(); | 86 const Operator* Int32Sub(); |
87 const Operator* Int32SubWithOverflow(); | 87 const Operator* Int32SubWithOverflow(); |
88 const Operator* Int32Mul(); | 88 const Operator* Int32Mul(); |
89 const Operator* Int32Div(); | 89 const Operator* Int32Div(); |
90 const Operator* Int32UDiv(); | |
91 const Operator* Int32Mod(); | 90 const Operator* Int32Mod(); |
92 const Operator* Int32UMod(); | |
93 const Operator* Int32LessThan(); | 91 const Operator* Int32LessThan(); |
94 const Operator* Int32LessThanOrEqual(); | 92 const Operator* Int32LessThanOrEqual(); |
| 93 const Operator* Uint32Div(); |
95 const Operator* Uint32LessThan(); | 94 const Operator* Uint32LessThan(); |
96 const Operator* Uint32LessThanOrEqual(); | 95 const Operator* Uint32LessThanOrEqual(); |
| 96 const Operator* Uint32Mod(); |
97 | 97 |
98 const Operator* Int64Add(); | 98 const Operator* Int64Add(); |
99 const Operator* Int64Sub(); | 99 const Operator* Int64Sub(); |
100 const Operator* Int64Mul(); | 100 const Operator* Int64Mul(); |
101 const Operator* Int64Div(); | 101 const Operator* Int64Div(); |
102 const Operator* Int64UDiv(); | |
103 const Operator* Int64Mod(); | 102 const Operator* Int64Mod(); |
104 const Operator* Int64UMod(); | |
105 const Operator* Int64LessThan(); | 103 const Operator* Int64LessThan(); |
106 const Operator* Int64LessThanOrEqual(); | 104 const Operator* Int64LessThanOrEqual(); |
| 105 const Operator* Uint64Div(); |
107 const Operator* Uint64LessThan(); | 106 const Operator* Uint64LessThan(); |
| 107 const Operator* Uint64Mod(); |
108 | 108 |
109 // These operators change the representation of numbers while preserving the | 109 // These operators change the representation of numbers while preserving the |
110 // value of the number. Narrowing operators assume the input is representable | 110 // value of the number. Narrowing operators assume the input is representable |
111 // in the target type and are *not* defined for other inputs. | 111 // in the target type and are *not* defined for other inputs. |
112 // Use narrowing change operators only when there is a static guarantee that | 112 // Use narrowing change operators only when there is a static guarantee that |
113 // the input value is representable in the target value. | 113 // the input value is representable in the target value. |
114 const Operator* ChangeFloat32ToFloat64(); | 114 const Operator* ChangeFloat32ToFloat64(); |
115 const Operator* ChangeFloat64ToInt32(); // narrowing | 115 const Operator* ChangeFloat64ToInt32(); // narrowing |
116 const Operator* ChangeFloat64ToUint32(); // narrowing | 116 const Operator* ChangeFloat64ToUint32(); // narrowing |
117 const Operator* ChangeInt32ToFloat64(); | 117 const Operator* ChangeInt32ToFloat64(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 V(Word, Xor) \ | 157 V(Word, Xor) \ |
158 V(Word, Shl) \ | 158 V(Word, Shl) \ |
159 V(Word, Shr) \ | 159 V(Word, Shr) \ |
160 V(Word, Sar) \ | 160 V(Word, Sar) \ |
161 V(Word, Ror) \ | 161 V(Word, Ror) \ |
162 V(Word, Equal) \ | 162 V(Word, Equal) \ |
163 V(Int, Add) \ | 163 V(Int, Add) \ |
164 V(Int, Sub) \ | 164 V(Int, Sub) \ |
165 V(Int, Mul) \ | 165 V(Int, Mul) \ |
166 V(Int, Div) \ | 166 V(Int, Div) \ |
167 V(Int, UDiv) \ | |
168 V(Int, Mod) \ | 167 V(Int, Mod) \ |
169 V(Int, UMod) \ | |
170 V(Int, LessThan) \ | 168 V(Int, LessThan) \ |
171 V(Int, LessThanOrEqual) \ | 169 V(Int, LessThanOrEqual) \ |
172 V(Uint, LessThan) | 170 V(Uint, Div) \ |
| 171 V(Uint, LessThan) \ |
| 172 V(Uint, Mod) |
173 #define PSEUDO_OP(Prefix, Suffix) \ | 173 #define PSEUDO_OP(Prefix, Suffix) \ |
174 const Operator* Prefix##Suffix() { \ | 174 const Operator* Prefix##Suffix() { \ |
175 return Is32() ? Prefix##32##Suffix() : Prefix##64##Suffix(); \ | 175 return Is32() ? Prefix##32##Suffix() : Prefix##64##Suffix(); \ |
176 } | 176 } |
177 PSEUDO_OP_LIST(PSEUDO_OP) | 177 PSEUDO_OP_LIST(PSEUDO_OP) |
178 #undef PSEUDO_OP | 178 #undef PSEUDO_OP |
179 #undef PSEUDO_OP_LIST | 179 #undef PSEUDO_OP_LIST |
180 | 180 |
181 private: | 181 private: |
182 const MachineOperatorBuilderImpl& impl_; | 182 const MachineOperatorBuilderImpl& impl_; |
183 const MachineType word_; | 183 const MachineType word_; |
184 }; | 184 }; |
185 | 185 |
186 } // namespace compiler | 186 } // namespace compiler |
187 } // namespace internal | 187 } // namespace internal |
188 } // namespace v8 | 188 } // namespace v8 |
189 | 189 |
190 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ | 190 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ |
OLD | NEW |