OLD | NEW |
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_RAW_MACHINE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 Node* WordSar(Node* a, Node* b) { | 143 Node* WordSar(Node* a, Node* b) { |
144 return AddNode(machine()->WordSar(), a, b); | 144 return AddNode(machine()->WordSar(), a, b); |
145 } | 145 } |
146 Node* WordRor(Node* a, Node* b) { | 146 Node* WordRor(Node* a, Node* b) { |
147 return AddNode(machine()->WordRor(), a, b); | 147 return AddNode(machine()->WordRor(), a, b); |
148 } | 148 } |
149 Node* WordEqual(Node* a, Node* b) { | 149 Node* WordEqual(Node* a, Node* b) { |
150 return AddNode(machine()->WordEqual(), a, b); | 150 return AddNode(machine()->WordEqual(), a, b); |
151 } | 151 } |
152 Node* WordNotEqual(Node* a, Node* b) { | 152 Node* WordNotEqual(Node* a, Node* b) { |
153 return WordBinaryNot(WordEqual(a, b)); | 153 return Word32BinaryNot(WordEqual(a, b)); |
154 } | 154 } |
155 Node* WordNot(Node* a) { | 155 Node* WordNot(Node* a) { |
156 if (machine()->Is32()) { | 156 if (machine()->Is32()) { |
157 return Word32Not(a); | 157 return Word32Not(a); |
158 } else { | 158 } else { |
159 return Word64Not(a); | 159 return Word64Not(a); |
160 } | 160 } |
161 } | 161 } |
162 Node* WordBinaryNot(Node* a) { | |
163 if (machine()->Is32()) { | |
164 return Word32BinaryNot(a); | |
165 } else { | |
166 return Word64BinaryNot(a); | |
167 } | |
168 } | |
169 | 162 |
170 Node* Word32And(Node* a, Node* b) { | 163 Node* Word32And(Node* a, Node* b) { |
171 return AddNode(machine()->Word32And(), a, b); | 164 return AddNode(machine()->Word32And(), a, b); |
172 } | 165 } |
173 Node* Word32Or(Node* a, Node* b) { | 166 Node* Word32Or(Node* a, Node* b) { |
174 return AddNode(machine()->Word32Or(), a, b); | 167 return AddNode(machine()->Word32Or(), a, b); |
175 } | 168 } |
176 Node* Word32Xor(Node* a, Node* b) { | 169 Node* Word32Xor(Node* a, Node* b) { |
177 return AddNode(machine()->Word32Xor(), a, b); | 170 return AddNode(machine()->Word32Xor(), a, b); |
178 } | 171 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 return AddNode(machine()->Word64Sar(), a, b); | 210 return AddNode(machine()->Word64Sar(), a, b); |
218 } | 211 } |
219 Node* Word64Ror(Node* a, Node* b) { | 212 Node* Word64Ror(Node* a, Node* b) { |
220 return AddNode(machine()->Word64Ror(), a, b); | 213 return AddNode(machine()->Word64Ror(), a, b); |
221 } | 214 } |
222 Node* Word64Clz(Node* a) { return AddNode(machine()->Word64Clz(), a); } | 215 Node* Word64Clz(Node* a) { return AddNode(machine()->Word64Clz(), a); } |
223 Node* Word64Equal(Node* a, Node* b) { | 216 Node* Word64Equal(Node* a, Node* b) { |
224 return AddNode(machine()->Word64Equal(), a, b); | 217 return AddNode(machine()->Word64Equal(), a, b); |
225 } | 218 } |
226 Node* Word64NotEqual(Node* a, Node* b) { | 219 Node* Word64NotEqual(Node* a, Node* b) { |
227 return Word64BinaryNot(Word64Equal(a, b)); | 220 return Word32BinaryNot(Word64Equal(a, b)); |
228 } | 221 } |
229 Node* Word64Not(Node* a) { return Word64Xor(a, Int64Constant(-1)); } | 222 Node* Word64Not(Node* a) { return Word64Xor(a, Int64Constant(-1)); } |
230 Node* Word64BinaryNot(Node* a) { return Word64Equal(a, Int64Constant(0)); } | |
231 | 223 |
232 Node* Int32Add(Node* a, Node* b) { | 224 Node* Int32Add(Node* a, Node* b) { |
233 return AddNode(machine()->Int32Add(), a, b); | 225 return AddNode(machine()->Int32Add(), a, b); |
234 } | 226 } |
235 Node* Int32AddWithOverflow(Node* a, Node* b) { | 227 Node* Int32AddWithOverflow(Node* a, Node* b) { |
236 return AddNode(machine()->Int32AddWithOverflow(), a, b); | 228 return AddNode(machine()->Int32AddWithOverflow(), a, b); |
237 } | 229 } |
238 Node* Int32Sub(Node* a, Node* b) { | 230 Node* Int32Sub(Node* a, Node* b) { |
239 return AddNode(machine()->Int32Sub(), a, b); | 231 return AddNode(machine()->Int32Sub(), a, b); |
240 } | 232 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 372 } |
381 Node* Float32Min(Node* a, Node* b) { | 373 Node* Float32Min(Node* a, Node* b) { |
382 return AddNode(machine()->Float32Min().op(), a, b); | 374 return AddNode(machine()->Float32Min().op(), a, b); |
383 } | 375 } |
384 Node* Float32Abs(Node* a) { return AddNode(machine()->Float32Abs(), a); } | 376 Node* Float32Abs(Node* a) { return AddNode(machine()->Float32Abs(), a); } |
385 Node* Float32Sqrt(Node* a) { return AddNode(machine()->Float32Sqrt(), a); } | 377 Node* Float32Sqrt(Node* a) { return AddNode(machine()->Float32Sqrt(), a); } |
386 Node* Float32Equal(Node* a, Node* b) { | 378 Node* Float32Equal(Node* a, Node* b) { |
387 return AddNode(machine()->Float32Equal(), a, b); | 379 return AddNode(machine()->Float32Equal(), a, b); |
388 } | 380 } |
389 Node* Float32NotEqual(Node* a, Node* b) { | 381 Node* Float32NotEqual(Node* a, Node* b) { |
390 return WordBinaryNot(Float32Equal(a, b)); | 382 return Word32BinaryNot(Float32Equal(a, b)); |
391 } | 383 } |
392 Node* Float32LessThan(Node* a, Node* b) { | 384 Node* Float32LessThan(Node* a, Node* b) { |
393 return AddNode(machine()->Float32LessThan(), a, b); | 385 return AddNode(machine()->Float32LessThan(), a, b); |
394 } | 386 } |
395 Node* Float32LessThanOrEqual(Node* a, Node* b) { | 387 Node* Float32LessThanOrEqual(Node* a, Node* b) { |
396 return AddNode(machine()->Float32LessThanOrEqual(), a, b); | 388 return AddNode(machine()->Float32LessThanOrEqual(), a, b); |
397 } | 389 } |
398 Node* Float32GreaterThan(Node* a, Node* b) { return Float32LessThan(b, a); } | 390 Node* Float32GreaterThan(Node* a, Node* b) { return Float32LessThan(b, a); } |
399 Node* Float32GreaterThanOrEqual(Node* a, Node* b) { | 391 Node* Float32GreaterThanOrEqual(Node* a, Node* b) { |
400 return Float32LessThanOrEqual(b, a); | 392 return Float32LessThanOrEqual(b, a); |
(...skipping 19 matching lines...) Expand all Loading... |
420 } | 412 } |
421 Node* Float64Min(Node* a, Node* b) { | 413 Node* Float64Min(Node* a, Node* b) { |
422 return AddNode(machine()->Float64Min().op(), a, b); | 414 return AddNode(machine()->Float64Min().op(), a, b); |
423 } | 415 } |
424 Node* Float64Abs(Node* a) { return AddNode(machine()->Float64Abs(), a); } | 416 Node* Float64Abs(Node* a) { return AddNode(machine()->Float64Abs(), a); } |
425 Node* Float64Sqrt(Node* a) { return AddNode(machine()->Float64Sqrt(), a); } | 417 Node* Float64Sqrt(Node* a) { return AddNode(machine()->Float64Sqrt(), a); } |
426 Node* Float64Equal(Node* a, Node* b) { | 418 Node* Float64Equal(Node* a, Node* b) { |
427 return AddNode(machine()->Float64Equal(), a, b); | 419 return AddNode(machine()->Float64Equal(), a, b); |
428 } | 420 } |
429 Node* Float64NotEqual(Node* a, Node* b) { | 421 Node* Float64NotEqual(Node* a, Node* b) { |
430 return WordBinaryNot(Float64Equal(a, b)); | 422 return Word32BinaryNot(Float64Equal(a, b)); |
431 } | 423 } |
432 Node* Float64LessThan(Node* a, Node* b) { | 424 Node* Float64LessThan(Node* a, Node* b) { |
433 return AddNode(machine()->Float64LessThan(), a, b); | 425 return AddNode(machine()->Float64LessThan(), a, b); |
434 } | 426 } |
435 Node* Float64LessThanOrEqual(Node* a, Node* b) { | 427 Node* Float64LessThanOrEqual(Node* a, Node* b) { |
436 return AddNode(machine()->Float64LessThanOrEqual(), a, b); | 428 return AddNode(machine()->Float64LessThanOrEqual(), a, b); |
437 } | 429 } |
438 Node* Float64GreaterThan(Node* a, Node* b) { return Float64LessThan(b, a); } | 430 Node* Float64GreaterThan(Node* a, Node* b) { return Float64LessThan(b, a); } |
439 Node* Float64GreaterThanOrEqual(Node* a, Node* b) { | 431 Node* Float64GreaterThanOrEqual(Node* a, Node* b) { |
440 return Float64LessThanOrEqual(b, a); | 432 return Float64LessThanOrEqual(b, a); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 bool bound_; | 714 bool bound_; |
723 friend class RawMachineAssembler; | 715 friend class RawMachineAssembler; |
724 DISALLOW_COPY_AND_ASSIGN(RawMachineLabel); | 716 DISALLOW_COPY_AND_ASSIGN(RawMachineLabel); |
725 }; | 717 }; |
726 | 718 |
727 } // namespace compiler | 719 } // namespace compiler |
728 } // namespace internal | 720 } // namespace internal |
729 } // namespace v8 | 721 } // namespace v8 |
730 | 722 |
731 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 723 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
OLD | NEW |