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

Side by Side Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2364143002: Subzero, MIPS32: lowerSelect for i64 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 2 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
OLDNEW
1 // 1 //
2 // The Subzero Code Generator 2 // The Subzero Code Generator
3 // 3 //
4 // This file is distributed under the University of Illinois Open Source 4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details. 5 // License. See LICENSE.TXT for details.
6 // 6 //
7 //===----------------------------------------------------------------------===// 7 //===----------------------------------------------------------------------===//
8 /// 8 ///
9 /// \file 9 /// \file
10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost 10 /// \brief Implements the TargetLoweringMIPS32 class, which consists almost
(...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after
3260 UnimplementedLoweringError(this, Instr); 3260 UnimplementedLoweringError(this, Instr);
3261 } 3261 }
3262 } 3262 }
3263 _ret(getPhysicalRegister(RegMIPS32::Reg_RA), Reg); 3263 _ret(getPhysicalRegister(RegMIPS32::Reg_RA), Reg);
3264 } 3264 }
3265 3265
3266 void TargetMIPS32::lowerSelect(const InstSelect *Instr) { 3266 void TargetMIPS32::lowerSelect(const InstSelect *Instr) {
3267 Variable *Dest = Instr->getDest(); 3267 Variable *Dest = Instr->getDest();
3268 const Type DestTy = Dest->getType(); 3268 const Type DestTy = Dest->getType();
3269 3269
3270 if (DestTy == IceType_i64 || isVectorType(DestTy)) { 3270 if (isVectorType(DestTy)) {
3271 UnimplementedLoweringError(this, Instr); 3271 UnimplementedLoweringError(this, Instr);
3272 return; 3272 return;
3273 } 3273 }
3274 3274
3275 Variable *DestR = legalizeToReg(Dest); 3275 Variable *DestR = nullptr;
3276 Variable *SrcTR = legalizeToReg(Instr->getTrueOperand()); 3276 Variable *DestHiR = nullptr;
3277 Variable *SrcFR = legalizeToReg(Instr->getFalseOperand()); 3277 Variable *SrcTR = nullptr;
3278 Variable *SrcTHiR = nullptr;
3279 Variable *SrcFR = nullptr;
3280 Variable *SrcFHiR = nullptr;
3281
3282 if (DestTy == IceType_i64) {
3283 DestR = llvm::cast<Variable>(loOperand(Dest));
3284 DestHiR = llvm::cast<Variable>(hiOperand(Dest));
3285 SrcTR = legalizeToReg(loOperand(Instr->getTrueOperand()));
3286 SrcTHiR = legalizeToReg(hiOperand(Instr->getTrueOperand()));
3287 SrcFR = legalizeToReg(loOperand(Instr->getFalseOperand()));
3288 SrcFHiR = legalizeToReg(hiOperand(Instr->getFalseOperand()));
3289 } else {
3290 DestR = legalizeToReg(Dest);
3291 SrcTR = legalizeToReg(Instr->getTrueOperand());
3292 SrcFR = legalizeToReg(Instr->getFalseOperand());
3293 }
3278 3294
3279 Variable *ConditionR = legalizeToReg(Instr->getCondition()); 3295 Variable *ConditionR = legalizeToReg(Instr->getCondition());
3280 3296
3281 assert(Instr->getCondition()->getType() == IceType_i1); 3297 assert(Instr->getCondition()->getType() == IceType_i1);
3282 3298
3283 switch (DestTy) { 3299 switch (DestTy) {
3284 case IceType_i1: 3300 case IceType_i1:
3285 case IceType_i8: 3301 case IceType_i8:
3286 case IceType_i16: 3302 case IceType_i16:
3287 case IceType_i32: 3303 case IceType_i32:
3288 _movn(SrcFR, SrcTR, ConditionR); 3304 _movn(SrcFR, SrcTR, ConditionR);
3289 _mov(DestR, SrcFR); 3305 _mov(DestR, SrcFR);
3290 _mov(Dest, DestR); 3306 _mov(Dest, DestR);
3291 break; 3307 break;
3308 case IceType_i64:
3309 _movn(SrcFR, SrcTR, ConditionR);
3310 _movn(SrcFHiR, SrcTHiR, ConditionR);
3311 _mov(DestR, SrcFR);
3312 _mov(DestHiR, SrcFHiR);
3313 break;
3292 case IceType_f32: 3314 case IceType_f32:
3293 _movn_s(SrcFR, SrcTR, ConditionR); 3315 _movn_s(SrcFR, SrcTR, ConditionR);
3294 _mov(DestR, SrcFR); 3316 _mov(DestR, SrcFR);
3295 _mov(Dest, DestR); 3317 _mov(Dest, DestR);
3296 break; 3318 break;
3297 case IceType_f64: 3319 case IceType_f64:
3298 _movn_d(SrcFR, SrcTR, ConditionR); 3320 _movn_d(SrcFR, SrcTR, ConditionR);
3299 _mov(DestR, SrcFR); 3321 _mov(DestR, SrcFR);
3300 _mov(Dest, DestR); 3322 _mov(Dest, DestR);
3301 break; 3323 break;
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
3786 Str << "\t.set\t" 3808 Str << "\t.set\t"
3787 << "nomips16\n"; 3809 << "nomips16\n";
3788 } 3810 }
3789 3811
3790 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; 3812 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM];
3791 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; 3813 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM];
3792 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; 3814 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM];
3793 3815
3794 } // end of namespace MIPS32 3816 } // end of namespace MIPS32
3795 } // end of namespace Ice 3817 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/64bit.pnacl.ll » ('j') | tests_lit/llvm2ice_tests/select-opt.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698