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

Side by Side Diff: src/IceTargetLoweringMIPS32.h

Issue 2619943003: [SubZero] Fix code generation issues occurred in Cross-test and PNaCL smoke-tests (Closed)
Patch Set: Addressed review comments Created 3 years, 11 months 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
« no previous file with comments | « src/IcePhiLoweringImpl.h ('k') | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===// 1 //===- subzero/src/IceTargetLoweringMIPS32.h - MIPS32 lowering ---*- C++-*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 Instr->setDestRedefined(); 385 Instr->setDestRedefined();
386 if (Instr->getDestHi() != nullptr) { 386 if (Instr->getDestHi() != nullptr) {
387 // If Instr is multi-dest, then Dest must be a Variable64On32. We add a 387 // If Instr is multi-dest, then Dest must be a Variable64On32. We add a
388 // fake-def for Instr.DestHi here. 388 // fake-def for Instr.DestHi here.
389 assert(llvm::isa<Variable64On32>(Dest)); 389 assert(llvm::isa<Variable64On32>(Dest));
390 Context.insert<InstFakeDef>(Instr->getDestHi()); 390 Context.insert<InstFakeDef>(Instr->getDestHi());
391 } 391 }
392 } 392 }
393 } 393 }
394 394
395 void _mov_fp64_to_i64(Variable *Dest, Operand *Src, Int64Part Int64HiLo) {
396 assert(Dest != nullptr);
397 Context.insert<InstMIPS32MovFP64ToI64>(Dest, Src, Int64HiLo);
398 }
399
395 void _mov_d(Variable *Dest, Variable *Src) { 400 void _mov_d(Variable *Dest, Variable *Src) {
396 Context.insert<InstMIPS32Mov_d>(Dest, Src); 401 Context.insert<InstMIPS32Mov_d>(Dest, Src);
397 } 402 }
398 403
399 void _mov_s(Variable *Dest, Variable *Src) { 404 void _mov_s(Variable *Dest, Variable *Src) {
400 Context.insert<InstMIPS32Mov_s>(Dest, Src); 405 Context.insert<InstMIPS32Mov_s>(Dest, Src);
401 } 406 }
402 407
403 void _movf(Variable *Dest, Variable *Src0, Operand *FCC) { 408 void _movf(Variable *Dest, Variable *Src0, Operand *FCC) {
404 Context.insert<InstMIPS32Movf>(Dest, Src0, FCC)->setDestRedefined(); 409 Context.insert<InstMIPS32Movf>(Dest, Src0, FCC)->setDestRedefined();
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 Operand *legalize(Operand *From, LegalMask Allowed = Legal_Default, 657 Operand *legalize(Operand *From, LegalMask Allowed = Legal_Default,
653 RegNumT RegNum = RegNumT()); 658 RegNumT RegNum = RegNumT());
654 659
655 Variable *legalizeToVar(Operand *From, RegNumT RegNum = RegNumT()); 660 Variable *legalizeToVar(Operand *From, RegNumT RegNum = RegNumT());
656 661
657 Variable *legalizeToReg(Operand *From, RegNumT RegNum = RegNumT()); 662 Variable *legalizeToReg(Operand *From, RegNumT RegNum = RegNumT());
658 663
659 Variable *makeReg(Type Ty, RegNumT RegNum = RegNumT()); 664 Variable *makeReg(Type Ty, RegNumT RegNum = RegNumT());
660 665
661 Variable *getZero() { 666 Variable *getZero() {
662 return getPhysicalRegister(RegMIPS32::Reg_ZERO, IceType_i32); 667 auto *Zero = makeReg(IceType_i32, RegMIPS32::Reg_ZERO);
668 Context.insert<InstFakeDef>(Zero);
669 return Zero;
663 } 670 }
664 671
665 Variable *I32Reg(RegNumT RegNum = RegNumT()) { 672 Variable *I32Reg(RegNumT RegNum = RegNumT()) {
666 return makeReg(IceType_i32, RegNum); 673 return makeReg(IceType_i32, RegNum);
667 } 674 }
668 675
669 Variable *F32Reg(RegNumT RegNum = RegNumT()) { 676 Variable *F32Reg(RegNumT RegNum = RegNumT()) {
670 return makeReg(IceType_f32, RegNum); 677 return makeReg(IceType_f32, RegNum);
671 } 678 }
672 679
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 809
803 /// Legalizes Immediate if larger value overflows range of 16 bits 810 /// Legalizes Immediate if larger value overflows range of 16 bits
804 Variable *legalizeImmediate(int32_t Imm); 811 Variable *legalizeImmediate(int32_t Imm);
805 812
806 /// Legalizes Mov if its Source (or Destination) is a spilled Variable, or 813 /// Legalizes Mov if its Source (or Destination) is a spilled Variable, or
807 /// if its Source is a Rematerializable variable (this form is used in lieu 814 /// if its Source is a Rematerializable variable (this form is used in lieu
808 /// of lea, which is not available in MIPS.) 815 /// of lea, which is not available in MIPS.)
809 /// 816 ///
810 /// Moves to memory become store instructions, and moves from memory, loads. 817 /// Moves to memory become store instructions, and moves from memory, loads.
811 void legalizeMov(InstMIPS32Mov *Mov); 818 void legalizeMov(InstMIPS32Mov *Mov);
819 void legalizeMovFp(InstMIPS32MovFP64ToI64 *MovInstr);
812 820
813 private: 821 private:
814 /// Creates a new Base register centered around [Base, +/- Offset]. 822 /// Creates a new Base register centered around [Base, +/- Offset].
815 Variable *newBaseRegister(Variable *Base, int32_t Offset, 823 Variable *newBaseRegister(Variable *Base, int32_t Offset,
816 RegNumT ScratchRegNum); 824 RegNumT ScratchRegNum);
817 825
818 TargetMIPS32 *const Target; 826 TargetMIPS32 *const Target;
819 Variable *const StackOrFrameReg; 827 Variable *const StackOrFrameReg;
820 }; 828 };
821 829
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 uint32_t Flags1 = AFL_FLAGS1_ODDSPREG; 1054 uint32_t Flags1 = AFL_FLAGS1_ODDSPREG;
1047 uint32_t Flags2 = AFL_FLAGS2_NONE; 1055 uint32_t Flags2 = AFL_FLAGS2_NONE;
1048 1056
1049 MipsABIFlagsSection() = default; 1057 MipsABIFlagsSection() = default;
1050 }; 1058 };
1051 1059
1052 } // end of namespace MIPS32 1060 } // end of namespace MIPS32
1053 } // end of namespace Ice 1061 } // end of namespace Ice
1054 1062
1055 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H 1063 #endif // SUBZERO_SRC_ICETARGETLOWERINGMIPS32_H
OLDNEW
« no previous file with comments | « src/IcePhiLoweringImpl.h ('k') | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698