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

Side by Side Diff: src/compiler/mips64/code-generator-mips64.cc

Issue 1503053002: MIPS: [turbofan] Make Int32Div and Uint32Div safe. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 #include "src/compiler/code-generator.h" 6 #include "src/compiler/code-generator.h"
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/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 __ Mulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 639 __ Mulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
640 break; 640 break;
641 case kMips64MulHighU: 641 case kMips64MulHighU:
642 __ Mulhu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 642 __ Mulhu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
643 break; 643 break;
644 case kMips64DMulHigh: 644 case kMips64DMulHigh:
645 __ Dmulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 645 __ Dmulh(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
646 break; 646 break;
647 case kMips64Div: 647 case kMips64Div:
648 __ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 648 __ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
649 if (kArchVariant == kMips64r6) {
650 __ seleqz(i.OutputRegister(), i.InputRegister(0), i.InputRegister(0));
651 } else {
652 __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
653 }
649 break; 654 break;
650 case kMips64DivU: 655 case kMips64DivU:
651 __ Divu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 656 __ Divu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
657 if (kArchVariant == kMips64r6) {
658 __ seleqz(i.OutputRegister(), i.InputRegister(0), i.InputRegister(0));
659 } else {
660 __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
661 }
652 break; 662 break;
653 case kMips64Mod: 663 case kMips64Mod:
654 __ Mod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 664 __ Mod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
655 break; 665 break;
656 case kMips64ModU: 666 case kMips64ModU:
657 __ Modu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 667 __ Modu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
658 break; 668 break;
659 case kMips64Dmul: 669 case kMips64Dmul:
660 __ Dmul(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 670 __ Dmul(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
661 break; 671 break;
662 case kMips64Ddiv: 672 case kMips64Ddiv:
663 __ Ddiv(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 673 __ Ddiv(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
674 if (kArchVariant == kMips64r6) {
675 __ seleqz(i.OutputRegister(), i.InputRegister(0), i.InputRegister(0));
676 } else {
677 __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
678 }
664 break; 679 break;
665 case kMips64DdivU: 680 case kMips64DdivU:
666 __ Ddivu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 681 __ Ddivu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
682 if (kArchVariant == kMips64r6) {
683 __ seleqz(i.OutputRegister(), i.InputRegister(0), i.InputRegister(0));
684 } else {
685 __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
686 }
667 break; 687 break;
668 case kMips64Dmod: 688 case kMips64Dmod:
669 __ Dmod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 689 __ Dmod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
670 break; 690 break;
671 case kMips64DmodU: 691 case kMips64DmodU:
672 __ Dmodu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 692 __ Dmodu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
673 break; 693 break;
674 case kMips64And: 694 case kMips64And:
675 __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); 695 __ And(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
676 break; 696 break;
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 padding_size -= v8::internal::Assembler::kInstrSize; 1807 padding_size -= v8::internal::Assembler::kInstrSize;
1788 } 1808 }
1789 } 1809 }
1790 } 1810 }
1791 1811
1792 #undef __ 1812 #undef __
1793 1813
1794 } // namespace compiler 1814 } // namespace compiler
1795 } // namespace internal 1815 } // namespace internal
1796 } // namespace v8 1816 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-selector-mips.cc ('k') | src/compiler/mips64/instruction-selector-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698