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

Side by Side Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2325703002: Subzero, MIPS32: Intrinsic calls for ABS.fmt and SQRT.fmt (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressing comments + O2 test for SQRT ignored Created 4 years, 3 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/IceTargetLoweringMIPS32.h ('k') | tests_lit/llvm2ice_tests/nacl-other-intrinsics-mips.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 llvm_unreachable("Invalid ICmp operator"); 2541 llvm_unreachable("Invalid ICmp operator");
2542 return; 2542 return;
2543 } 2543 }
2544 } 2544 }
2545 2545
2546 void TargetMIPS32::lowerInsertElement(const InstInsertElement *Instr) { 2546 void TargetMIPS32::lowerInsertElement(const InstInsertElement *Instr) {
2547 UnimplementedLoweringError(this, Instr); 2547 UnimplementedLoweringError(this, Instr);
2548 } 2548 }
2549 2549
2550 void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) { 2550 void TargetMIPS32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
2551 Variable *Dest = Instr->getDest();
2552 Type DestTy = (Dest == nullptr) ? IceType_void : Dest->getType();
2551 switch (Instr->getIntrinsicInfo().ID) { 2553 switch (Instr->getIntrinsicInfo().ID) {
2552 case Intrinsics::AtomicCmpxchg: { 2554 case Intrinsics::AtomicCmpxchg: {
2553 UnimplementedLoweringError(this, Instr); 2555 UnimplementedLoweringError(this, Instr);
2554 return; 2556 return;
2555 } 2557 }
2556 case Intrinsics::AtomicFence: 2558 case Intrinsics::AtomicFence:
2557 UnimplementedLoweringError(this, Instr); 2559 UnimplementedLoweringError(this, Instr);
2558 return; 2560 return;
2559 case Intrinsics::AtomicFenceAll: 2561 case Intrinsics::AtomicFenceAll:
2560 // NOTE: FenceAll should prevent and load/store from being moved across the 2562 // NOTE: FenceAll should prevent and load/store from being moved across the
(...skipping 26 matching lines...) Expand all
2587 } 2589 }
2588 case Intrinsics::Ctlz: { 2590 case Intrinsics::Ctlz: {
2589 UnimplementedLoweringError(this, Instr); 2591 UnimplementedLoweringError(this, Instr);
2590 return; 2592 return;
2591 } 2593 }
2592 case Intrinsics::Cttz: { 2594 case Intrinsics::Cttz: {
2593 UnimplementedLoweringError(this, Instr); 2595 UnimplementedLoweringError(this, Instr);
2594 return; 2596 return;
2595 } 2597 }
2596 case Intrinsics::Fabs: { 2598 case Intrinsics::Fabs: {
2597 UnimplementedLoweringError(this, Instr); 2599 if (isScalarFloatingType(DestTy)) {
2600 Variable *T = makeReg(DestTy);
2601 if (DestTy == IceType_f32) {
2602 _abs_s(T, legalizeToReg(Instr->getArg(0)));
2603 } else {
2604 _abs_d(T, legalizeToReg(Instr->getArg(0)));
2605 }
2606 _mov(Dest, T);
2607 }
2598 return; 2608 return;
2599 } 2609 }
2600 case Intrinsics::Longjmp: { 2610 case Intrinsics::Longjmp: {
2601 InstCall *Call = makeHelperCall(RuntimeHelper::H_call_longjmp, nullptr, 2); 2611 InstCall *Call = makeHelperCall(RuntimeHelper::H_call_longjmp, nullptr, 2);
2602 Call->addArg(Instr->getArg(0)); 2612 Call->addArg(Instr->getArg(0));
2603 Call->addArg(Instr->getArg(1)); 2613 Call->addArg(Instr->getArg(1));
2604 lowerCall(Call); 2614 lowerCall(Call);
2605 return; 2615 return;
2606 } 2616 }
2607 case Intrinsics::Memcpy: { 2617 case Intrinsics::Memcpy: {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
2647 return; 2657 return;
2648 } 2658 }
2649 case Intrinsics::Setjmp: { 2659 case Intrinsics::Setjmp: {
2650 InstCall *Call = 2660 InstCall *Call =
2651 makeHelperCall(RuntimeHelper::H_call_setjmp, Instr->getDest(), 1); 2661 makeHelperCall(RuntimeHelper::H_call_setjmp, Instr->getDest(), 1);
2652 Call->addArg(Instr->getArg(0)); 2662 Call->addArg(Instr->getArg(0));
2653 lowerCall(Call); 2663 lowerCall(Call);
2654 return; 2664 return;
2655 } 2665 }
2656 case Intrinsics::Sqrt: { 2666 case Intrinsics::Sqrt: {
2657 UnimplementedLoweringError(this, Instr); 2667 if (isScalarFloatingType(DestTy)) {
2668 Variable *T = makeReg(DestTy);
2669 if (DestTy == IceType_f32) {
2670 _sqrt_s(T, legalizeToReg(Instr->getArg(0)));
2671 } else {
2672 _sqrt_d(T, legalizeToReg(Instr->getArg(0)));
2673 }
2674 _mov(Dest, T);
2675 }
2658 return; 2676 return;
2659 } 2677 }
2660 case Intrinsics::Stacksave: { 2678 case Intrinsics::Stacksave: {
2661 UnimplementedLoweringError(this, Instr); 2679 UnimplementedLoweringError(this, Instr);
2662 return; 2680 return;
2663 } 2681 }
2664 case Intrinsics::Stackrestore: { 2682 case Intrinsics::Stackrestore: {
2665 UnimplementedLoweringError(this, Instr); 2683 UnimplementedLoweringError(this, Instr);
2666 return; 2684 return;
2667 } 2685 }
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3104 Str << "\t.set\t" 3122 Str << "\t.set\t"
3105 << "nomips16\n"; 3123 << "nomips16\n";
3106 } 3124 }
3107 3125
3108 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM]; 3126 SmallBitVector TargetMIPS32::TypeToRegisterSet[RCMIPS32_NUM];
3109 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; 3127 SmallBitVector TargetMIPS32::TypeToRegisterSetUnfiltered[RCMIPS32_NUM];
3110 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM]; 3128 SmallBitVector TargetMIPS32::RegisterAliases[RegMIPS32::Reg_NUM];
3111 3129
3112 } // end of namespace MIPS32 3130 } // end of namespace MIPS32
3113 } // end of namespace Ice 3131 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | tests_lit/llvm2ice_tests/nacl-other-intrinsics-mips.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698