LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/Sparc - SparcGenCallingConv.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 45 48 93.8 %
Date: 2017-09-14 15:23:50 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
       2             : |*                                                                            *|
       3             : |* Calling Convention Implementation Fragment                                 *|
       4             : |*                                                                            *|
       5             : |* Automatically generated file, do not edit!                                 *|
       6             : |*                                                                            *|
       7             : \*===----------------------------------------------------------------------===*/
       8             : 
       9             : static bool CC_Sparc32(unsigned ValNo, MVT ValVT,
      10             :                        MVT LocVT, CCValAssign::LocInfo LocInfo,
      11             :                        ISD::ArgFlagsTy ArgFlags, CCState &State);
      12             : static bool CC_Sparc64(unsigned ValNo, MVT ValVT,
      13             :                        MVT LocVT, CCValAssign::LocInfo LocInfo,
      14             :                        ISD::ArgFlagsTy ArgFlags, CCState &State);
      15             : static bool RetCC_Sparc32(unsigned ValNo, MVT ValVT,
      16             :                           MVT LocVT, CCValAssign::LocInfo LocInfo,
      17             :                           ISD::ArgFlagsTy ArgFlags, CCState &State);
      18             : static bool RetCC_Sparc64(unsigned ValNo, MVT ValVT,
      19             :                           MVT LocVT, CCValAssign::LocInfo LocInfo,
      20             :                           ISD::ArgFlagsTy ArgFlags, CCState &State);
      21             : 
      22             : 
      23        1342 : static bool CC_Sparc32(unsigned ValNo, MVT ValVT,
      24             :                        MVT LocVT, CCValAssign::LocInfo LocInfo,
      25             :                        ISD::ArgFlagsTy ArgFlags, CCState &State) {
      26             : 
      27        1342 :   if (ArgFlags.isSRet()) {
      28          55 :     if (CC_Sparc_Assign_SRet(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
      29             :         return false;
      30             :   }
      31             : 
      32        2695 :   if (LocVT == MVT::i32 ||
      33         121 :       LocVT == MVT::f32) {
      34             :     static const MCPhysReg RegList1[] = {
      35             :       SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
      36             :     };
      37        1222 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
      38        3345 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      39        1115 :       return false;
      40             :     }
      41             :   }
      42             : 
      43         344 :   if (LocVT == MVT::f64) {
      44          65 :     if (CC_Sparc_Assign_Split_64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
      45             :         return false;
      46             :   }
      47             : 
      48         214 :   if (LocVT == MVT::v2i32) {
      49           0 :     if (CC_Sparc_Assign_Split_64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
      50             :         return false;
      51             :   }
      52             : 
      53         107 :   unsigned Offset2 = State.AllocateStack(4, 4);
      54         321 :   State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
      55         107 :   return false;
      56             : 
      57             :   return true;  // CC didn't match.
      58             : }
      59             : 
      60             : 
      61         959 : static bool CC_Sparc64(unsigned ValNo, MVT ValVT,
      62             :                        MVT LocVT, CCValAssign::LocInfo LocInfo,
      63             :                        ISD::ArgFlagsTy ArgFlags, CCState &State) {
      64             : 
      65         959 :   if (ArgFlags.isInReg()) {
      66         102 :     if (LocVT == MVT::i32 ||
      67           8 :         LocVT == MVT::f32) {
      68          47 :       if (CC_Sparc64_Half(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
      69             :             return false;
      70             :     }
      71             :   }
      72             : 
      73        1824 :   if (LocVT == MVT::i32) {
      74         295 :     LocVT = MVT::i64;
      75         295 :     if (ArgFlags.isSExt())
      76          16 :         LocInfo = CCValAssign::SExt;
      77         279 :     else if (ArgFlags.isZExt())
      78          41 :         LocInfo = CCValAssign::ZExt;
      79             :     else
      80         238 :         LocInfo = CCValAssign::AExt;
      81             :   }
      82             : 
      83         912 :   if (CC_Sparc64_Full(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
      84             :     return false;
      85             : 
      86           0 :   return true;  // CC didn't match.
      87             : }
      88             : 
      89             : 
      90         513 : static bool RetCC_Sparc32(unsigned ValNo, MVT ValVT,
      91             :                           MVT LocVT, CCValAssign::LocInfo LocInfo,
      92             :                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
      93             : 
      94        1026 :   if (LocVT == MVT::i32) {
      95             :     static const MCPhysReg RegList1[] = {
      96             :       SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5
      97             :     };
      98             :     if (unsigned Reg = State.AllocateReg(RegList1)) {
      99        1254 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     100         418 :       return false;
     101             :     }
     102             :   }
     103             : 
     104         190 :   if (LocVT == MVT::f32) {
     105             :     static const MCPhysReg RegList2[] = {
     106             :       SP::F0, SP::F1, SP::F2, SP::F3
     107             :     };
     108          28 :     if (unsigned Reg = State.AllocateReg(RegList2)) {
     109          84 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     110          28 :       return false;
     111             :     }
     112             :   }
     113             : 
     114         134 :   if (LocVT == MVT::f64) {
     115             :     static const MCPhysReg RegList3[] = {
     116             :       SP::D0, SP::D1
     117             :     };
     118          60 :     if (unsigned Reg = State.AllocateReg(RegList3)) {
     119         180 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     120          60 :       return false;
     121             :     }
     122             :   }
     123             : 
     124          14 :   if (LocVT == MVT::v2i32) {
     125           7 :     if (CC_Sparc_Assign_Ret_Split_64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     126             :         return false;
     127             :   }
     128             : 
     129             :   return true;  // CC didn't match.
     130             : }
     131             : 
     132             : 
     133         280 : static bool RetCC_Sparc64(unsigned ValNo, MVT ValVT,
     134             :                           MVT LocVT, CCValAssign::LocInfo LocInfo,
     135             :                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
     136             : 
     137         560 :   if (LocVT == MVT::f32) {
     138          16 :     if (CC_Sparc64_Half(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     139             :         return false;
     140             :   }
     141             : 
     142         264 :   if (!CC_Sparc64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     143             :     return false;
     144             : 
     145           0 :   return true;  // CC didn't match.
     146             : }

Generated by: LCOV version 1.13