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: 441 486 90.7 %
Date: 2017-09-14 15:23:50 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       17956 : static bool CC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
      36             :                              MVT LocVT, CCValAssign::LocInfo LocInfo,
      37             :                              ISD::ArgFlagsTy ArgFlags, CCState &State) {
      38             : 
      39       35912 :   if (LocVT == MVT::iPTR) {
      40           0 :     LocVT = MVT::i64;
      41           0 :     LocInfo = CCValAssign::BCvt;
      42             :   }
      43             : 
      44       35912 :   if (LocVT == MVT::v2f32) {
      45         396 :     LocVT = MVT::v2i32;
      46         396 :     LocInfo = CCValAssign::BCvt;
      47             :   }
      48             : 
      49       53448 :   if (LocVT == MVT::v2f64 ||
      50       17536 :       LocVT == MVT::v4f32) {
      51         894 :     LocVT = MVT::v2i64;
      52         894 :     LocInfo = CCValAssign::BCvt;
      53             :   }
      54             : 
      55       17956 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
      56        3387 :     if (LocVT == MVT::v2i32 ||
      57        2174 :         LocVT == MVT::v2f32 ||
      58        2137 :         LocVT == MVT::v4i16 ||
      59        3248 :         LocVT == MVT::v4f16 ||
      60        1048 :         LocVT == MVT::v8i8) {
      61         139 :       LocVT = MVT::f64;
      62         139 :       LocInfo = CCValAssign::BCvt;
      63             :     }
      64             :   }
      65             : 
      66       17956 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
      67        3369 :     if (LocVT == MVT::v2i64 ||
      68        2138 :         LocVT == MVT::v2f64 ||
      69        2102 :         LocVT == MVT::v4i32 ||
      70        2066 :         LocVT == MVT::v4f32 ||
      71        2030 :         LocVT == MVT::v8i16 ||
      72        3141 :         LocVT == MVT::v8f16 ||
      73         994 :         LocVT == MVT::v16i8) {
      74         192 :       LocVT = MVT::f128;
      75         192 :       LocInfo = CCValAssign::BCvt;
      76             :     }
      77             :   }
      78             : 
      79       17956 :   if (ArgFlags.isSRet()) {
      80          26 :     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       17943 :   if (ArgFlags.isByVal()) {
      89          14 :     State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
      90          14 :     return false;
      91             :   }
      92             : 
      93       17929 :   if (ArgFlags.isNest()) {
      94           2 :     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       17927 :   if (ArgFlags.isSwiftSelf()) {
     101          28 :     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       17913 :   if (ArgFlags.isInConsecutiveRegs()) {
     110         869 :     if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     111             :         return false;
     112             :   }
     113             : 
     114       52683 :   if (LocVT == MVT::i1 ||
     115       34729 :       LocVT == MVT::i8 ||
     116       17165 :       LocVT == MVT::i16) {
     117         745 :     LocVT = MVT::i32;
     118         745 :     if (ArgFlags.isSExt())
     119           6 :         LocInfo = CCValAssign::SExt;
     120         739 :     else if (ArgFlags.isZExt())
     121          18 :         LocInfo = CCValAssign::ZExt;
     122             :     else
     123         721 :         LocInfo = CCValAssign::AExt;
     124             :   }
     125             : 
     126       35128 :   if (LocVT == MVT::i32) {
     127             :     static const MCPhysReg RegList1[] = {
     128             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     129             :     };
     130             :     static const MCPhysReg RegList2[] = {
     131             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     132             :     };
     133        3116 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     134        9156 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     135        3052 :       return false;
     136             :     }
     137             :   }
     138             : 
     139       29024 :   if (LocVT == MVT::i64) {
     140        5497 :     if (ArgFlags.isSplit()) {
     141             :       static const MCPhysReg RegList3[] = {
     142             :         AArch64::X0, AArch64::X2, AArch64::X4, AArch64::X6
     143             :       };
     144             :       static const MCPhysReg RegList4[] = {
     145             :         AArch64::X0, AArch64::X1, AArch64::X3, AArch64::X5
     146             :       };
     147         122 :       if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     148         219 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     149          73 :         return false;
     150             :       }
     151             :     }
     152             :   }
     153             : 
     154       28878 :   if (LocVT == MVT::i64) {
     155        5424 :     if (ArgFlags.isSplit()) {
     156             :       static const MCPhysReg ShadowRegList5[] = {
     157             :         AArch64::X7
     158             :       };
     159          49 :       unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
     160         147 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
     161          49 :       return false;
     162             :     }
     163             :   }
     164             : 
     165       14390 :   if (LocVT == MVT::i64) {
     166             :     static const MCPhysReg RegList7[] = {
     167             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     168             :     };
     169             :     static const MCPhysReg RegList8[] = {
     170             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     171             :     };
     172        5375 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
     173       15822 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     174        5274 :       return false;
     175             :     }
     176             :   }
     177             : 
     178       18232 :   if (LocVT == MVT::f16) {
     179             :     static const MCPhysReg RegList9[] = {
     180             :       AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
     181             :     };
     182             :     static const MCPhysReg RegList10[] = {
     183             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     184             :     };
     185         234 :     if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
     186         702 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     187         234 :       return false;
     188             :     }
     189             :   }
     190             : 
     191       17764 :   if (LocVT == MVT::f32) {
     192             :     static const MCPhysReg RegList11[] = {
     193             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     194             :     };
     195             :     static const MCPhysReg RegList12[] = {
     196             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     197             :     };
     198         748 :     if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
     199        2229 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     200         743 :       return false;
     201             :     }
     202             :   }
     203             : 
     204       16278 :   if (LocVT == MVT::f64) {
     205             :     static const MCPhysReg RegList13[] = {
     206             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     207             :     };
     208             :     static const MCPhysReg RegList14[] = {
     209             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     210             :     };
     211         704 :     if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
     212        2058 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     213         686 :       return false;
     214             :     }
     215             :   }
     216             : 
     217       22180 :   if (LocVT == MVT::v1i64 ||
     218       13459 :       LocVT == MVT::v2i32 ||
     219       11545 :       LocVT == MVT::v4i16 ||
     220       10263 :       LocVT == MVT::v8i8 ||
     221        9691 :       LocVT == MVT::v1f64 ||
     222       17029 :       LocVT == MVT::v2f32 ||
     223        4788 :       LocVT == MVT::v4f16) {
     224             :     static const MCPhysReg RegList15[] = {
     225             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     226             :     };
     227             :     static const MCPhysReg RegList16[] = {
     228             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     229             :     };
     230        2841 :     if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
     231        8520 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     232        2840 :       return false;
     233             :     }
     234             :   }
     235             : 
     236       13329 :   if (LocVT == MVT::f128 ||
     237        6820 :       LocVT == MVT::v2i64 ||
     238        4399 :       LocVT == MVT::v4i32 ||
     239        2509 :       LocVT == MVT::v8i16 ||
     240        1129 :       LocVT == MVT::v16i8 ||
     241         604 :       LocVT == MVT::v4f32 ||
     242        5217 :       LocVT == MVT::v2f64 ||
     243         302 :       LocVT == MVT::v8f16) {
     244             :     static const MCPhysReg RegList17[] = {
     245             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     246             :     };
     247        4419 :     if (unsigned Reg = State.AllocateReg(RegList17)) {
     248       13242 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     249        4414 :       return false;
     250             :     }
     251             :   }
     252             : 
     253         597 :   if (LocVT == MVT::i1 ||
     254         398 :       LocVT == MVT::i8 ||
     255         597 :       LocVT == MVT::i16 ||
     256         199 :       LocVT == MVT::f16) {
     257           0 :     unsigned Offset18 = State.AllocateStack(8, 8);
     258           0 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
     259           0 :     return false;
     260             :   }
     261             : 
     262         334 :   if (LocVT == MVT::i32 ||
     263         135 :       LocVT == MVT::f32) {
     264          69 :     unsigned Offset19 = State.AllocateStack(8, 8);
     265         207 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
     266          69 :     return false;
     267             :   }
     268             : 
     269         159 :   if (LocVT == MVT::i64 ||
     270          40 :       LocVT == MVT::f64 ||
     271          22 :       LocVT == MVT::v1f64 ||
     272          22 :       LocVT == MVT::v2f32 ||
     273          22 :       LocVT == MVT::v1i64 ||
     274          22 :       LocVT == MVT::v2i32 ||
     275          22 :       LocVT == MVT::v4i16 ||
     276         152 :       LocVT == MVT::v8i8 ||
     277          11 :       LocVT == MVT::v4f16) {
     278         120 :     unsigned Offset20 = State.AllocateStack(8, 8);
     279         360 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
     280         120 :     return false;
     281             :   }
     282             : 
     283          19 :   if (LocVT == MVT::f128 ||
     284          15 :       LocVT == MVT::v2i64 ||
     285          12 :       LocVT == MVT::v4i32 ||
     286          12 :       LocVT == MVT::v8i16 ||
     287          12 :       LocVT == MVT::v16i8 ||
     288          12 :       LocVT == MVT::v4f32 ||
     289          22 :       LocVT == MVT::v2f64 ||
     290           6 :       LocVT == MVT::v8f16) {
     291           5 :     unsigned Offset21 = State.AllocateStack(16, 16);
     292          15 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
     293           5 :     return false;
     294             :   }
     295             : 
     296             :   return true;  // CC didn't match.
     297             : }
     298             : 
     299             : 
     300        7779 : static bool CC_AArch64_DarwinPCS(unsigned ValNo, MVT ValVT,
     301             :                                  MVT LocVT, CCValAssign::LocInfo LocInfo,
     302             :                                  ISD::ArgFlagsTy ArgFlags, CCState &State) {
     303             : 
     304       15558 :   if (LocVT == MVT::iPTR) {
     305           0 :     LocVT = MVT::i64;
     306           0 :     LocInfo = CCValAssign::BCvt;
     307             :   }
     308             : 
     309       15558 :   if (LocVT == MVT::v2f32) {
     310          98 :     LocVT = MVT::v2i32;
     311          98 :     LocInfo = CCValAssign::BCvt;
     312             :   }
     313             : 
     314       23240 :   if (LocVT == MVT::v2f64 ||
     315       15353 :       LocVT == MVT::v4f32 ||
     316        7574 :       LocVT == MVT::f128) {
     317         221 :     LocVT = MVT::v2i64;
     318         221 :     LocInfo = CCValAssign::BCvt;
     319             :   }
     320             : 
     321        7779 :   if (ArgFlags.isSRet()) {
     322          54 :     if (LocVT == MVT::i64) {
     323          27 :       if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
     324          81 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     325          27 :         return false;
     326             :       }
     327             :     }
     328             :   }
     329             : 
     330        7752 :   if (ArgFlags.isByVal()) {
     331           0 :     State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
     332           0 :     return false;
     333             :   }
     334             : 
     335        7752 :   if (ArgFlags.isSwiftSelf()) {
     336          86 :     if (LocVT == MVT::i64) {
     337          43 :       if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
     338         129 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     339          43 :         return false;
     340             :       }
     341             :     }
     342             :   }
     343             : 
     344        7709 :   if (ArgFlags.isSwiftError()) {
     345          92 :     if (LocVT == MVT::i64) {
     346          46 :       if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
     347         138 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     348          46 :         return false;
     349             :       }
     350             :     }
     351             :   }
     352             : 
     353        7663 :   if (ArgFlags.isInConsecutiveRegs()) {
     354         273 :     if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     355             :         return false;
     356             :   }
     357             : 
     358       22154 :   if (LocVT == MVT::i1 ||
     359       14573 :       LocVT == MVT::i8 ||
     360        7183 :       LocVT == MVT::i16) {
     361         273 :     LocVT = MVT::i32;
     362         273 :     if (ArgFlags.isSExt())
     363         105 :         LocInfo = CCValAssign::SExt;
     364         168 :     else if (ArgFlags.isZExt())
     365         106 :         LocInfo = CCValAssign::ZExt;
     366             :     else
     367          62 :         LocInfo = CCValAssign::AExt;
     368             :   }
     369             : 
     370       14780 :   if (LocVT == MVT::i32) {
     371             :     static const MCPhysReg RegList1[] = {
     372             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     373             :     };
     374             :     static const MCPhysReg RegList2[] = {
     375             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     376             :     };
     377        1273 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     378        3468 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     379        1156 :       return false;
     380             :     }
     381             :   }
     382             : 
     383       12468 :   if (LocVT == MVT::i64) {
     384        4348 :     if (ArgFlags.isSplit()) {
     385             :       static const MCPhysReg RegList3[] = {
     386             :         AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6
     387             :       };
     388             :       static const MCPhysReg RegList4[] = {
     389             :         AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6
     390             :       };
     391          63 :       if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     392         129 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     393          43 :         return false;
     394             :       }
     395             :     }
     396             :   }
     397             : 
     398       12382 :   if (LocVT == MVT::i64) {
     399        4305 :     if (ArgFlags.isSplit()) {
     400             :       static const MCPhysReg ShadowRegList5[] = {
     401             :         AArch64::X7
     402             :       };
     403          20 :       unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
     404          60 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
     405          20 :       return false;
     406             :     }
     407             :   }
     408             : 
     409        6171 :   if (LocVT == MVT::i64) {
     410             :     static const MCPhysReg RegList7[] = {
     411             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     412             :     };
     413             :     static const MCPhysReg RegList8[] = {
     414             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     415             :     };
     416        4285 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
     417        7830 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     418        2610 :       return false;
     419             :     }
     420             :   }
     421             : 
     422        7122 :   if (LocVT == MVT::f16) {
     423             :     static const MCPhysReg RegList9[] = {
     424             :       AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
     425             :     };
     426             :     static const MCPhysReg RegList10[] = {
     427             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     428             :     };
     429          10 :     if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
     430          30 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     431          10 :       return false;
     432             :     }
     433             :   }
     434             : 
     435        7102 :   if (LocVT == MVT::f32) {
     436             :     static const MCPhysReg RegList11[] = {
     437             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     438             :     };
     439             :     static const MCPhysReg RegList12[] = {
     440             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     441             :     };
     442         270 :     if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
     443         771 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     444         257 :       return false;
     445             :     }
     446             :   }
     447             : 
     448        6588 :   if (LocVT == MVT::f64) {
     449             :     static const MCPhysReg RegList13[] = {
     450             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     451             :     };
     452             :     static const MCPhysReg RegList14[] = {
     453             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     454             :     };
     455         277 :     if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
     456         747 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     457         249 :       return false;
     458             :     }
     459             :   }
     460             : 
     461        9060 :   if (LocVT == MVT::v1i64 ||
     462        5727 :       LocVT == MVT::v2i32 ||
     463        5426 :       LocVT == MVT::v4i16 ||
     464        5254 :       LocVT == MVT::v8i8 ||
     465        5093 :       LocVT == MVT::v1f64 ||
     466        8061 :       LocVT == MVT::v2f32 ||
     467        2508 :       LocVT == MVT::v4f16) {
     468             :     static const MCPhysReg RegList15[] = {
     469             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     470             :     };
     471             :     static const MCPhysReg RegList16[] = {
     472             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     473             :     };
     474         538 :     if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
     475        1602 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     476         534 :       return false;
     477             :     }
     478             :   }
     479             : 
     480        7229 :   if (LocVT == MVT::v2i64 ||
     481        4246 :       LocVT == MVT::v4i32 ||
     482        3990 :       LocVT == MVT::v8i16 ||
     483        3788 :       LocVT == MVT::v16i8 ||
     484        3674 :       LocVT == MVT::v4f32 ||
     485        6185 :       LocVT == MVT::v2f64 ||
     486        1837 :       LocVT == MVT::v8f16) {
     487             :     static const MCPhysReg RegList17[] = {
     488             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     489             :     };
     490         674 :     if (unsigned Reg = State.AllocateReg(RegList17)) {
     491        2010 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     492         670 :       return false;
     493             :     }
     494             :   }
     495             : 
     496        3682 :   if (ValVT == MVT::i1 || ValVT == MVT::i8) {
     497          39 :     unsigned Offset18 = State.AllocateStack(1, 1);
     498         117 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
     499          39 :     return false;
     500             :   }
     501             : 
     502        3596 :   if (ValVT == MVT::i16 || ValVT == MVT::f16) {
     503           8 :     unsigned Offset19 = State.AllocateStack(2, 2);
     504          24 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
     505           8 :     return false;
     506             :   }
     507             : 
     508        5312 :   if (LocVT == MVT::i32 ||
     509        1724 :       LocVT == MVT::f32) {
     510          83 :     unsigned Offset20 = State.AllocateStack(4, 4);
     511         249 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
     512          83 :     return false;
     513             :   }
     514             : 
     515        1747 :   if (LocVT == MVT::i64 ||
     516          44 :       LocVT == MVT::f64 ||
     517          16 :       LocVT == MVT::v1f64 ||
     518          16 :       LocVT == MVT::v2f32 ||
     519          16 :       LocVT == MVT::v1i64 ||
     520          12 :       LocVT == MVT::v2i32 ||
     521           8 :       LocVT == MVT::v4i16 ||
     522        1719 :       LocVT == MVT::v8i8 ||
     523           4 :       LocVT == MVT::v4f16) {
     524        1707 :     unsigned Offset21 = State.AllocateStack(8, 8);
     525        5121 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
     526        1707 :     return false;
     527             :   }
     528             : 
     529           8 :   if (LocVT == MVT::v2i64 ||
     530           4 :       LocVT == MVT::v4i32 ||
     531           0 :       LocVT == MVT::v8i16 ||
     532           0 :       LocVT == MVT::v16i8 ||
     533           0 :       LocVT == MVT::v4f32 ||
     534           4 :       LocVT == MVT::v2f64 ||
     535           0 :       LocVT == MVT::v8f16) {
     536           4 :     unsigned Offset22 = State.AllocateStack(16, 16);
     537          12 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset22, LocVT, LocInfo));
     538           4 :     return false;
     539             :   }
     540             : 
     541             :   return true;  // CC didn't match.
     542             : }
     543             : 
     544             : 
     545          48 : static bool CC_AArch64_DarwinPCS_VarArg(unsigned ValNo, MVT ValVT,
     546             :                                         MVT LocVT, CCValAssign::LocInfo LocInfo,
     547             :                                         ISD::ArgFlagsTy ArgFlags, CCState &State) {
     548             : 
     549          96 :   if (LocVT == MVT::iPTR) {
     550           0 :     LocVT = MVT::i64;
     551           0 :     LocInfo = CCValAssign::BCvt;
     552             :   }
     553             : 
     554          96 :   if (LocVT == MVT::v2f32) {
     555           0 :     LocVT = MVT::v2i32;
     556           0 :     LocInfo = CCValAssign::BCvt;
     557             :   }
     558             : 
     559         144 :   if (LocVT == MVT::v2f64 ||
     560          96 :       LocVT == MVT::v4f32 ||
     561          48 :       LocVT == MVT::f128) {
     562           0 :     LocVT = MVT::v2i64;
     563           0 :     LocInfo = CCValAssign::BCvt;
     564             :   }
     565             : 
     566          48 :   if (ArgFlags.isInConsecutiveRegs()) {
     567           5 :     if (CC_AArch64_Custom_Stack_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     568             :         return false;
     569             :   }
     570             : 
     571         128 :   if (LocVT == MVT::i8 ||
     572          84 :       LocVT == MVT::i16 ||
     573          41 :       LocVT == MVT::i32) {
     574          35 :     LocVT = MVT::i64;
     575          35 :     if (ArgFlags.isSExt())
     576             :         LocInfo = CCValAssign::SExt;
     577          35 :     else if (ArgFlags.isZExt())
     578             :         LocInfo = CCValAssign::ZExt;
     579             :     else
     580          35 :         LocInfo = CCValAssign::AExt;
     581             :   }
     582             : 
     583         129 :   if (LocVT == MVT::f16 ||
     584          43 :       LocVT == MVT::f32) {
     585           2 :     LocVT = MVT::f64;
     586           2 :     LocInfo = CCValAssign::FPExt;
     587             :   }
     588             : 
     589          86 :   if (LocVT == MVT::i64) {
     590          38 :     if (ArgFlags.isSplit()) {
     591           1 :       unsigned Offset1 = State.AllocateStack(8, 16);
     592           3 :       State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
     593           1 :       return false;
     594             :     }
     595             :   }
     596             : 
     597          47 :   if (LocVT == MVT::i64 ||
     598           6 :       LocVT == MVT::f64 ||
     599           2 :       LocVT == MVT::v1i64 ||
     600           2 :       LocVT == MVT::v2i32 ||
     601           2 :       LocVT == MVT::v4i16 ||
     602           2 :       LocVT == MVT::v8i8 ||
     603           2 :       LocVT == MVT::v1f64 ||
     604          44 :       LocVT == MVT::v2f32 ||
     605           1 :       LocVT == MVT::v4f16) {
     606          41 :     unsigned Offset2 = State.AllocateStack(8, 8);
     607         123 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
     608          41 :     return false;
     609             :   }
     610             : 
     611           2 :   if (LocVT == MVT::v2i64 ||
     612           1 :       LocVT == MVT::v4i32 ||
     613           0 :       LocVT == MVT::v8i16 ||
     614           0 :       LocVT == MVT::v16i8 ||
     615           0 :       LocVT == MVT::v4f32 ||
     616           1 :       LocVT == MVT::v2f64 ||
     617           0 :       LocVT == MVT::v8f16) {
     618           1 :     unsigned Offset3 = State.AllocateStack(16, 16);
     619           3 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset3, LocVT, LocInfo));
     620           1 :     return false;
     621             :   }
     622             : 
     623             :   return true;  // CC didn't match.
     624             : }
     625             : 
     626             : 
     627           8 : static bool CC_AArch64_GHC(unsigned ValNo, MVT ValVT,
     628             :                            MVT LocVT, CCValAssign::LocInfo LocInfo,
     629             :                            ISD::ArgFlagsTy ArgFlags, CCState &State) {
     630             : 
     631           8 :   if (LocVT == MVT::iPTR) {
     632           0 :     LocVT = MVT::i64;
     633           0 :     LocInfo = CCValAssign::BCvt;
     634             :   }
     635             : 
     636          16 :   if (LocVT == MVT::v1i64 ||
     637          16 :       LocVT == MVT::v2i32 ||
     638          16 :       LocVT == MVT::v4i16 ||
     639          24 :       LocVT == MVT::v8i8 ||
     640           8 :       LocVT == MVT::v2f32) {
     641             :     LocVT = MVT::f64;
     642             :     LocInfo = CCValAssign::BCvt;
     643             :   }
     644             : 
     645          16 :   if (LocVT == MVT::v2i64 ||
     646          16 :       LocVT == MVT::v4i32 ||
     647          16 :       LocVT == MVT::v8i16 ||
     648          16 :       LocVT == MVT::v16i8 ||
     649          24 :       LocVT == MVT::v4f32 ||
     650           8 :       LocVT == MVT::f128) {
     651             :     LocVT = MVT::v2f64;
     652             :     LocInfo = CCValAssign::BCvt;
     653             :   }
     654             : 
     655           8 :   if (LocVT == MVT::v2f64) {
     656             :     static const MCPhysReg RegList1[] = {
     657             :       AArch64::Q4, AArch64::Q5
     658             :     };
     659           0 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
     660           0 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     661           0 :       return false;
     662             :     }
     663             :   }
     664             : 
     665           8 :   if (LocVT == MVT::f32) {
     666             :     static const MCPhysReg RegList2[] = {
     667             :       AArch64::S8, AArch64::S9, AArch64::S10, AArch64::S11
     668             :     };
     669           2 :     if (unsigned Reg = State.AllocateReg(RegList2)) {
     670           4 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     671           2 :       return false;
     672             :     }
     673             :   }
     674             : 
     675           6 :   if (LocVT == MVT::f64) {
     676             :     static const MCPhysReg RegList3[] = {
     677             :       AArch64::D12, AArch64::D13, AArch64::D14, AArch64::D15
     678             :     };
     679           1 :     if (unsigned Reg = State.AllocateReg(RegList3)) {
     680           2 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     681           1 :       return false;
     682             :     }
     683             :   }
     684             : 
     685          10 :   if (LocVT == MVT::i8 ||
     686          10 :       LocVT == MVT::i16 ||
     687           5 :       LocVT == MVT::i32) {
     688           0 :     LocVT = MVT::i64;
     689           0 :     if (ArgFlags.isSExt())
     690             :         LocInfo = CCValAssign::SExt;
     691           0 :     else if (ArgFlags.isZExt())
     692             :         LocInfo = CCValAssign::ZExt;
     693             :     else
     694           0 :         LocInfo = CCValAssign::AExt;
     695             :   }
     696             : 
     697           5 :   if (LocVT == MVT::i64) {
     698             :     static const MCPhysReg RegList4[] = {
     699             :       AArch64::X19, AArch64::X20, AArch64::X21, AArch64::X22, AArch64::X23, AArch64::X24, AArch64::X25, AArch64::X26, AArch64::X27, AArch64::X28
     700             :     };
     701           5 :     if (unsigned Reg = State.AllocateReg(RegList4)) {
     702          10 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     703           5 :       return false;
     704             :     }
     705             :   }
     706             : 
     707             :   return true;  // CC didn't match.
     708             : }
     709             : 
     710             : 
     711         129 : static bool CC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
     712             :                                  MVT LocVT, CCValAssign::LocInfo LocInfo,
     713             :                                  ISD::ArgFlagsTy ArgFlags, CCState &State) {
     714             : 
     715         258 :   if (LocVT == MVT::i1 ||
     716         258 :       LocVT == MVT::i8 ||
     717         129 :       LocVT == MVT::i16) {
     718           6 :     LocVT = MVT::i32;
     719           6 :     if (ArgFlags.isSExt())
     720             :         LocInfo = CCValAssign::SExt;
     721           6 :     else if (ArgFlags.isZExt())
     722             :         LocInfo = CCValAssign::ZExt;
     723             :     else
     724           0 :         LocInfo = CCValAssign::AExt;
     725             :   }
     726             : 
     727         129 :   if (LocVT == MVT::i32) {
     728          27 :     if (unsigned Reg = State.AllocateReg(AArch64::W0, AArch64::X0)) {
     729           6 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     730           3 :       return false;
     731             :     }
     732             :   }
     733             : 
     734         126 :   if (LocVT == MVT::i64) {
     735         102 :     if (unsigned Reg = State.AllocateReg(AArch64::X0, AArch64::W0)) {
     736          34 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     737          17 :       return false;
     738             :     }
     739             :   }
     740             : 
     741         194 :   if (LocVT == MVT::i32 ||
     742          85 :       LocVT == MVT::f32) {
     743          24 :     unsigned Offset1 = State.AllocateStack(4, 4);
     744          48 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
     745          24 :     return false;
     746             :   }
     747             : 
     748          85 :   if (LocVT == MVT::i64 ||
     749           0 :       LocVT == MVT::f64) {
     750          85 :     unsigned Offset2 = State.AllocateStack(8, 8);
     751         170 :     State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
     752          85 :     return false;
     753             :   }
     754             : 
     755             :   return true;  // CC didn't match.
     756             : }
     757             : 
     758             : 
     759          19 : static bool CC_AArch64_Win64_VarArg(unsigned ValNo, MVT ValVT,
     760             :                                     MVT LocVT, CCValAssign::LocInfo LocInfo,
     761             :                                     ISD::ArgFlagsTy ArgFlags, CCState &State) {
     762             : 
     763          38 :   if (LocVT == MVT::f16 ||
     764          19 :       LocVT == MVT::f32) {
     765             :     LocVT = MVT::f64;
     766             :     LocInfo = CCValAssign::FPExt;
     767             :   }
     768             : 
     769          19 :   if (LocVT == MVT::f64) {
     770          10 :     LocVT = MVT::i64;
     771          10 :     LocInfo = CCValAssign::BCvt;
     772             :   }
     773             : 
     774          19 :   if (!CC_AArch64_AAPCS(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
     775             :     return false;
     776             : 
     777           0 :   return true;  // CC didn't match.
     778             : }
     779             : 
     780             : 
     781       23781 : static bool RetCC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
     782             :                                 MVT LocVT, CCValAssign::LocInfo LocInfo,
     783             :                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
     784             : 
     785       23781 :   if (LocVT == MVT::iPTR) {
     786           0 :     LocVT = MVT::i64;
     787           0 :     LocInfo = CCValAssign::BCvt;
     788             :   }
     789             : 
     790       23781 :   if (LocVT == MVT::v2f32) {
     791         675 :     LocVT = MVT::v2i32;
     792         675 :     LocInfo = CCValAssign::BCvt;
     793             :   }
     794             : 
     795       46893 :   if (LocVT == MVT::v2f64 ||
     796       23112 :       LocVT == MVT::v4f32) {
     797             :     LocVT = MVT::v2i64;
     798             :     LocInfo = CCValAssign::BCvt;
     799             :   }
     800             : 
     801       23781 :   if (ArgFlags.isSwiftError()) {
     802          48 :     if (LocVT == MVT::i64) {
     803          48 :       if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
     804          96 :         State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     805          48 :         return false;
     806             :       }
     807             :     }
     808             :   }
     809             : 
     810       23733 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
     811        2578 :     if (LocVT == MVT::v2i32 ||
     812        2458 :         LocVT == MVT::v2f32 ||
     813        2398 :         LocVT == MVT::v4i16 ||
     814        3687 :         LocVT == MVT::v4f16 ||
     815        1169 :         LocVT == MVT::v8i8) {
     816             :       LocVT = MVT::f64;
     817             :       LocInfo = CCValAssign::BCvt;
     818             :     }
     819             :   }
     820             : 
     821       23733 :   if (State.getMachineFunction().getDataLayout().isBigEndian()) {
     822        2518 :     if (LocVT == MVT::v2i64 ||
     823        2338 :         LocVT == MVT::v2f64 ||
     824        2278 :         LocVT == MVT::v4i32 ||
     825        2218 :         LocVT == MVT::v4f32 ||
     826        2158 :         LocVT == MVT::v8i16 ||
     827        3447 :         LocVT == MVT::v8f16 ||
     828        1049 :         LocVT == MVT::v16i8) {
     829             :       LocVT = MVT::f128;
     830             :       LocInfo = CCValAssign::BCvt;
     831             :     }
     832             :   }
     833             : 
     834       47465 :   if (LocVT == MVT::i1 ||
     835       47461 :       LocVT == MVT::i8 ||
     836       23728 :       LocVT == MVT::i16) {
     837           6 :     LocVT = MVT::i32;
     838           6 :     if (ArgFlags.isSExt())
     839             :         LocInfo = CCValAssign::SExt;
     840           3 :     else if (ArgFlags.isZExt())
     841             :         LocInfo = CCValAssign::ZExt;
     842             :     else
     843           2 :         LocInfo = CCValAssign::AExt;
     844             :   }
     845             : 
     846       23733 :   if (LocVT == MVT::i32) {
     847             :     static const MCPhysReg RegList1[] = {
     848             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     849             :     };
     850             :     static const MCPhysReg RegList2[] = {
     851             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     852             :     };
     853        5279 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     854       10558 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     855        5279 :       return false;
     856             :     }
     857             :   }
     858             : 
     859       18454 :   if (LocVT == MVT::i64) {
     860             :     static const MCPhysReg RegList3[] = {
     861             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     862             :     };
     863             :     static const MCPhysReg RegList4[] = {
     864             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     865             :     };
     866        3304 :     if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     867        6588 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     868        3294 :       return false;
     869             :     }
     870             :   }
     871             : 
     872       15160 :   if (LocVT == MVT::f16) {
     873             :     static const MCPhysReg RegList5[] = {
     874             :       AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
     875             :     };
     876             :     static const MCPhysReg RegList6[] = {
     877             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     878             :     };
     879         284 :     if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
     880         568 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     881         284 :       return false;
     882             :     }
     883             :   }
     884             : 
     885       14876 :   if (LocVT == MVT::f32) {
     886             :     static const MCPhysReg RegList7[] = {
     887             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     888             :     };
     889             :     static const MCPhysReg RegList8[] = {
     890             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     891             :     };
     892        1192 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
     893        2384 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     894        1192 :       return false;
     895             :     }
     896             :   }
     897             : 
     898       13684 :   if (LocVT == MVT::f64) {
     899             :     static const MCPhysReg RegList9[] = {
     900             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     901             :     };
     902             :     static const MCPhysReg RegList10[] = {
     903             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     904             :     };
     905        1189 :     if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
     906        2378 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     907        1189 :       return false;
     908             :     }
     909             :   }
     910             : 
     911       24526 :   if (LocVT == MVT::v1i64 ||
     912       22373 :       LocVT == MVT::v2i32 ||
     913       19508 :       LocVT == MVT::v4i16 ||
     914       17348 :       LocVT == MVT::v8i8 ||
     915       16084 :       LocVT == MVT::v1f64 ||
     916       28299 :       LocVT == MVT::v2f32 ||
     917        7902 :       LocVT == MVT::v4f16) {
     918             :     static const MCPhysReg RegList11[] = {
     919             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     920             :     };
     921             :     static const MCPhysReg RegList12[] = {
     922             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     923             :     };
     924        4824 :     if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
     925        9648 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     926        4824 :       return false;
     927             :     }
     928             :   }
     929             : 
     930       14642 :   if (LocVT == MVT::f128 ||
     931       11290 :       LocVT == MVT::v2i64 ||
     932        6830 :       LocVT == MVT::v4i32 ||
     933        3680 :       LocVT == MVT::v8i16 ||
     934        1347 :       LocVT == MVT::v16i8 ||
     935         356 :       LocVT == MVT::v4f32 ||
     936        8027 :       LocVT == MVT::v2f64 ||
     937         178 :       LocVT == MVT::v8f16) {
     938             :     static const MCPhysReg RegList13[] = {
     939             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     940             :     };
     941        7659 :     if (unsigned Reg = State.AllocateReg(RegList13)) {
     942       15318 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     943        7659 :       return false;
     944             :     }
     945             :   }
     946             : 
     947             :   return true;  // CC didn't match.
     948             : }
     949             : 
     950             : 
     951          21 : static bool RetCC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
     952             :                                     MVT LocVT, CCValAssign::LocInfo LocInfo,
     953             :                                     ISD::ArgFlagsTy ArgFlags, CCState &State) {
     954             : 
     955          21 :   if (LocVT == MVT::i32) {
     956             :     static const MCPhysReg RegList1[] = {
     957             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     958             :     };
     959             :     static const MCPhysReg RegList2[] = {
     960             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     961             :     };
     962           6 :     if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
     963          12 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     964           6 :       return false;
     965             :     }
     966             :   }
     967             : 
     968          15 :   if (LocVT == MVT::i64) {
     969             :     static const MCPhysReg RegList3[] = {
     970             :       AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
     971             :     };
     972             :     static const MCPhysReg RegList4[] = {
     973             :       AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
     974             :     };
     975          15 :     if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
     976          30 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     977          15 :       return false;
     978             :     }
     979             :   }
     980             : 
     981           0 :   if (LocVT == MVT::f32) {
     982             :     static const MCPhysReg RegList5[] = {
     983             :       AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
     984             :     };
     985             :     static const MCPhysReg RegList6[] = {
     986             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
     987             :     };
     988           0 :     if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
     989           0 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
     990           0 :       return false;
     991             :     }
     992             :   }
     993             : 
     994           0 :   if (LocVT == MVT::f64) {
     995             :     static const MCPhysReg RegList7[] = {
     996             :       AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
     997             :     };
     998             :     static const MCPhysReg RegList8[] = {
     999             :       AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
    1000             :     };
    1001           0 :     if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
    1002           0 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
    1003           0 :       return false;
    1004             :     }
    1005             :   }
    1006             : 
    1007             :   return true;  // CC didn't match.
    1008             : }

Generated by: LCOV version 1.13