| 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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/ia32/assembler-ia32.h" | 10 #include "src/ia32/assembler-ia32.h" |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 break; | 455 break; |
| 456 case kSSEFloat64Sub: | 456 case kSSEFloat64Sub: |
| 457 __ subsd(i.InputDoubleRegister(0), i.InputOperand(1)); | 457 __ subsd(i.InputDoubleRegister(0), i.InputOperand(1)); |
| 458 break; | 458 break; |
| 459 case kSSEFloat64Mul: | 459 case kSSEFloat64Mul: |
| 460 __ mulsd(i.InputDoubleRegister(0), i.InputOperand(1)); | 460 __ mulsd(i.InputDoubleRegister(0), i.InputOperand(1)); |
| 461 break; | 461 break; |
| 462 case kSSEFloat64Div: | 462 case kSSEFloat64Div: |
| 463 __ divsd(i.InputDoubleRegister(0), i.InputOperand(1)); | 463 __ divsd(i.InputDoubleRegister(0), i.InputOperand(1)); |
| 464 break; | 464 break; |
| 465 case kSSEFloat64Max: |
| 466 __ maxsd(i.InputDoubleRegister(0), i.InputOperand(1)); |
| 467 break; |
| 468 case kSSEFloat64Min: |
| 469 __ minsd(i.InputDoubleRegister(0), i.InputOperand(1)); |
| 470 break; |
| 465 case kSSEFloat64Mod: { | 471 case kSSEFloat64Mod: { |
| 466 // TODO(dcarney): alignment is wrong. | 472 // TODO(dcarney): alignment is wrong. |
| 467 __ sub(esp, Immediate(kDoubleSize)); | 473 __ sub(esp, Immediate(kDoubleSize)); |
| 468 // Move values to st(0) and st(1). | 474 // Move values to st(0) and st(1). |
| 469 __ movsd(Operand(esp, 0), i.InputDoubleRegister(1)); | 475 __ movsd(Operand(esp, 0), i.InputDoubleRegister(1)); |
| 470 __ fld_d(Operand(esp, 0)); | 476 __ fld_d(Operand(esp, 0)); |
| 471 __ movsd(Operand(esp, 0), i.InputDoubleRegister(0)); | 477 __ movsd(Operand(esp, 0), i.InputDoubleRegister(0)); |
| 472 __ fld_d(Operand(esp, 0)); | 478 __ fld_d(Operand(esp, 0)); |
| 473 // Loop while fprem isn't done. | 479 // Loop while fprem isn't done. |
| 474 Label mod_loop; | 480 Label mod_loop; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 __ vmulsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), | 566 __ vmulsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), |
| 561 i.InputOperand(1)); | 567 i.InputOperand(1)); |
| 562 break; | 568 break; |
| 563 } | 569 } |
| 564 case kAVXFloat64Div: { | 570 case kAVXFloat64Div: { |
| 565 CpuFeatureScope avx_scope(masm(), AVX); | 571 CpuFeatureScope avx_scope(masm(), AVX); |
| 566 __ vdivsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), | 572 __ vdivsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), |
| 567 i.InputOperand(1)); | 573 i.InputOperand(1)); |
| 568 break; | 574 break; |
| 569 } | 575 } |
| 576 case kAVXFloat64Max: { |
| 577 CpuFeatureScope avx_scope(masm(), AVX); |
| 578 __ vmaxsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), |
| 579 i.InputOperand(1)); |
| 580 break; |
| 581 } |
| 582 case kAVXFloat64Min: { |
| 583 CpuFeatureScope avx_scope(masm(), AVX); |
| 584 __ vminsd(i.OutputDoubleRegister(), i.InputDoubleRegister(0), |
| 585 i.InputOperand(1)); |
| 586 break; |
| 587 } |
| 570 case kIA32Movsxbl: | 588 case kIA32Movsxbl: |
| 571 __ movsx_b(i.OutputRegister(), i.MemoryOperand()); | 589 __ movsx_b(i.OutputRegister(), i.MemoryOperand()); |
| 572 break; | 590 break; |
| 573 case kIA32Movzxbl: | 591 case kIA32Movzxbl: |
| 574 __ movzx_b(i.OutputRegister(), i.MemoryOperand()); | 592 __ movzx_b(i.OutputRegister(), i.MemoryOperand()); |
| 575 break; | 593 break; |
| 576 case kIA32Movb: { | 594 case kIA32Movb: { |
| 577 size_t index = 0; | 595 size_t index = 0; |
| 578 Operand operand = i.MemoryOperand(&index); | 596 Operand operand = i.MemoryOperand(&index); |
| 579 if (HasImmediateInput(instr, index)) { | 597 if (HasImmediateInput(instr, index)) { |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 } | 1327 } |
| 1310 } | 1328 } |
| 1311 MarkLazyDeoptSite(); | 1329 MarkLazyDeoptSite(); |
| 1312 } | 1330 } |
| 1313 | 1331 |
| 1314 #undef __ | 1332 #undef __ |
| 1315 | 1333 |
| 1316 } // namespace compiler | 1334 } // namespace compiler |
| 1317 } // namespace internal | 1335 } // namespace internal |
| 1318 } // namespace v8 | 1336 } // namespace v8 |
| OLD | NEW |