LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/SystemZ - SystemZGenCallingConv.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 114 116 98.3 %
Date: 2017-09-14 15:23:50 Functions: 2 2 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_SystemZ(unsigned ValNo, MVT ValVT,
      10             :                        MVT LocVT, CCValAssign::LocInfo LocInfo,
      11             :                        ISD::ArgFlagsTy ArgFlags, CCState &State);
      12             : static bool RetCC_SystemZ(unsigned ValNo, MVT ValVT,
      13             :                           MVT LocVT, CCValAssign::LocInfo LocInfo,
      14             :                           ISD::ArgFlagsTy ArgFlags, CCState &State);
      15             : 
      16             : 
      17       15725 : static bool CC_SystemZ(unsigned ValNo, MVT ValVT,
      18             :                        MVT LocVT, CCValAssign::LocInfo LocInfo,
      19             :                        ISD::ArgFlagsTy ArgFlags, CCState &State) {
      20             : 
      21       31450 :   if (LocVT == MVT::i32) {
      22        3960 :     if (ArgFlags.isSExt() || ArgFlags.isZExt()) {
      23         110 :       LocVT = MVT::i64;
      24         110 :       if (ArgFlags.isSExt())
      25          50 :             LocInfo = CCValAssign::SExt;
      26          60 :       else if (ArgFlags.isZExt())
      27          60 :             LocInfo = CCValAssign::ZExt;
      28             :       else
      29           0 :             LocInfo = CCValAssign::AExt;
      30             :     }
      31             :   }
      32             : 
      33       15725 :   if (ArgFlags.isSwiftSelf()) {
      34          20 :     if (LocVT == MVT::i64) {
      35          10 :       if (unsigned Reg = State.AllocateReg(SystemZ::R10D)) {
      36          30 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      37          10 :         return false;
      38             :       }
      39             :     }
      40             :   }
      41             : 
      42       15715 :   if (ArgFlags.isSwiftError()) {
      43          36 :     if (LocVT == MVT::i64) {
      44          18 :       if (unsigned Reg = State.AllocateReg(SystemZ::R9D)) {
      45          54 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      46          18 :         return false;
      47             :       }
      48             :     }
      49             :   }
      50             : 
      51       31394 :   if (LocVT == MVT::f128) {
      52          95 :     LocVT = MVT::i64;
      53          95 :     LocInfo = CCValAssign::Indirect;
      54             :   }
      55             : 
      56       31394 :   if (LocVT == MVT::i64) {
      57        6149 :     if (CC_SystemZ_I128Indirect(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
      58             :         return false;
      59             :   }
      60             : 
      61       31274 :   if (LocVT == MVT::i32) {
      62             :     static const MCPhysReg RegList1[] = {
      63             :       SystemZ::R2L, SystemZ::R3L, SystemZ::R4L, SystemZ::R5L, SystemZ::R6L
      64             :     };
      65        1895 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
      66        5607 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      67        1869 :       return false;
      68             :     }
      69             :   }
      70             : 
      71       27536 :   if (LocVT == MVT::i64) {
      72             :     static const MCPhysReg RegList2[] = {
      73             :       SystemZ::R2D, SystemZ::R3D, SystemZ::R4D, SystemZ::R5D, SystemZ::R6D
      74             :     };
      75        6089 :     if (unsigned Reg = State.AllocateReg(RegList2)) {
      76       17841 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      77        5947 :       return false;
      78             :     }
      79             :   }
      80             : 
      81       15642 :   if (LocVT == MVT::f32) {
      82             :     static const MCPhysReg RegList3[] = {
      83             :       SystemZ::F0S, SystemZ::F2S, SystemZ::F4S, SystemZ::F6S
      84             :     };
      85         646 :     if (unsigned Reg = State.AllocateReg(RegList3)) {
      86        1875 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      87         625 :       return false;
      88             :     }
      89             :   }
      90             : 
      91       14392 :   if (LocVT == MVT::f64) {
      92             :     static const MCPhysReg RegList4[] = {
      93             :       SystemZ::F0D, SystemZ::F2D, SystemZ::F4D, SystemZ::F6D
      94             :     };
      95        1282 :     if (unsigned Reg = State.AllocateReg(RegList4)) {
      96        3792 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      97        1264 :       return false;
      98             :     }
      99             :   }
     100             : 
     101        5932 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     102       16322 :     if (LocVT == MVT::v16i8 ||
     103        8832 :         LocVT == MVT::v8i16 ||
     104        6873 :         LocVT == MVT::v4i32 ||
     105        4556 :         LocVT == MVT::v2i64 ||
     106        8314 :         LocVT == MVT::v4f32 ||
     107         934 :         LocVT == MVT::v2f64) {
     108       11450 :       if (static_cast<SystemZCCState *>(&State)->IsFixed(ValNo)) {
     109             :         static const MCPhysReg RegList5[] = {
     110             :           SystemZ::V24, SystemZ::V26, SystemZ::V28, SystemZ::V30, SystemZ::V25, SystemZ::V27, SystemZ::V29, SystemZ::V31
     111             :         };
     112        5717 :         if (unsigned Reg = State.AllocateReg(RegList5)) {
     113       13761 :           State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     114        4587 :           return false;
     115             :         }
     116             :       }
     117             :     }
     118             :   }
     119             : 
     120        1345 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     121        3376 :     if (LocVT == MVT::v16i8 ||
     122        2140 :         LocVT == MVT::v8i16 ||
     123        1920 :         LocVT == MVT::v4i32 ||
     124        1300 :         LocVT == MVT::v2i64 ||
     125        1928 :         LocVT == MVT::v4f32 ||
     126         358 :         LocVT == MVT::v2f64) {
     127        2276 :       if (static_cast<SystemZCCState *>(&State)->IsShortVector(ValNo)) {
     128          24 :         LocVT = MVT::i64;
     129          24 :         LocInfo = CCValAssign::BCvt;
     130             :       }
     131             :     }
     132             :   }
     133             : 
     134        1345 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     135        3400 :     if (LocVT == MVT::v16i8 ||
     136        2188 :         LocVT == MVT::v8i16 ||
     137        1968 :         LocVT == MVT::v4i32 ||
     138        1348 :         LocVT == MVT::v2i64 ||
     139        1976 :         LocVT == MVT::v4f32 ||
     140         382 :         LocVT == MVT::v2f64) {
     141        1114 :       unsigned Offset6 = State.AllocateStack(16, 8);
     142        3342 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
     143        1114 :       return false;
     144             :     }
     145             :   }
     146             : 
     147         667 :   if (LocVT == MVT::i32 ||
     148         244 :       LocVT == MVT::i64 ||
     149         288 :       LocVT == MVT::f32 ||
     150          18 :       LocVT == MVT::f64) {
     151         231 :     unsigned Offset7 = State.AllocateStack(8, 8);
     152         693 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset7, LocVT, LocInfo));
     153         231 :     return false;
     154             :   }
     155             : 
     156             :   return true;  // CC didn't match.
     157             : }
     158             : 
     159             : 
     160       11357 : static bool RetCC_SystemZ(unsigned ValNo, MVT ValVT,
     161             :                           MVT LocVT, CCValAssign::LocInfo LocInfo,
     162             :                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
     163             : 
     164       11357 :   if (LocVT == MVT::i32) {
     165        5374 :     if (ArgFlags.isSExt() || ArgFlags.isZExt()) {
     166          58 :       LocVT = MVT::i64;
     167          58 :       if (ArgFlags.isSExt())
     168             :             LocInfo = CCValAssign::SExt;
     169           8 :       else if (ArgFlags.isZExt())
     170             :             LocInfo = CCValAssign::ZExt;
     171             :       else
     172           0 :             LocInfo = CCValAssign::AExt;
     173             :     }
     174             :   }
     175             : 
     176       11357 :   if (ArgFlags.isSwiftError()) {
     177          20 :     if (LocVT == MVT::i64) {
     178          20 :       if (unsigned Reg = State.AllocateReg(SystemZ::R9D)) {
     179          40 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     180          20 :         return false;
     181             :       }
     182             :     }
     183             :   }
     184             : 
     185       11337 :   if (LocVT == MVT::i32) {
     186             :     static const MCPhysReg RegList1[] = {
     187             :       SystemZ::R2L, SystemZ::R3L, SystemZ::R4L, SystemZ::R5L
     188             :     };
     189        2654 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
     190        5300 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     191        2650 :       return false;
     192             :     }
     193             :   }
     194             : 
     195        8687 :   if (LocVT == MVT::i64) {
     196             :     static const MCPhysReg RegList2[] = {
     197             :       SystemZ::R2D, SystemZ::R3D, SystemZ::R4D, SystemZ::R5D
     198             :     };
     199        2416 :     if (unsigned Reg = State.AllocateReg(RegList2)) {
     200        4828 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     201        2414 :       return false;
     202             :     }
     203             :   }
     204             : 
     205        6273 :   if (LocVT == MVT::f32) {
     206             :     static const MCPhysReg RegList3[] = {
     207             :       SystemZ::F0S, SystemZ::F2S, SystemZ::F4S, SystemZ::F6S
     208             :     };
     209         654 :     if (unsigned Reg = State.AllocateReg(RegList3)) {
     210        1308 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     211         654 :       return false;
     212             :     }
     213             :   }
     214             : 
     215        5619 :   if (LocVT == MVT::f64) {
     216             :     static const MCPhysReg RegList4[] = {
     217             :       SystemZ::F0D, SystemZ::F2D, SystemZ::F4D, SystemZ::F6D
     218             :     };
     219        1468 :     if (unsigned Reg = State.AllocateReg(RegList4)) {
     220        2932 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     221        1466 :       return false;
     222             :     }
     223             :   }
     224             : 
     225        4153 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     226        7458 :     if (LocVT == MVT::v16i8 ||
     227        6022 :         LocVT == MVT::v8i16 ||
     228        4540 :         LocVT == MVT::v4i32 ||
     229        2822 :         LocVT == MVT::v2i64 ||
     230        5646 :         LocVT == MVT::v4f32 ||
     231         572 :         LocVT == MVT::v2f64) {
     232             :       static const MCPhysReg RegList5[] = {
     233             :         SystemZ::V24, SystemZ::V26, SystemZ::V28, SystemZ::V30, SystemZ::V25, SystemZ::V27, SystemZ::V29, SystemZ::V31
     234             :       };
     235        4112 :       if (unsigned Reg = State.AllocateReg(RegList5)) {
     236        8220 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     237        4110 :         return false;
     238             :       }
     239             :     }
     240             :   }
     241             : 
     242             :   return true;  // CC didn't match.
     243             : }

Generated by: LCOV version 1.13