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: 105 106 99.1 %
Date: 2018-07-13 00:08:38 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       15037 : static bool CC_SystemZ(unsigned ValNo, MVT ValVT,
      18             :                        MVT LocVT, CCValAssign::LocInfo LocInfo,
      19             :                        ISD::ArgFlagsTy ArgFlags, CCState &State) {
      20             : 
      21       15037 :   if (LocVT == MVT::i32) {
      22        4850 :     if (ArgFlags.isSExt() || ArgFlags.isZExt()) {
      23         116 :       LocVT = MVT::i64;
      24         116 :       if (ArgFlags.isSExt())
      25          58 :             LocInfo = CCValAssign::SExt;
      26          58 :       else if (ArgFlags.isZExt())
      27          58 :             LocInfo = CCValAssign::ZExt;
      28             :       else
      29           0 :             LocInfo = CCValAssign::AExt;
      30             :     }
      31             :   }
      32             : 
      33       15037 :   if (ArgFlags.isSwiftSelf()) {
      34          10 :     if (LocVT == MVT::i64) {
      35             :       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       15027 :   if (ArgFlags.isSwiftError()) {
      43          18 :     if (LocVT == MVT::i64) {
      44             :       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       15009 :   if (LocVT == MVT::f128) {
      52          95 :     LocVT = MVT::i64;
      53          95 :     LocInfo = CCValAssign::Indirect;
      54             :   }
      55             : 
      56       15009 :   if (LocVT == MVT::i64) {
      57        7406 :     if (CC_SystemZ_I128Indirect(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
      58             :         return false;
      59             :   }
      60             : 
      61       14937 :   if (LocVT == MVT::i32) {
      62             :     static const MCPhysReg RegList1[] = {
      63             :       SystemZ::R2L, SystemZ::R3L, SystemZ::R4L, SystemZ::R5L, SystemZ::R6L
      64             :     };
      65        2338 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
      66        6936 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      67        2312 :       return false;
      68             :     }
      69             :   }
      70             : 
      71       12625 :   if (LocVT == MVT::i64) {
      72             :     static const MCPhysReg RegList2[] = {
      73             :       SystemZ::R2D, SystemZ::R3D, SystemZ::R4D, SystemZ::R5D, SystemZ::R6D
      74             :     };
      75        7334 :     if (unsigned Reg = State.AllocateReg(RegList2)) {
      76       21447 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      77        7149 :       return false;
      78             :     }
      79             :   }
      80             : 
      81        5476 :   if (LocVT == MVT::f32) {
      82             :     static const MCPhysReg RegList3[] = {
      83             :       SystemZ::F0S, SystemZ::F2S, SystemZ::F4S, SystemZ::F6S
      84             :     };
      85         674 :     if (unsigned Reg = State.AllocateReg(RegList3)) {
      86        1306 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      87         653 :       return false;
      88             :     }
      89             :   }
      90             : 
      91        4823 :   if (LocVT == MVT::f64) {
      92             :     static const MCPhysReg RegList4[] = {
      93             :       SystemZ::F0D, SystemZ::F2D, SystemZ::F4D, SystemZ::F6D
      94             :     };
      95        1284 :     if (unsigned Reg = State.AllocateReg(RegList4)) {
      96        3798 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      97        1266 :       return false;
      98             :     }
      99             :   }
     100             : 
     101        3557 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     102        2583 :     if (LocVT == MVT::v16i8 ||
     103        1979 :         LocVT == MVT::v8i16 ||
     104        1267 :         LocVT == MVT::v4i32 ||
     105         795 :         LocVT == MVT::v2i64 ||
     106        3665 :         LocVT == MVT::v4f32 ||
     107             :         LocVT == MVT::v2f64) {
     108        6614 :       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        3299 :         if (unsigned Reg = State.AllocateReg(RegList5)) {
     113        9621 :           State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     114        3207 :           return false;
     115             :         }
     116             :       }
     117             :     }
     118             :   }
     119             : 
     120         350 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     121          78 :     if (LocVT == MVT::v16i8 ||
     122          62 :         LocVT == MVT::v8i16 ||
     123          28 :         LocVT == MVT::v4i32 ||
     124          24 :         LocVT == MVT::v2i64 ||
     125         120 :         LocVT == MVT::v4f32 ||
     126             :         LocVT == MVT::v2f64) {
     127         200 :       if (static_cast<SystemZCCState *>(&State)->IsShortVector(ValNo)) {
     128          14 :         LocVT = MVT::i64;
     129          14 :         LocInfo = CCValAssign::BCvt;
     130             :       }
     131             :     }
     132             :   }
     133             : 
     134         350 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     135          92 :     if (LocVT == MVT::v16i8 ||
     136          76 :         LocVT == MVT::v8i16 ||
     137          42 :         LocVT == MVT::v4i32 ||
     138          38 :         LocVT == MVT::v2i64 ||
     139         134 :         LocVT == MVT::v4f32 ||
     140             :         LocVT == MVT::v2f64) {
     141          86 :       unsigned Offset6 = State.AllocateStack(16, 8);
     142         258 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
     143          86 :       return false;
     144             :     }
     145             :   }
     146             : 
     147         238 :   if (LocVT == MVT::i32 ||
     148          39 :       LocVT == MVT::i64 ||
     149         282 :       LocVT == MVT::f32 ||
     150             :       LocVT == MVT::f64) {
     151         264 :     unsigned Offset7 = State.AllocateStack(8, 8);
     152         792 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset7, LocVT, LocInfo));
     153         264 :     return false;
     154             :   }
     155             : 
     156             :   return true;  // CC didn't match.
     157             : }
     158             : 
     159             : 
     160       11655 : static bool RetCC_SystemZ(unsigned ValNo, MVT ValVT,
     161             :                           MVT LocVT, CCValAssign::LocInfo LocInfo,
     162             :                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
     163             : 
     164       11655 :   if (LocVT == MVT::i32) {
     165        7165 :     if (ArgFlags.isSExt() || ArgFlags.isZExt()) {
     166             :       LocVT = MVT::i64;
     167         817 :       if (ArgFlags.isSExt())
     168             :             LocInfo = CCValAssign::SExt;
     169         744 :       else if (ArgFlags.isZExt())
     170             :             LocInfo = CCValAssign::ZExt;
     171             :       else
     172             :             LocInfo = CCValAssign::AExt;
     173             :     }
     174             :   }
     175             : 
     176       11655 :   if (ArgFlags.isSwiftError()) {
     177          20 :     if (LocVT == MVT::i64) {
     178             :       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       11635 :   if (LocVT == MVT::i32) {
     186             :     static const MCPhysReg RegList1[] = {
     187             :       SystemZ::R2L, SystemZ::R3L, SystemZ::R4L, SystemZ::R5L
     188             :     };
     189        2802 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
     190        5596 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     191        2798 :       return false;
     192             :     }
     193             :   }
     194             : 
     195        8837 :   if (LocVT == MVT::i64) {
     196             :     static const MCPhysReg RegList2[] = {
     197             :       SystemZ::R2D, SystemZ::R3D, SystemZ::R4D, SystemZ::R5D
     198             :     };
     199        3402 :     if (unsigned Reg = State.AllocateReg(RegList2)) {
     200        6800 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     201        3400 :       return false;
     202             :     }
     203             :   }
     204             : 
     205        5437 :   if (LocVT == MVT::f32) {
     206             :     static const MCPhysReg RegList3[] = {
     207             :       SystemZ::F0S, SystemZ::F2S, SystemZ::F4S, SystemZ::F6S
     208             :     };
     209         662 :     if (unsigned Reg = State.AllocateReg(RegList3)) {
     210        1324 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     211         662 :       return false;
     212             :     }
     213             :   }
     214             : 
     215        4775 :   if (LocVT == MVT::f64) {
     216             :     static const MCPhysReg RegList4[] = {
     217             :       SystemZ::F0D, SystemZ::F2D, SystemZ::F4D, SystemZ::F6D
     218             :     };
     219        1476 :     if (unsigned Reg = State.AllocateReg(RegList4)) {
     220        2948 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     221        1474 :       return false;
     222             :     }
     223             :   }
     224             : 
     225        3301 :   if (static_cast<const SystemZSubtarget&>(State.getMachineFunction().getSubtarget()).hasVector()) {
     226        2522 :     if (LocVT == MVT::v16i8 ||
     227        1902 :         LocVT == MVT::v8i16 ||
     228        1218 :         LocVT == MVT::v4i32 ||
     229         662 :         LocVT == MVT::v2i64 ||
     230        3596 :         LocVT == MVT::v4f32 ||
     231             :         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        3256 :       if (unsigned Reg = State.AllocateReg(RegList5)) {
     236        6508 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     237        3254 :         return false;
     238             :       }
     239             :     }
     240             :   }
     241             : 
     242             :   return true;  // CC didn't match.
     243             : }

Generated by: LCOV version 1.13