cpupara.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. {
  2. Copyright (c) 2013-2014 by Jonas Maebe, Florian Klaempfl and others
  3. AArch64 specific calling conventions
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. { AArch64 specific calling conventions are handled by this unit
  18. }
  19. unit cpupara;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. globtype,globals,
  24. aasmtai,aasmdata,
  25. cpuinfo,cpubase,cgbase,cgutils,
  26. symconst,symbase,symtype,symdef,parabase,paramgr;
  27. type
  28. taarch64paramanager = class(tparamanager)
  29. function get_volatile_registers_int(calloption: tproccalloption): tcpuregisterset; override;
  30. function get_volatile_registers_fpu(calloption: tproccalloption): tcpuregisterset; override;
  31. function get_volatile_registers_mm(calloption: tproccalloption): tcpuregisterset; override;
  32. function push_addr_param(varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean; override;
  33. function ret_in_param(def: tdef; pd: tabstractprocdef):boolean;override;
  34. function create_paraloc_info(p: tabstractprocdef; side: tcallercallee):longint;override;
  35. function create_varargs_paraloc_info(p: tabstractprocdef; varargspara: tvarargsparalist):longint;override;
  36. function get_funcretloc(p: tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;override;
  37. function param_use_paraloc(const cgpara: tcgpara): boolean; override;
  38. private
  39. curintreg,
  40. curmmreg: tsuperregister;
  41. curstackoffset: aword;
  42. procedure init_para_alloc_values;
  43. procedure alloc_para(out result: tcgpara; p: tabstractprocdef; varspez: tvarspez; side: tcallercallee; paradef: tdef; isvariadic, isdelphinestedcc: boolean);
  44. procedure create_paraloc_info_intern(p: tabstractprocdef; side: tcallercallee; paras: tparalist; isvariadic: boolean);
  45. end;
  46. implementation
  47. uses
  48. verbose,systems,cutils,
  49. rgobj,
  50. defutil,symsym,symtable;
  51. const
  52. RS_FIRST_INT_PARAM_SUPREG = RS_X0;
  53. RS_LAST_INT_PARAM_SUPREG = RS_X7;
  54. { Q0/D0/S0/H0/B0 all have the same superregister number }
  55. RS_FIRST_MM_PARAM_SUPREG = RS_D0;
  56. RS_LAST_MM_PARAM_SUPREG = RS_D7;
  57. function taarch64paramanager.get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;
  58. begin
  59. result:=VOLATILE_INTREGISTERS
  60. end;
  61. function taarch64paramanager.get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;
  62. begin
  63. result:=[];
  64. end;
  65. function taarch64paramanager.get_volatile_registers_mm(calloption: tproccalloption): tcpuregisterset;
  66. begin
  67. result:=VOLATILE_MMREGISTERS;
  68. end;
  69. function is_hfa_internal(p: tdef; var basedef: tdef; var elecount: longint): boolean;
  70. var
  71. i: longint;
  72. sym: tsym;
  73. tmpelecount: longint;
  74. begin
  75. result:=false;
  76. case p.typ of
  77. arraydef:
  78. begin
  79. if is_special_array(p) then
  80. exit;
  81. case tarraydef(p).elementdef.typ of
  82. floatdef:
  83. begin
  84. { an array of empty records has no influence }
  85. if tarraydef(p).elementdef.size=0 then
  86. begin
  87. result:=true;
  88. exit
  89. end;
  90. tmpelecount:=0;
  91. if not is_hfa_internal(tarraydef(p).elementdef,basedef,tmpelecount) then
  92. exit;
  93. { tmpelecount now contains the number of hfa elements in a
  94. single array element (e.g. 2 if it's an array of a record
  95. containing two singles) -> multiply by number of elements
  96. in the array }
  97. inc(elecount,tarraydef(p).elecount*tmpelecount);
  98. if elecount>4 then
  99. exit;
  100. end;
  101. else
  102. result:=is_hfa_internal(tarraydef(p).elementdef,basedef,elecount);
  103. end;
  104. end;
  105. floatdef:
  106. begin
  107. if not assigned(basedef) then
  108. basedef:=p
  109. else if basedef<>p then
  110. exit;
  111. inc(elecount);
  112. result:=true;
  113. end;
  114. recorddef:
  115. begin
  116. for i:=0 to tabstractrecorddef(p).symtable.symlist.count-1 do
  117. begin
  118. sym:=tsym(tabstractrecorddef(p).symtable.symlist[i]);
  119. if sym.typ<>fieldvarsym then
  120. continue;
  121. if not is_hfa_internal(tfieldvarsym(sym).vardef,basedef,elecount) then
  122. exit
  123. end;
  124. result:=true;
  125. end;
  126. else
  127. exit
  128. end;
  129. end;
  130. { Returns whether a def is a "homogeneous float array" at the machine level.
  131. This means that in the memory layout, the def only consists of maximally
  132. 4 floating point values that appear consecutively in memory }
  133. function is_hfa(p: tdef; out basedef: tdef) : boolean;
  134. var
  135. elecount: longint;
  136. begin
  137. result:=false;
  138. basedef:=nil;
  139. elecount:=0;
  140. result:=is_hfa_internal(p,basedef,elecount);
  141. result:=
  142. result and
  143. (elecount>0) and
  144. (p.size=basedef.size*elecount)
  145. end;
  146. function getparaloc(calloption: tproccalloption; p: tdef): tcgloc;
  147. var
  148. hfabasedef: tdef;
  149. begin
  150. { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
  151. if push_addr_param for the def is true
  152. }
  153. case p.typ of
  154. orddef:
  155. getparaloc:=LOC_REGISTER;
  156. floatdef:
  157. getparaloc:=LOC_MMREGISTER;
  158. enumdef:
  159. getparaloc:=LOC_REGISTER;
  160. pointerdef:
  161. getparaloc:=LOC_REGISTER;
  162. formaldef:
  163. getparaloc:=LOC_REGISTER;
  164. classrefdef:
  165. getparaloc:=LOC_REGISTER;
  166. recorddef:
  167. if not is_hfa(p,hfabasedef) then
  168. getparaloc:=LOC_REGISTER
  169. else
  170. getparaloc:=LOC_MMREGISTER;
  171. objectdef:
  172. getparaloc:=LOC_REGISTER;
  173. stringdef:
  174. if is_shortstring(p) or is_longstring(p) then
  175. getparaloc:=LOC_REFERENCE
  176. else
  177. getparaloc:=LOC_REGISTER;
  178. procvardef:
  179. getparaloc:=LOC_REGISTER;
  180. filedef:
  181. getparaloc:=LOC_REGISTER;
  182. arraydef:
  183. if not is_hfa(p,hfabasedef) then
  184. getparaloc:=LOC_REGISTER
  185. else
  186. getparaloc:=LOC_MMREGISTER;
  187. setdef:
  188. getparaloc:=LOC_REGISTER;
  189. variantdef:
  190. getparaloc:=LOC_REGISTER;
  191. { avoid problems with errornous definitions }
  192. errordef:
  193. getparaloc:=LOC_REGISTER;
  194. else
  195. internalerror(2002071001);
  196. end;
  197. end;
  198. function taarch64paramanager.push_addr_param(varspez: tvarspez; def :tdef; calloption: tproccalloption): boolean;
  199. var
  200. hfabasedef: tdef;
  201. begin
  202. result:=false;
  203. if varspez in [vs_var,vs_out,vs_constref] then
  204. begin
  205. result:=true;
  206. exit;
  207. end;
  208. case def.typ of
  209. objectdef:
  210. result:=is_object(def);
  211. recorddef:
  212. { ABI: any composite > 16 bytes that not a hfa/hva
  213. Special case: MWPascal, which passes all const parameters by
  214. reference for compatibility reasons
  215. }
  216. result:=
  217. ((varspez=vs_const) and
  218. (calloption=pocall_mwpascal)) or
  219. (not is_hfa(def,hfabasedef) and
  220. (def.size>16));
  221. variantdef,
  222. formaldef:
  223. result:=true;
  224. { arrays are composites and hence treated the same as records by the
  225. ABI (watch out for C, where an array is a pointer)
  226. Also: all other platforms pass const arrays by reference. Do the
  227. same here, because there is too much hacky code out there that
  228. relies on this ("array[0..0] of x" passed as const parameter and
  229. then indexed beyond its bounds) }
  230. arraydef:
  231. result:=
  232. (calloption in cdecl_pocalls) or
  233. is_open_array(def) or
  234. is_array_of_const(def) or
  235. is_array_constructor(def) or
  236. ((tarraydef(def).highrange>=tarraydef(def).lowrange) and
  237. ((varspez=vs_const) or
  238. (not is_hfa(def,hfabasedef) and
  239. (def.size>16))));
  240. setdef :
  241. result:=def.size>16;
  242. stringdef :
  243. result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
  244. end;
  245. end;
  246. function taarch64paramanager.ret_in_param(def: tdef; pd: tabstractprocdef): boolean;
  247. begin
  248. if handle_common_ret_in_param(def,pd,result) then
  249. exit;
  250. { ABI: if the parameter would be passed in registers, it is returned
  251. in those registers; otherwise, it's returned by reference }
  252. result:=push_addr_param(vs_value,def,pd.proccalloption);
  253. end;
  254. procedure taarch64paramanager.create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; paras: tparalist; isvariadic: boolean);
  255. var
  256. hp: tparavarsym;
  257. i: longint;
  258. begin
  259. for i:=0 to paras.count-1 do
  260. begin
  261. hp:=tparavarsym(paras[i]);
  262. { hidden function result parameter is passed in X8 (doesn't have to
  263. be valid on return) according to the ABI
  264. -- don't follow the ABI for managed types, because
  265. a) they are passed in registers as parameters, so we should also
  266. return them in a register to be ABI-compliant (which we can't
  267. because the entire compiler is built around the idea that
  268. they are returned by reference, for ref-counting performance
  269. and Delphi-compatibility reasons)
  270. b) there are hacks in the system unit that expect that you can
  271. call
  272. function f: com_interface;
  273. as
  274. procedure p(out o: obj);
  275. That can only work in case we do not use x8 to return them
  276. from the function, but the regular first parameter register.
  277. As the ABI says this behaviour is ok for C++ classes with a
  278. non-trivial copy constructor or destructor, it seems reasonable
  279. for us to do this for managed types as well.}
  280. if (vo_is_funcret in hp.varoptions) and
  281. not is_managed_type(hp.vardef) then
  282. begin
  283. hp.paraloc[side].reset;
  284. hp.paraloc[side].size:=OS_ADDR;
  285. hp.paraloc[side].alignment:=voidpointertype.alignment;
  286. hp.paraloc[side].intsize:=voidpointertype.size;
  287. hp.paraloc[side].def:=getpointerdef(hp.vardef);
  288. with hp.paraloc[side].add_location^ do
  289. begin
  290. size:=OS_ADDR;
  291. def:=hp.paraloc[side].def;
  292. loc:=LOC_REGISTER;
  293. register:=NR_X8;
  294. end
  295. end
  296. else
  297. alloc_para(hp.paraloc[side],p,hp.varspez,side,hp.vardef,isvariadic,
  298. (vo_is_parentfp in hp.varoptions) and
  299. (po_delphi_nested_cc in p.procoptions));
  300. end;
  301. end;
  302. function taarch64paramanager.get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;
  303. var
  304. retcgsize: tcgsize;
  305. begin
  306. if set_common_funcretloc_info(p,forcetempdef,retcgsize,result) then
  307. exit;
  308. { in this case, it must be returned in registers as if it were passed
  309. as the first parameter }
  310. init_para_alloc_values;
  311. alloc_para(result,p,vs_value,side,result.def,false,false);
  312. { sanity check (LOC_VOID for empty records) }
  313. if not assigned(result.location) or
  314. not(result.location^.loc in [LOC_REGISTER,LOC_MMREGISTER,LOC_VOID]) then
  315. internalerror(2014113001);
  316. end;
  317. function taarch64paramanager.param_use_paraloc(const cgpara: tcgpara): boolean;
  318. begin
  319. { we always set up a stack frame -> we can always access the parameters
  320. this way }
  321. result:=
  322. (cgpara.location^.loc=LOC_REFERENCE) and
  323. not assigned(cgpara.location^.next);
  324. end;
  325. procedure taarch64paramanager.init_para_alloc_values;
  326. begin
  327. curintreg:=RS_FIRST_INT_PARAM_SUPREG;
  328. curmmreg:=RS_FIRST_MM_PARAM_SUPREG;
  329. curstackoffset:=0;
  330. end;
  331. procedure taarch64paramanager.alloc_para(out result: tcgpara; p: tabstractprocdef; varspez: tvarspez; side: tcallercallee; paradef: tdef; isvariadic, isdelphinestedcc: boolean);
  332. var
  333. hfabasedef, locdef: tdef;
  334. paraloc: pcgparalocation;
  335. paralen, stackslotlen: asizeint;
  336. loc: tcgloc;
  337. paracgsize, locsize: tcgsize;
  338. firstparaloc: boolean;
  339. begin
  340. result.reset;
  341. { currently only support C-style array of const,
  342. there should be no location assigned to the vararg array itself }
  343. if (p.proccalloption in cstylearrayofconst) and
  344. is_array_of_const(paradef) then
  345. begin
  346. paraloc:=result.add_location;
  347. { hack: the paraloc must be valid, but is not actually used }
  348. paraloc^.loc:=LOC_REGISTER;
  349. paraloc^.register:=NR_X0;
  350. paraloc^.size:=OS_ADDR;
  351. exit;
  352. end;
  353. if push_addr_param(varspez,paradef,p.proccalloption) then
  354. begin
  355. paradef:=getpointerdef(paradef);
  356. loc:=LOC_REGISTER;
  357. paracgsize:=OS_ADDR;
  358. paralen:=tcgsize2size[OS_ADDR];
  359. end
  360. else
  361. begin
  362. if not is_special_array(paradef) then
  363. paralen:=paradef.size
  364. else
  365. paralen:=tcgsize2size[def_cgsize(paradef)];
  366. loc:=getparaloc(p.proccalloption,paradef);
  367. if (paradef.typ in [objectdef,arraydef,recorddef]) and
  368. not is_special_array(paradef) and
  369. (varspez in [vs_value,vs_const]) then
  370. paracgsize:=int_cgsize(paralen)
  371. else
  372. begin
  373. paracgsize:=def_cgsize(paradef);
  374. { for things like formaldef }
  375. if paracgsize=OS_NO then
  376. begin
  377. paracgsize:=OS_ADDR;
  378. paralen:=tcgsize2size[OS_ADDR];
  379. paradef:=voidpointertype;
  380. end;
  381. end
  382. end;
  383. { get hfa basedef if applicable }
  384. if not is_hfa(paradef,hfabasedef) then
  385. hfabasedef:=nil;
  386. result.size:=paracgsize;
  387. result.alignment:=std_param_align;
  388. result.intsize:=paralen;
  389. result.def:=paradef;
  390. { empty record: skipped (explicitly defined by Apple ABI, undefined
  391. by general ABI; libffi also skips them in all cases) }
  392. if not is_special_array(paradef) and
  393. (paradef.size=0) then
  394. begin
  395. paraloc:=result.add_location;
  396. paraloc^.loc:=LOC_VOID;
  397. paraloc^.def:=paradef;
  398. paraloc^.size:=OS_NO;
  399. exit;
  400. end;
  401. { sufficient registers left? }
  402. case loc of
  403. LOC_REGISTER:
  404. begin
  405. { In case of po_delphi_nested_cc, the parent frame pointer
  406. is always passed on the stack. }
  407. if isdelphinestedcc then
  408. loc:=LOC_REFERENCE
  409. else if curintreg+((paralen-1) shr 3)>RS_LAST_INT_PARAM_SUPREG then
  410. begin
  411. { not enough integer registers left -> no more register
  412. parameters, copy all to stack
  413. }
  414. curintreg:=succ(RS_LAST_INT_PARAM_SUPREG);
  415. loc:=LOC_REFERENCE;
  416. end;
  417. end;
  418. LOC_MMREGISTER:
  419. begin;
  420. { every hfa element must be passed in a separate register }
  421. if (assigned(hfabasedef) and
  422. (curmmreg+(paralen div hfabasedef.size)>RS_LAST_MM_PARAM_SUPREG)) or
  423. (curmmreg+((paralen-1) shr 3)>RS_LAST_MM_PARAM_SUPREG) then
  424. begin
  425. { not enough mm registers left -> no more register
  426. parameters, copy all to stack
  427. }
  428. curmmreg:=succ(RS_LAST_MM_PARAM_SUPREG);
  429. loc:=LOC_REFERENCE;
  430. end;
  431. end;
  432. end;
  433. { allocate registers/stack locations }
  434. firstparaloc:=true;
  435. repeat
  436. paraloc:=result.add_location;
  437. { set paraloc size/def }
  438. if assigned(hfabasedef) then
  439. begin
  440. locsize:=def_cgsize(hfabasedef);
  441. locdef:=hfabasedef;
  442. end
  443. { make sure we don't lose whether or not the type is signed }
  444. else if (loc=LOC_REGISTER) and
  445. (paradef.typ<>orddef) then
  446. begin
  447. locsize:=int_cgsize(paralen);
  448. locdef:=get_paraloc_def(paradef,paralen,firstparaloc);
  449. end
  450. else
  451. begin
  452. locsize:=paracgsize;
  453. locdef:=paradef;
  454. end;
  455. if locsize in [OS_NO,OS_128,OS_S128] then
  456. begin
  457. if paralen>4 then
  458. begin
  459. paraloc^.size:=OS_INT;
  460. paraloc^.def:=u64inttype;
  461. end
  462. else
  463. begin
  464. { for 3-byte records }
  465. paraloc^.size:=OS_32;
  466. paraloc^.def:=u32inttype;
  467. end;
  468. end
  469. else
  470. begin
  471. paraloc^.size:=locsize;
  472. paraloc^.def:=locdef;
  473. end;
  474. { paraloc loc }
  475. paraloc^.loc:=loc;
  476. { assign register/stack address }
  477. case loc of
  478. LOC_REGISTER:
  479. begin
  480. paraloc^.register:=newreg(R_INTREGISTER,curintreg,cgsize2subreg(R_INTREGISTER,paraloc^.size));
  481. inc(curintreg);
  482. dec(paralen,tcgsize2size[paraloc^.size]);
  483. { "The general ABI specifies that it is the callee's
  484. responsibility to sign or zero-extend arguments having fewer
  485. than 32 bits, and that unused bits in a register are
  486. unspecified. In iOS, however, the caller must perform such
  487. extensions, up to 32 bits." }
  488. if (target_info.abi=abi_aarch64_darwin) and
  489. (side=callerside) and
  490. is_ordinal(paradef) and
  491. (paradef.size<4) then
  492. paraloc^.size:=OS_32;
  493. { in case it's a composite, "The argument is passed as though
  494. it had been loaded into the registers from a double-word-
  495. aligned address with an appropriate sequence of LDR
  496. instructions loading consecutive registers from memory" ->
  497. in case of big endian, values in not completely filled
  498. registers must be shifted to the top bits }
  499. if (target_info.endian=endian_big) and
  500. not(paraloc^.size in [OS_64,OS_S64]) and
  501. (paradef.typ in [setdef,recorddef,arraydef,objectdef]) then
  502. paraloc^.shiftval:=-(8-tcgsize2size[paraloc^.size]);
  503. end;
  504. LOC_MMREGISTER:
  505. begin
  506. paraloc^.register:=newreg(R_MMREGISTER,curmmreg,cgsize2subreg(R_MMREGISTER,paraloc^.size));
  507. inc(curmmreg);
  508. dec(paralen,tcgsize2size[paraloc^.size]);
  509. end;
  510. LOC_REFERENCE:
  511. begin
  512. paraloc^.size:=paracgsize;
  513. paraloc^.loc:=LOC_REFERENCE;
  514. { the current stack offset may not be properly aligned in
  515. case we're on Darwin have allocated a non-variadic argument
  516. < 8 bytes previously }
  517. if target_info.abi=abi_aarch64_darwin then
  518. curstackoffset:=align(curstackoffset,paraloc^.def.alignment);
  519. { on Darwin, non-variadic arguments take up their actual size
  520. on the stack; on other platforms, they take up a multiple of
  521. 8 bytes }
  522. if (target_info.abi=abi_aarch64_darwin) and
  523. not isvariadic then
  524. stackslotlen:=paralen
  525. else
  526. stackslotlen:=align(paralen,8);
  527. { from the ABI: if arguments occupy partial stack space, they
  528. have to occupy the lowest significant bits of a register
  529. containing that value which is then stored to memory ->
  530. in case of big endian, skip the alignment bytes (if any) }
  531. if target_info.endian=endian_little then
  532. paraloc^.reference.offset:=curstackoffset
  533. else
  534. paraloc^.reference.offset:=curstackoffset+stackslotlen-paralen;
  535. if side=callerside then
  536. paraloc^.reference.index:=NR_STACK_POINTER_REG
  537. else
  538. begin
  539. paraloc^.reference.index:=NR_FRAME_POINTER_REG;
  540. inc(paraloc^.reference.offset,16);
  541. end;
  542. inc(curstackoffset,stackslotlen);
  543. paralen:=0
  544. end;
  545. else
  546. internalerror(2002071002);
  547. end;
  548. firstparaloc:=false;
  549. { <=0 for sign/zero-extended locations }
  550. until paralen<=0;
  551. end;
  552. function taarch64paramanager.create_paraloc_info(p: tabstractprocdef; side: tcallercallee):longint;
  553. begin
  554. init_para_alloc_values;
  555. create_paraloc_info_intern(p,side,p.paras,false);
  556. result:=curstackoffset;
  557. create_funcretloc_info(p,side);
  558. end;
  559. function taarch64paramanager.create_varargs_paraloc_info(p: tabstractprocdef; varargspara: tvarargsparalist):longint;
  560. begin
  561. init_para_alloc_values;
  562. { non-variadic parameters }
  563. create_paraloc_info_intern(p,callerside,p.paras,false);
  564. if p.proccalloption in cstylearrayofconst then
  565. begin
  566. { on Darwin, we cannot use any registers for variadic parameters }
  567. if target_info.abi=abi_aarch64_darwin then
  568. begin
  569. curintreg:=succ(RS_LAST_INT_PARAM_SUPREG);
  570. curmmreg:=succ(RS_LAST_MM_PARAM_SUPREG);
  571. end;
  572. { continue loading the parameters }
  573. create_paraloc_info_intern(p,callerside,varargspara,true);
  574. result:=curstackoffset;
  575. end
  576. else
  577. internalerror(200410231);
  578. end;
  579. begin
  580. paramanager:=taarch64paramanager.create;
  581. end.