| OLD | NEW |
| 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 3427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3438 UnimplementedLoweringError(this, Instr); | 3438 UnimplementedLoweringError(this, Instr); |
| 3439 } | 3439 } |
| 3440 } | 3440 } |
| 3441 _ret(getPhysicalRegister(RegMIPS32::Reg_RA), Reg); | 3441 _ret(getPhysicalRegister(RegMIPS32::Reg_RA), Reg); |
| 3442 } | 3442 } |
| 3443 | 3443 |
| 3444 void TargetMIPS32::lowerSelect(const InstSelect *Instr) { | 3444 void TargetMIPS32::lowerSelect(const InstSelect *Instr) { |
| 3445 Variable *Dest = Instr->getDest(); | 3445 Variable *Dest = Instr->getDest(); |
| 3446 const Type DestTy = Dest->getType(); | 3446 const Type DestTy = Dest->getType(); |
| 3447 | 3447 |
| 3448 if (DestTy == IceType_i64 || isVectorType(DestTy)) { | 3448 if (isVectorType(DestTy)) { |
| 3449 UnimplementedLoweringError(this, Instr); | 3449 UnimplementedLoweringError(this, Instr); |
| 3450 return; | 3450 return; |
| 3451 } | 3451 } |
| 3452 | 3452 |
| 3453 Variable *DestR = legalizeToReg(Dest); | 3453 Variable *DestR = nullptr; |
| 3454 Variable *SrcTR = legalizeToReg(Instr->getTrueOperand()); | 3454 Variable *DestHiR = nullptr; |
| 3455 Variable *SrcFR = legalizeToReg(Instr->getFalseOperand()); | 3455 Variable *SrcTR = nullptr; |
| 3456 Variable *SrcTHiR = nullptr; |
| 3457 Variable *SrcFR = nullptr; |
| 3458 Variable *SrcFHiR = nullptr; |
| 3459 |
| 3460 if (DestTy == IceType_i64) { |
| 3461 DestR = llvm::cast<Variable>(loOperand(Dest)); |
| 3462 DestHiR = llvm::cast<Variable>(hiOperand(Dest)); |
| 3463 SrcTR = legalizeToReg(loOperand(Instr->getTrueOperand())); |
| 3464 SrcTHiR = legalizeToReg(hiOperand(Instr->getTrueOperand())); |
| 3465 SrcFR = legalizeToReg(loOperand(Instr->getFalseOperand())); |
| 3466 SrcFHiR = legalizeToReg(hiOperand(Instr->getFalseOperand())); |
| 3467 } else { |
| 3468 SrcTR = legalizeToReg(Instr->getTrueOperand()); |
| 3469 SrcFR = legalizeToReg(Instr->getFalseOperand()); |
| 3470 } |
| 3456 | 3471 |
| 3457 Variable *ConditionR = legalizeToReg(Instr->getCondition()); | 3472 Variable *ConditionR = legalizeToReg(Instr->getCondition()); |
| 3458 | 3473 |
| 3459 assert(Instr->getCondition()->getType() == IceType_i1); | 3474 assert(Instr->getCondition()->getType() == IceType_i1); |
| 3460 | 3475 |
| 3461 switch (DestTy) { | 3476 switch (DestTy) { |
| 3462 case IceType_i1: | 3477 case IceType_i1: |
| 3463 case IceType_i8: | 3478 case IceType_i8: |
| 3464 case IceType_i16: | 3479 case IceType_i16: |
| 3465 case IceType_i32: | 3480 case IceType_i32: |
| 3466 _movn(SrcFR, SrcTR, ConditionR); | 3481 _movn(SrcFR, SrcTR, ConditionR); |
| 3482 _mov(Dest, SrcFR); |
| 3483 break; |
| 3484 case IceType_i64: |
| 3485 _movn(SrcFR, SrcTR, ConditionR); |
| 3486 _movn(SrcFHiR, SrcTHiR, ConditionR); |
| 3467 _mov(DestR, SrcFR); | 3487 _mov(DestR, SrcFR); |
| 3468 _mov(Dest, DestR); | 3488 _mov(DestHiR, SrcFHiR); |
| 3469 break; | 3489 break; |
| 3470 case IceType_f32: | 3490 case IceType_f32: |
| 3471 _movn_s(SrcFR, SrcTR, ConditionR); | 3491 _movn_s(SrcFR, SrcTR, ConditionR); |
| 3472 _mov(DestR, SrcFR); | 3492 _mov(Dest, SrcFR); |
| 3473 _mov(Dest, DestR); | |
| 3474 break; | 3493 break; |
| 3475 case IceType_f64: | 3494 case IceType_f64: |
| 3476 _movn_d(SrcFR, SrcTR, ConditionR); | 3495 _movn_d(SrcFR, SrcTR, ConditionR); |
| 3477 _mov(DestR, SrcFR); | 3496 _mov(Dest, SrcFR); |
| 3478 _mov(Dest, DestR); | |
| 3479 break; | 3497 break; |
| 3480 default: | 3498 default: |
| 3481 UnimplementedLoweringError(this, Instr); | 3499 UnimplementedLoweringError(this, Instr); |
| 3482 } | 3500 } |
| 3483 } | 3501 } |
| 3484 | 3502 |
| 3485 void TargetMIPS32::lowerShuffleVector(const InstShuffleVector *Instr) { | 3503 void TargetMIPS32::lowerShuffleVector(const InstShuffleVector *Instr) { |
| 3486 UnimplementedLoweringError(this, Instr); | 3504 UnimplementedLoweringError(this, Instr); |
| 3487 } | 3505 } |
| 3488 | 3506 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3962 Str << "\t.set\t" | 3980 Str << "\t.set\t" |
| 3963 << "nomips16\n"; | 3981 << "nomips16\n"; |
| 3964 } | 3982 } |
| 3965 | 3983 |
| 3966 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; | 3984 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; |
| 3967 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; | 3985 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; |
| 3968 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; | 3986 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; |
| 3969 | 3987 |
| 3970 } // end of namespace MIPS32 | 3988 } // end of namespace MIPS32 |
| 3971 } // end of namespace Ice | 3989 } // end of namespace Ice |
| OLD | NEW |