LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/AArch64 - AArch64GenCallingConv.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 402 436 92.2 %
Date: 2018-06-17 00:07:59 Functions: 8 8 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_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
      10             :                              MVT LocVT, CCValAssign::LocInfo LocInfo,
      11             :                              ISD::ArgFlagsTy ArgFlags, CCState &State);
      12             : static bool CC_AArch64_DarwinPCS(unsigned ValNo, MVT ValVT,
      13             :                                  MVT LocVT, CCValAssign::LocInfo LocInfo,
      14             :                                  ISD::ArgFlagsTy ArgFlags, CCState &State);
      15             : static bool CC_AArch64_DarwinPCS_VarArg(unsigned ValNo, MVT ValVT,
      16             :                                         MVT LocVT, CCValAssign::LocInfo LocInfo,
      17             :                                         ISD::ArgFlagsTy ArgFlags, CCState &State);
      18             : static bool CC_AArch64_GHC(unsigned ValNo, MVT ValVT,
      19             :                            MVT LocVT, CCValAssign::LocInfo LocInfo,
      20             :                            ISD::ArgFlagsTy ArgFlags, CCState &State);
      21             : static bool CC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
      22             :                                  MVT LocVT, CCValAssign::LocInfo LocInfo,
      23             :                                  ISD::ArgFlagsTy ArgFlags, CCState &State);
      24             : static bool CC_AArch64_Win64_VarArg(unsigned ValNo, MVT ValVT,
      25             :                                     MVT LocVT, CCValAssign::LocInfo LocInfo,
      26             :                                     ISD::ArgFlagsTy ArgFlags, CCState &State);
      27             : static bool RetCC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
      28             :                                 MVT LocVT, CCValAssign::LocInfo LocInfo,
      29             :                                 ISD::ArgFlagsTy ArgFlags, CCState &State);
      30             : static bool RetCC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
      31             :                                     MVT LocVT, CCValAssign::LocInfo LocInfo,
      32             :                                     ISD::ArgFlagsTy ArgFlags, CCState &State);
      33             : 
      34             : 
      35       22203 : static bool CC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
      36             :                              MVT LocVT, CCValAssign::LocInfo LocInfo,
      37             :                              ISD::ArgFlagsTy ArgFlags, CCState &State) {
      38             : 
      39       22203 :   if (LocVT == MVT::iPTR) {
      40           0 :     LocVT = MVT::i64;
      41           0 :     LocInfo = CCValAssign::BCvt;
      42             :   }
      43             : 
      44       22203 :   if (LocVT == MVT::v2f32) {
      45         488 :     LocVT = MVT::v2i32;
      46         488 :     LocInfo = CCValAssign::BCvt;
      47             :   }
      48             : 
      49       22203 :   if (LocVT == MVT::v2f64 ||
      50             :       LocVT == MVT::v4f32) {
      51        1052 :     LocVT = MVT::v2i64;
      52        1052 :     LocInfo = CCValAssign::BCvt;
      53             :   }
      54             : 
      55       22203 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
      56        1548 :     if (LocVT == MVT::v2i32 ||
      57        1548 :         LocVT == MVT::v2f32 ||
      58        1511 :         LocVT == MVT::v4i16 ||
      59        3120 :         LocVT == MVT::v4f16 ||
      60             :         LocVT == MVT::v8i8) {
      61         139 :       LocVT = MVT::f64;
      62         139 :       LocInfo = CCValAssign::BCvt;
      63             :     }
      64             :   }
      65             : 
      66       22203 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
      67        1526 :     if (LocVT == MVT::v2i64 ||
      68        1526 :         LocVT == MVT::v2f64 ||
      69        1490 :         LocVT == MVT::v4i32 ||
      70        1490 :         LocVT == MVT::v4f32 ||
      71        1454 :         LocVT == MVT::v8i16 ||
      72        3062 :         LocVT == MVT::v8f16 ||
      73             :         LocVT == MVT::v16i8) {
      74         196 :       LocVT = MVT::f128;
      75         196 :       LocInfo = CCValAssign::BCvt;
      76             :     }
      77             :   }
      78             : 
      79       22203 :   if (ArgFlags.isSRet()) {
      80          13 :     if (LocVT == MVT::i64) {
      81          13 :       if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
      82          39 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      83          13 :         return false;
      84             :       }
      85             :     }
      86             :   }
      87             : 
      88       22190 :   if (ArgFlags.isByVal()) {
      89          15 :     State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
      90          15 :     return false;
      91             :   }
      92             : 
      93       22175 :   if (ArgFlags.isNest()) {
      94             :     if (unsigned Reg = State.AllocateReg(AArch64::X18)) {
      95           6 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      96           2 :       return false;
      97             :     }
      98             :   }
      99             : 
     100       22173 :   if (ArgFlags.isSwiftSelf()) {
     101          14 :     if (LocVT == MVT::i64) {
     102          14 :       if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
     103          42 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     104          14 :         return false;
     105             :       }
     106             :     }
     107             :   }
     108             : 
     109       22159 :   if (ArgFlags.isSwiftError()) {
     110           2 :     if (LocVT == MVT::i64) {
     111           2 :       if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
     112           6 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     113           2 :         return false;
     114             :       }
     115             :     }
     116             :   }
     117             : 
     118       22157 :   if (ArgFlags.isInConsecutiveRegs()) {
     119         869 :     if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     120             :         return false;
     121             :   }
     122             : 
     123       21798 :   if (LocVT == MVT::i1 ||
     124       43012 :       LocVT == MVT::i8 ||
     125             :       LocVT == MVT::i16) {
     126        1154 :     LocVT = MVT::i32;
     127        1154 :     if (ArgFlags.isSExt())
     128           6 :         LocInfo = CCValAssign::SExt;
     129        1148 :     else if (ArgFlags.isZExt())
     130          26 :         LocInfo = CCValAssign::ZExt;
     131             :     else
     132        1122 :         LocInfo = CCValAssign::AExt;
     133             :   }
     134             : 
     135       21808 :   if (LocVT == MVT::i32) {
     136             :     static const MCPhysReg RegList1[] = {
     137             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     138             :     };
     139             :     static const MCPhysReg RegList2[] = {
     140             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     141             :     };
     142        4246 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     143       12546 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     144        4182 :       return false;
     145             :     }
     146             :   }
     147             : 
     148       17626 :   if (LocVT == MVT::i64) {
     149        6405 :     if (ArgFlags.isSplit()) {
     150             :       static const MCPhysReg RegList3[] = {
     151             :         AArch64::X0, AArch64::X2, AArch64::X4, AArch64::X6
     152             :       };
     153             :       static const MCPhysReg RegList4[] = {
     154             :         AArch64::X0, AArch64::X1, AArch64::X3, AArch64::X5
     155             :       };
     156         158 :       if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     157         327 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     158         109 :         return false;
     159             :       }
     160             :     }
     161             :   }
     162             : 
     163       17517 :   if (LocVT == MVT::i64) {
     164        6296 :     if (ArgFlags.isSplit()) {
     165             :       static const MCPhysReg ShadowRegList5[] = {
     166             :         AArch64::X7
     167             :       };
     168          49 :       unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
     169         147 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
     170          49 :       return false;
     171             :     }
     172             :   }
     173             : 
     174       17468 :   if (LocVT == MVT::i64) {
     175             :     static const MCPhysReg RegList7[] = {
     176             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     177             :     };
     178             :     static const MCPhysReg RegList8[] = {
     179             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     180             :     };
     181        6247 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
     182       18420 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     183        6140 :       return false;
     184             :     }
     185             :   }
     186             : 
     187       11328 :   if (LocVT == MVT::f16) {
     188             :     static const MCPhysReg RegList9[] = {
     189             :       AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
     190             :     };
     191             :     static const MCPhysReg RegList10[] = {
     192             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     193             :     };
     194         334 :     if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
     195        1002 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     196         334 :       return false;
     197             :     }
     198             :   }
     199             : 
     200       10994 :   if (LocVT == MVT::f32) {
     201             :     static const MCPhysReg RegList11[] = {
     202             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     203             :     };
     204             :     static const MCPhysReg RegList12[] = {
     205             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     206             :     };
     207         821 :     if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
     208        2448 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     209         816 :       return false;
     210             :     }
     211             :   }
     212             : 
     213       10178 :   if (LocVT == MVT::f64) {
     214             :     static const MCPhysReg RegList13[] = {
     215             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     216             :     };
     217             :     static const MCPhysReg RegList14[] = {
     218             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     219             :     };
     220         766 :     if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
     221        2244 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     222         748 :       return false;
     223             :     }
     224             :   }
     225             : 
     226        9221 :   if (LocVT == MVT::v1i64 ||
     227        7842 :       LocVT == MVT::v2i32 ||
     228        6817 :       LocVT == MVT::v4i16 ||
     229        6301 :       LocVT == MVT::v8i8 ||
     230        6160 :       LocVT == MVT::v1f64 ||
     231       15590 :       LocVT == MVT::v2f32 ||
     232             :       LocVT == MVT::v4f16) {
     233             :     static const MCPhysReg RegList15[] = {
     234             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     235             :     };
     236             :     static const MCPhysReg RegList16[] = {
     237             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     238             :     };
     239        3493 :     if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
     240       10476 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     241        3492 :       return false;
     242             :     }
     243             :   }
     244             : 
     245        5385 :   if (LocVT == MVT::f128 ||
     246        3750 :       LocVT == MVT::v2i64 ||
     247        2054 :       LocVT == MVT::v4i32 ||
     248        1019 :       LocVT == MVT::v8i16 ||
     249         421 :       LocVT == MVT::v16i8 ||
     250         421 :       LocVT == MVT::v4f32 ||
     251        6359 :       LocVT == MVT::v2f64 ||
     252             :       LocVT == MVT::v8f16) {
     253             :     static const MCPhysReg RegList17[] = {
     254             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     255             :     };
     256        5738 :     if (unsigned Reg = State.AllocateReg(RegList17)) {
     257       17199 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     258        5733 :       return false;
     259             :     }
     260             :   }
     261             : 
     262         205 :   if (LocVT == MVT::i1 ||
     263         205 :       LocVT == MVT::i8 ||
     264         410 :       LocVT == MVT::i16 ||
     265             :       LocVT == MVT::f16) {
     266           0 :     unsigned Offset18 = State.AllocateStack(8, 8);
     267           0 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
     268           0 :     return false;
     269             :   }
     270             : 
     271         346 :   if (LocVT == MVT::i32 ||
     272             :       LocVT == MVT::f32) {
     273          69 :     unsigned Offset19 = State.AllocateStack(8, 8);
     274         207 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
     275          69 :     return false;
     276             :   }
     277             : 
     278          29 :   if (LocVT == MVT::i64 ||
     279          11 :       LocVT == MVT::f64 ||
     280          11 :       LocVT == MVT::v1f64 ||
     281          11 :       LocVT == MVT::v2f32 ||
     282          11 :       LocVT == MVT::v1i64 ||
     283          11 :       LocVT == MVT::v2i32 ||
     284          11 :       LocVT == MVT::v4i16 ||
     285         147 :       LocVT == MVT::v8i8 ||
     286             :       LocVT == MVT::v4f16) {
     287         126 :     unsigned Offset20 = State.AllocateStack(8, 8);
     288         378 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
     289         126 :     return false;
     290             :   }
     291             : 
     292           9 :   if (LocVT == MVT::f128 ||
     293           6 :       LocVT == MVT::v2i64 ||
     294           6 :       LocVT == MVT::v4i32 ||
     295           6 :       LocVT == MVT::v8i16 ||
     296           6 :       LocVT == MVT::v16i8 ||
     297           6 :       LocVT == MVT::v4f32 ||
     298          16 :       LocVT == MVT::v2f64 ||
     299             :       LocVT == MVT::v8f16) {
     300           5 :     unsigned Offset21 = State.AllocateStack(16, 16);
     301          15 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
     302           5 :     return false;
     303             :   }
     304             : 
     305             :   return true;  // CC didn't match.
     306             : }
     307             : 
     308             : 
     309        7852 : static bool CC_AArch64_DarwinPCS(unsigned ValNo, MVT ValVT,
     310             :                                  MVT LocVT, CCValAssign::LocInfo LocInfo,
     311             :                                  ISD::ArgFlagsTy ArgFlags, CCState &State) {
     312             : 
     313        7852 :   if (LocVT == MVT::iPTR) {
     314           0 :     LocVT = MVT::i64;
     315           0 :     LocInfo = CCValAssign::BCvt;
     316             :   }
     317             : 
     318        7852 :   if (LocVT == MVT::v2f32) {
     319          98 :     LocVT = MVT::v2i32;
     320          98 :     LocInfo = CCValAssign::BCvt;
     321             :   }
     322             : 
     323        7751 :   if (LocVT == MVT::v2f64 ||
     324       15495 :       LocVT == MVT::v4f32 ||
     325             :       LocVT == MVT::f128) {
     326         225 :     LocVT = MVT::v2i64;
     327         225 :     LocInfo = CCValAssign::BCvt;
     328             :   }
     329             : 
     330        7852 :   if (ArgFlags.isSRet()) {
     331          27 :     if (LocVT == MVT::i64) {
     332          27 :       if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
     333          81 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     334          27 :         return false;
     335             :       }
     336             :     }
     337             :   }
     338             : 
     339        7825 :   if (ArgFlags.isByVal()) {
     340           0 :     State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
     341           0 :     return false;
     342             :   }
     343             : 
     344        7825 :   if (ArgFlags.isSwiftSelf()) {
     345          43 :     if (LocVT == MVT::i64) {
     346          43 :       if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
     347         129 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     348          43 :         return false;
     349             :       }
     350             :     }
     351             :   }
     352             : 
     353        7782 :   if (ArgFlags.isSwiftError()) {
     354          46 :     if (LocVT == MVT::i64) {
     355          46 :       if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
     356         138 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     357          46 :         return false;
     358             :       }
     359             :     }
     360             :   }
     361             : 
     362        7736 :   if (ArgFlags.isInConsecutiveRegs()) {
     363         273 :     if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     364             :         return false;
     365             :   }
     366             : 
     367        7444 :   if (LocVT == MVT::i1 ||
     368       14715 :       LocVT == MVT::i8 ||
     369             :       LocVT == MVT::i16) {
     370         277 :     LocVT = MVT::i32;
     371         277 :     if (ArgFlags.isSExt())
     372         105 :         LocInfo = CCValAssign::SExt;
     373         172 :     else if (ArgFlags.isZExt())
     374         107 :         LocInfo = CCValAssign::ZExt;
     375             :     else
     376          65 :         LocInfo = CCValAssign::AExt;
     377             :   }
     378             : 
     379        7463 :   if (LocVT == MVT::i32) {
     380             :     static const MCPhysReg RegList1[] = {
     381             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     382             :     };
     383             :     static const MCPhysReg RegList2[] = {
     384             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     385             :     };
     386        1298 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     387        3543 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     388        1181 :       return false;
     389             :     }
     390             :   }
     391             : 
     392        6282 :   if (LocVT == MVT::i64) {
     393        4370 :     if (ArgFlags.isSplit()) {
     394             :       static const MCPhysReg RegList3[] = {
     395             :         AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6
     396             :       };
     397             :       static const MCPhysReg RegList4[] = {
     398             :         AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6
     399             :       };
     400          63 :       if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     401         129 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     402          43 :         return false;
     403             :       }
     404             :     }
     405             :   }
     406             : 
     407        6239 :   if (LocVT == MVT::i64) {
     408        4327 :     if (ArgFlags.isSplit()) {
     409             :       static const MCPhysReg ShadowRegList5[] = {
     410             :         AArch64::X7
     411             :       };
     412          20 :       unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
     413          60 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
     414          20 :       return false;
     415             :     }
     416             :   }
     417             : 
     418        6219 :   if (LocVT == MVT::i64) {
     419             :     static const MCPhysReg RegList7[] = {
     420             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     421             :     };
     422             :     static const MCPhysReg RegList8[] = {
     423             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     424             :     };
     425        4307 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
     426        7896 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     427        2632 :       return false;
     428             :     }
     429             :   }
     430             : 
     431        3587 :   if (LocVT == MVT::f16) {
     432             :     static const MCPhysReg RegList9[] = {
     433             :       AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
     434             :     };
     435             :     static const MCPhysReg RegList10[] = {
     436             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     437             :     };
     438          14 :     if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
     439          42 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     440          14 :       return false;
     441             :     }
     442             :   }
     443             : 
     444        3573 :   if (LocVT == MVT::f32) {
     445             :     static const MCPhysReg RegList11[] = {
     446             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     447             :     };
     448             :     static const MCPhysReg RegList12[] = {
     449             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     450             :     };
     451         282 :     if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
     452         807 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     453         269 :       return false;
     454             :     }
     455             :   }
     456             : 
     457        3304 :   if (LocVT == MVT::f64) {
     458             :     static const MCPhysReg RegList13[] = {
     459             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     460             :     };
     461             :     static const MCPhysReg RegList14[] = {
     462             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     463             :     };
     464         277 :     if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
     465         747 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     466         249 :       return false;
     467             :     }
     468             :   }
     469             : 
     470        2980 :   if (LocVT == MVT::v1i64 ||
     471        2767 :       LocVT == MVT::v2i32 ||
     472        2677 :       LocVT == MVT::v4i16 ||
     473        2593 :       LocVT == MVT::v8i8 ||
     474        2516 :       LocVT == MVT::v1f64 ||
     475        5571 :       LocVT == MVT::v2f32 ||
     476             :       LocVT == MVT::v4f16) {
     477             :     static const MCPhysReg RegList15[] = {
     478             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     479             :     };
     480             :     static const MCPhysReg RegList16[] = {
     481             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     482             :     };
     483         540 :     if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
     484        1608 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     485         536 :       return false;
     486             :     }
     487             :   }
     488             : 
     489        2211 :   if (LocVT == MVT::v2i64 ||
     490        2039 :       LocVT == MVT::v4i32 ||
     491        1951 :       LocVT == MVT::v8i16 ||
     492        1837 :       LocVT == MVT::v16i8 ||
     493        1837 :       LocVT == MVT::v4f32 ||
     494        4356 :       LocVT == MVT::v2f64 ||
     495             :       LocVT == MVT::v8f16) {
     496             :     static const MCPhysReg RegList17[] = {
     497             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     498             :     };
     499         682 :     if (unsigned Reg = State.AllocateReg(RegList17)) {
     500        2034 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     501         678 :       return false;
     502             :     }
     503             :   }
     504             : 
     505        1841 :   if (ValVT == MVT::i1 || ValVT == MVT::i8) {
     506          39 :     unsigned Offset18 = State.AllocateStack(1, 1);
     507         117 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
     508          39 :     return false;
     509             :   }
     510             : 
     511        3596 :   if (ValVT == MVT::i16 || ValVT == MVT::f16) {
     512           8 :     unsigned Offset19 = State.AllocateStack(2, 2);
     513          24 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
     514           8 :     return false;
     515             :   }
     516             : 
     517        3518 :   if (LocVT == MVT::i32 ||
     518             :       LocVT == MVT::f32) {
     519          83 :     unsigned Offset20 = State.AllocateStack(4, 4);
     520         249 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
     521          83 :     return false;
     522             :   }
     523             : 
     524          36 :   if (LocVT == MVT::i64 ||
     525           8 :       LocVT == MVT::f64 ||
     526           8 :       LocVT == MVT::v1f64 ||
     527           8 :       LocVT == MVT::v2f32 ||
     528           8 :       LocVT == MVT::v1i64 ||
     529           4 :       LocVT == MVT::v2i32 ||
     530           4 :       LocVT == MVT::v4i16 ||
     531        1715 :       LocVT == MVT::v8i8 ||
     532             :       LocVT == MVT::v4f16) {
     533        1707 :     unsigned Offset21 = State.AllocateStack(8, 8);
     534        5121 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
     535        1707 :     return false;
     536             :   }
     537             : 
     538           4 :   if (LocVT == MVT::v2i64 ||
     539           0 :       LocVT == MVT::v4i32 ||
     540           0 :       LocVT == MVT::v8i16 ||
     541           0 :       LocVT == MVT::v16i8 ||
     542           0 :       LocVT == MVT::v4f32 ||
     543           4 :       LocVT == MVT::v2f64 ||
     544             :       LocVT == MVT::v8f16) {
     545           4 :     unsigned Offset22 = State.AllocateStack(16, 16);
     546          12 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset22, LocVT, LocInfo));
     547           4 :     return false;
     548             :   }
     549             : 
     550             :   return true;  // CC didn't match.
     551             : }
     552             : 
     553             : 
     554          48 : static bool CC_AArch64_DarwinPCS_VarArg(unsigned ValNo, MVT ValVT,
     555             :                                         MVT LocVT, CCValAssign::LocInfo LocInfo,
     556             :                                         ISD::ArgFlagsTy ArgFlags, CCState &State) {
     557             : 
     558          48 :   if (LocVT == MVT::iPTR) {
     559           0 :     LocVT = MVT::i64;
     560             :     LocInfo = CCValAssign::BCvt;
     561             :   }
     562             : 
     563          48 :   if (LocVT == MVT::v2f32) {
     564           0 :     LocVT = MVT::v2i32;
     565             :     LocInfo = CCValAssign::BCvt;
     566             :   }
     567             : 
     568          48 :   if (LocVT == MVT::v2f64 ||
     569          96 :       LocVT == MVT::v4f32 ||
     570             :       LocVT == MVT::f128) {
     571           0 :     LocVT = MVT::v2i64;
     572             :     LocInfo = CCValAssign::BCvt;
     573             :   }
     574             : 
     575          48 :   if (ArgFlags.isInConsecutiveRegs()) {
     576           5 :     if (CC_AArch64_Custom_Stack_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     577             :         return false;
     578             :   }
     579             : 
     580          42 :   if (LocVT == MVT::i8 ||
     581          84 :       LocVT == MVT::i16 ||
     582             :       LocVT == MVT::i32) {
     583          35 :     LocVT = MVT::i64;
     584          35 :     if (ArgFlags.isSExt())
     585             :         LocInfo = CCValAssign::SExt;
     586          35 :     else if (ArgFlags.isZExt())
     587             :         LocInfo = CCValAssign::ZExt;
     588             :     else
     589             :         LocInfo = CCValAssign::AExt;
     590             :   }
     591             : 
     592          43 :   if (LocVT == MVT::f16 ||
     593             :       LocVT == MVT::f32) {
     594           2 :     LocVT = MVT::f64;
     595             :     LocInfo = CCValAssign::FPExt;
     596             :   }
     597             : 
     598          43 :   if (LocVT == MVT::i64) {
     599          38 :     if (ArgFlags.isSplit()) {
     600           1 :       unsigned Offset1 = State.AllocateStack(8, 16);
     601           2 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
     602           1 :       return false;
     603             :     }
     604             :   }
     605             : 
     606           5 :   if (LocVT == MVT::i64 ||
     607           1 :       LocVT == MVT::f64 ||
     608           1 :       LocVT == MVT::v1i64 ||
     609           1 :       LocVT == MVT::v2i32 ||
     610           1 :       LocVT == MVT::v4i16 ||
     611           1 :       LocVT == MVT::v8i8 ||
     612           1 :       LocVT == MVT::v1f64 ||
     613          43 :       LocVT == MVT::v2f32 ||
     614             :       LocVT == MVT::v4f16) {
     615          41 :     unsigned Offset2 = State.AllocateStack(8, 8);
     616          82 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
     617          41 :     return false;
     618             :   }
     619             : 
     620           1 :   if (LocVT == MVT::v2i64 ||
     621           0 :       LocVT == MVT::v4i32 ||
     622           0 :       LocVT == MVT::v8i16 ||
     623           0 :       LocVT == MVT::v16i8 ||
     624           0 :       LocVT == MVT::v4f32 ||
     625           1 :       LocVT == MVT::v2f64 ||
     626             :       LocVT == MVT::v8f16) {
     627           1 :     unsigned Offset3 = State.AllocateStack(16, 16);
     628           2 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset3, LocVT, LocInfo));
     629           1 :     return false;
     630             :   }
     631             : 
     632             :   return true;  // CC didn't match.
     633             : }
     634             : 
     635             : 
     636           8 : static bool CC_AArch64_GHC(unsigned ValNo, MVT ValVT,
     637             :                            MVT LocVT, CCValAssign::LocInfo LocInfo,
     638             :                            ISD::ArgFlagsTy ArgFlags, CCState &State) {
     639             : 
     640           8 :   if (LocVT == MVT::iPTR) {
     641             :     LocVT = MVT::i64;
     642             :     LocInfo = CCValAssign::BCvt;
     643             :   }
     644             : 
     645           8 :   if (LocVT == MVT::v1i64 ||
     646           8 :       LocVT == MVT::v2i32 ||
     647           8 :       LocVT == MVT::v4i16 ||
     648          16 :       LocVT == MVT::v8i8 ||
     649             :       LocVT == MVT::v2f32) {
     650             :     LocVT = MVT::f64;
     651             :     LocInfo = CCValAssign::BCvt;
     652             :   }
     653             : 
     654           8 :   if (LocVT == MVT::v2i64 ||
     655           8 :       LocVT == MVT::v4i32 ||
     656           8 :       LocVT == MVT::v8i16 ||
     657           8 :       LocVT == MVT::v16i8 ||
     658          16 :       LocVT == MVT::v4f32 ||
     659             :       LocVT == MVT::f128) {
     660             :     LocVT = MVT::v2f64;
     661             :     LocInfo = CCValAssign::BCvt;
     662             :   }
     663             : 
     664           8 :   if (LocVT == MVT::v2f64) {
     665             :     static const MCPhysReg RegList1[] = {
     666             :       AArch64::Q4, AArch64::Q5
     667             :     };
     668           0 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
     669           0 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     670           0 :       return false;
     671             :     }
     672             :   }
     673             : 
     674           8 :   if (LocVT == MVT::f32) {
     675             :     static const MCPhysReg RegList2[] = {
     676             :       AArch64::S8, AArch64::S9, AArch64::S10, AArch64::S11
     677             :     };
     678           2 :     if (unsigned Reg = State.AllocateReg(RegList2)) {
     679           4 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     680           2 :       return false;
     681             :     }
     682             :   }
     683             : 
     684           6 :   if (LocVT == MVT::f64) {
     685             :     static const MCPhysReg RegList3[] = {
     686             :       AArch64::D12, AArch64::D13, AArch64::D14, AArch64::D15
     687             :     };
     688           1 :     if (unsigned Reg = State.AllocateReg(RegList3)) {
     689           2 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     690           1 :       return false;
     691             :     }
     692             :   }
     693             : 
     694           5 :   if (LocVT == MVT::i8 ||
     695          10 :       LocVT == MVT::i16 ||
     696             :       LocVT == MVT::i32) {
     697             :     LocVT = MVT::i64;
     698           0 :     if (ArgFlags.isSExt())
     699             :         LocInfo = CCValAssign::SExt;
     700           0 :     else if (ArgFlags.isZExt())
     701             :         LocInfo = CCValAssign::ZExt;
     702             :     else
     703             :         LocInfo = CCValAssign::AExt;
     704             :   }
     705             : 
     706           5 :   if (LocVT == MVT::i64) {
     707             :     static const MCPhysReg RegList4[] = {
     708             :       AArch64::X19, AArch64::X20, AArch64::X21, AArch64::X22, AArch64::X23, AArch64::X24, AArch64::X25, AArch64::X26, AArch64::X27, AArch64::X28
     709             :     };
     710           5 :     if (unsigned Reg = State.AllocateReg(RegList4)) {
     711          10 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     712           5 :       return false;
     713             :     }
     714             :   }
     715             : 
     716             :   return true;  // CC didn't match.
     717             : }
     718             : 
     719             : 
     720         129 : static bool CC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
     721             :                                  MVT LocVT, CCValAssign::LocInfo LocInfo,
     722             :                                  ISD::ArgFlagsTy ArgFlags, CCState &State) {
     723             : 
     724         129 :   if (LocVT == MVT::i1 ||
     725         258 :       LocVT == MVT::i8 ||
     726             :       LocVT == MVT::i16) {
     727             :     LocVT = MVT::i32;
     728           6 :     if (ArgFlags.isSExt())
     729             :         LocInfo = CCValAssign::SExt;
     730           6 :     else if (ArgFlags.isZExt())
     731             :         LocInfo = CCValAssign::ZExt;
     732             :     else
     733             :         LocInfo = CCValAssign::AExt;
     734             :   }
     735             : 
     736         129 :   if (LocVT == MVT::i32) {
     737          27 :     if (unsigned Reg = State.AllocateReg(AArch64::W0, AArch64::X0)) {
     738           6 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     739           3 :       return false;
     740             :     }
     741             :   }
     742             : 
     743         126 :   if (LocVT == MVT::i64) {
     744         102 :     if (unsigned Reg = State.AllocateReg(AArch64::X0, AArch64::W0)) {
     745          34 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     746          17 :       return false;
     747             :     }
     748             :   }
     749             : 
     750         109 :   if (LocVT == MVT::i32 ||
     751             :       LocVT == MVT::f32) {
     752          24 :     unsigned Offset1 = State.AllocateStack(4, 4);
     753          48 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
     754          24 :     return false;
     755             :   }
     756             : 
     757          85 :   if (LocVT == MVT::i64 ||
     758             :       LocVT == MVT::f64) {
     759          85 :     unsigned Offset2 = State.AllocateStack(8, 8);
     760         170 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
     761          85 :     return false;
     762             :   }
     763             : 
     764             :   return true;  // CC didn't match.
     765             : }
     766             : 
     767             : 
     768          19 : static bool CC_AArch64_Win64_VarArg(unsigned ValNo, MVT ValVT,
     769             :                                     MVT LocVT, CCValAssign::LocInfo LocInfo,
     770             :                                     ISD::ArgFlagsTy ArgFlags, CCState &State) {
     771             : 
     772          19 :   if (LocVT == MVT::f16 ||
     773             :       LocVT == MVT::f32) {
     774             :     LocVT = MVT::f64;
     775             :     LocInfo = CCValAssign::FPExt;
     776             :   }
     777             : 
     778          19 :   if (LocVT == MVT::f64) {
     779             :     LocVT = MVT::i64;
     780             :     LocInfo = CCValAssign::BCvt;
     781             :   }
     782             : 
     783          19 :   if (!CC_AArch64_AAPCS(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     784             :     return false;
     785             : 
     786           0 :   return true;  // CC didn't match.
     787             : }
     788             : 
     789             : 
     790       27384 : static bool RetCC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
     791             :                                 MVT LocVT, CCValAssign::LocInfo LocInfo,
     792             :                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
     793             : 
     794       27384 :   if (LocVT == MVT::iPTR) {
     795             :     LocVT = MVT::i64;
     796             :     LocInfo = CCValAssign::BCvt;
     797             :   }
     798             : 
     799       27384 :   if (LocVT == MVT::v2f32) {
     800             :     LocVT = MVT::v2i32;
     801             :     LocInfo = CCValAssign::BCvt;
     802             :   }
     803             : 
     804       27384 :   if (LocVT == MVT::v2f64 ||
     805             :       LocVT == MVT::v4f32) {
     806             :     LocVT = MVT::v2i64;
     807             :     LocInfo = CCValAssign::BCvt;
     808             :   }
     809             : 
     810       27384 :   if (ArgFlags.isSwiftError()) {
     811          50 :     if (LocVT == MVT::i64) {
     812          50 :       if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
     813         100 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     814          50 :         return false;
     815             :       }
     816             :     }
     817             :   }
     818             : 
     819       27334 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
     820        1813 :     if (LocVT == MVT::v2i32 ||
     821        1813 :         LocVT == MVT::v2f32 ||
     822        1753 :         LocVT == MVT::v4i16 ||
     823        3686 :         LocVT == MVT::v4f16 ||
     824             :         LocVT == MVT::v8i8) {
     825             :       LocVT = MVT::f64;
     826             :       LocInfo = CCValAssign::BCvt;
     827             :     }
     828             :   }
     829             : 
     830       27334 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
     831        1753 :     if (LocVT == MVT::v2i64 ||
     832        1753 :         LocVT == MVT::v2f64 ||
     833        1693 :         LocVT == MVT::v4i32 ||
     834        1693 :         LocVT == MVT::v4f32 ||
     835        1633 :         LocVT == MVT::v8i16 ||
     836        3566 :         LocVT == MVT::v8f16 ||
     837             :         LocVT == MVT::v16i8) {
     838             :       LocVT = MVT::f128;
     839             :       LocInfo = CCValAssign::BCvt;
     840             :     }
     841             :   }
     842             : 
     843       27332 :   if (LocVT == MVT::i1 ||
     844       54660 :       LocVT == MVT::i8 ||
     845             :       LocVT == MVT::i16) {
     846             :     LocVT = MVT::i32;
     847           9 :     if (ArgFlags.isSExt())
     848             :         LocInfo = CCValAssign::SExt;
     849           5 :     else if (ArgFlags.isZExt())
     850             :         LocInfo = CCValAssign::ZExt;
     851             :     else
     852             :         LocInfo = CCValAssign::AExt;
     853             :   }
     854             : 
     855       27334 :   if (LocVT == MVT::i32) {
     856             :     static const MCPhysReg RegList1[] = {
     857             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     858             :     };
     859             :     static const MCPhysReg RegList2[] = {
     860             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     861             :     };
     862        6726 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     863       13452 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     864        6726 :       return false;
     865             :     }
     866             :   }
     867             : 
     868       20608 :   if (LocVT == MVT::i64) {
     869             :     static const MCPhysReg RegList3[] = {
     870             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     871             :     };
     872             :     static const MCPhysReg RegList4[] = {
     873             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     874             :     };
     875        3943 :     if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     876        7866 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     877        3933 :       return false;
     878             :     }
     879             :   }
     880             : 
     881       16675 :   if (LocVT == MVT::f16) {
     882             :     static const MCPhysReg RegList5[] = {
     883             :       AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
     884             :     };
     885             :     static const MCPhysReg RegList6[] = {
     886             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     887             :     };
     888         382 :     if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
     889         764 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     890         382 :       return false;
     891             :     }
     892             :   }
     893             : 
     894       16293 :   if (LocVT == MVT::f32) {
     895             :     static const MCPhysReg RegList7[] = {
     896             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     897             :     };
     898             :     static const MCPhysReg RegList8[] = {
     899             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     900             :     };
     901        1246 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
     902        2492 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     903        1246 :       return false;
     904             :     }
     905             :   }
     906             : 
     907       15047 :   if (LocVT == MVT::f64) {
     908             :     static const MCPhysReg RegList9[] = {
     909             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     910             :     };
     911             :     static const MCPhysReg RegList10[] = {
     912             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     913             :     };
     914        1257 :     if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
     915        2514 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     916        1257 :       return false;
     917             :     }
     918             :   }
     919             : 
     920       13322 :   if (LocVT == MVT::v1i64 ||
     921       11483 :       LocVT == MVT::v2i32 ||
     922       10235 :       LocVT == MVT::v4i16 ||
     923        9199 :       LocVT == MVT::v8i8 ||
     924        8913 :       LocVT == MVT::v1f64 ||
     925       22703 :       LocVT == MVT::v2f32 ||
     926             :       LocVT == MVT::v4f16) {
     927             :     static const MCPhysReg RegList11[] = {
     928             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     929             :     };
     930             :     static const MCPhysReg RegList12[] = {
     931             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     932             :     };
     933        5146 :     if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
     934       10292 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     935        5146 :       return false;
     936             :     }
     937             :   }
     938             : 
     939        7920 :   if (LocVT == MVT::f128 ||
     940        5014 :       LocVT == MVT::v2i64 ||
     941        2706 :       LocVT == MVT::v4i32 ||
     942        1289 :       LocVT == MVT::v8i16 ||
     943         280 :       LocVT == MVT::v16i8 ||
     944         280 :       LocVT == MVT::v4f32 ||
     945        8924 :       LocVT == MVT::v2f64 ||
     946             :       LocVT == MVT::v8f16) {
     947             :     static const MCPhysReg RegList13[] = {
     948             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     949             :     };
     950        8632 :     if (unsigned Reg = State.AllocateReg(RegList13)) {
     951       17264 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     952        8632 :       return false;
     953             :     }
     954             :   }
     955             : 
     956             :   return true;  // CC didn't match.
     957             : }
     958             : 
     959             : 
     960          21 : static bool RetCC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
     961             :                                     MVT LocVT, CCValAssign::LocInfo LocInfo,
     962             :                                     ISD::ArgFlagsTy ArgFlags, CCState &State) {
     963             : 
     964          21 :   if (LocVT == MVT::i32) {
     965             :     static const MCPhysReg RegList1[] = {
     966             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     967             :     };
     968             :     static const MCPhysReg RegList2[] = {
     969             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     970             :     };
     971           6 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     972          12 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     973           6 :       return false;
     974             :     }
     975             :   }
     976             : 
     977          15 :   if (LocVT == MVT::i64) {
     978             :     static const MCPhysReg RegList3[] = {
     979             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     980             :     };
     981             :     static const MCPhysReg RegList4[] = {
     982             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     983             :     };
     984          15 :     if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     985          30 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     986          15 :       return false;
     987             :     }
     988             :   }
     989             : 
     990           0 :   if (LocVT == MVT::f32) {
     991             :     static const MCPhysReg RegList5[] = {
     992             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     993             :     };
     994             :     static const MCPhysReg RegList6[] = {
     995             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     996             :     };
     997           0 :     if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
     998           0 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     999           0 :       return false;
    1000             :     }
    1001             :   }
    1002             : 
    1003           0 :   if (LocVT == MVT::f64) {
    1004             :     static const MCPhysReg RegList7[] = {
    1005             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
    1006             :     };
    1007             :     static const MCPhysReg RegList8[] = {
    1008             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
    1009             :     };
    1010           0 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
    1011           0 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
    1012           0 :       return false;
    1013             :     }
    1014             :   }
    1015             : 
    1016             :   return true;  // CC didn't match.
    1017             : }

Generated by: LCOV version 1.13