agx86att.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. This unit implements an asmoutput class for i386 AT&T syntax
  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. { This unit implements an asmoutput class for i386 AT&T syntax
  18. }
  19. unit agx86att;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. cpubase,systems,
  24. globtype,cgutils,
  25. aasmtai,assemble,aggas;
  26. type
  27. Tx86ATTAssembler=class(TGNUassembler)
  28. constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
  29. function MakeCmdLine: TCmdStr; override;
  30. end;
  31. Tx86AppleGNUAssembler=class(TAppleGNUassembler)
  32. constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
  33. end;
  34. Tx86AoutGNUAssembler=class(TAoutGNUassembler)
  35. constructor CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean); override;
  36. end;
  37. Tx86InstrWriter=class(TCPUInstrWriter)
  38. private
  39. procedure WriteReference(var ref : treference);
  40. procedure WriteOper(const o:toper);
  41. procedure WriteOper_jmp(const o:toper);
  42. protected
  43. fskipPopcountSuffix: boolean;
  44. { http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56656 }
  45. fNoInterUnitMovQ: boolean;
  46. public
  47. procedure WriteInstruction(hp: tai);override;
  48. end;
  49. implementation
  50. uses
  51. cutils,
  52. verbose,
  53. itcpugas,
  54. cgbase,
  55. aasmcpu;
  56. {****************************************************************************
  57. Tx86ATTAssembler
  58. ****************************************************************************}
  59. constructor Tx86ATTAssembler.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
  60. begin
  61. inherited;
  62. InstrWriter := Tx86InstrWriter.create(self);
  63. end;
  64. function TX86ATTAssembler.MakeCmdLine: TCmdStr;
  65. var
  66. FormatName : string;
  67. begin
  68. result:=Inherited MakeCmdLine;
  69. {$ifdef i386}
  70. case target_info.system of
  71. system_i386_go32v2:
  72. FormatName:='coff';
  73. system_i386_wdosx,
  74. system_i386_win32:
  75. FormatName:='win32';
  76. system_i386_embedded:
  77. FormatName:='obj';
  78. system_i386_linux,
  79. system_i386_beos:
  80. FormatName:='elf';
  81. system_i386_darwin:
  82. FormatName:='macho32';
  83. else
  84. FormatName:='elf';
  85. end;
  86. {$endif i386}
  87. {$ifdef x86_64}
  88. case target_info.system of
  89. system_x86_64_win64:
  90. FormatName:='win64';
  91. system_x86_64_darwin:
  92. FormatName:='macho64';
  93. system_x86_64_embedded:
  94. FormatName:='obj';
  95. system_x86_64_linux:
  96. FormatName:='elf64';
  97. else
  98. FormatName:='elf64';
  99. end;
  100. {$endif x86_64}
  101. Replace(result,'$FORMAT',FormatName);
  102. end;
  103. {****************************************************************************
  104. Tx86AppleGNUAssembler
  105. ****************************************************************************}
  106. constructor Tx86AppleGNUAssembler.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
  107. begin
  108. inherited;
  109. InstrWriter := Tx86InstrWriter.create(self);
  110. { Apple's assembler does not support a size suffix for popcount }
  111. Tx86InstrWriter(InstrWriter).fskipPopcountSuffix := true;
  112. { Apple's assembler is broken regarding some movq suffix handling }
  113. Tx86InstrWriter(InstrWriter).fNoInterUnitMovQ := true;
  114. end;
  115. {****************************************************************************
  116. Tx86AoutGNUAssembler
  117. ****************************************************************************}
  118. constructor Tx86AoutGNUAssembler.CreateWithWriter(info: pasminfo; wr: TExternalAssemblerOutputFile; freewriter, smart: boolean);
  119. begin
  120. inherited;
  121. InstrWriter := Tx86InstrWriter.create(self);
  122. end;
  123. {****************************************************************************
  124. Tx86InstrWriter
  125. ****************************************************************************}
  126. procedure Tx86InstrWriter.WriteReference(var ref : treference);
  127. begin
  128. with ref do
  129. begin
  130. { do we have a segment prefix ? }
  131. { These are probably not correctly handled under GAS }
  132. { should be replaced by coding the segment override }
  133. { directly! - DJGPP FAQ }
  134. if segment<>NR_NO then
  135. owner.writer.AsmWrite(gas_regname(segment)+':');
  136. if assigned(symbol) then
  137. owner.writer.AsmWrite(symbol.name);
  138. if assigned(relsymbol) then
  139. owner.writer.AsmWrite('-'+relsymbol.name);
  140. case ref.refaddr of
  141. addr_pic:
  142. begin
  143. { @GOT and @GOTPCREL references are only allowed for symbol alone,
  144. indexing, relsymbol or offset cannot be present. }
  145. if assigned(relsymbol) or (offset<>0) or (index<>NR_NO) then
  146. InternalError(2015011801);
  147. {$ifdef x86_64}
  148. if (base<>NR_RIP) then
  149. InternalError(2015011802);
  150. owner.writer.AsmWrite('@GOTPCREL');
  151. {$else x86_64}
  152. owner.writer.AsmWrite('@GOT');
  153. {$endif x86_64}
  154. end;
  155. {$ifdef i386}
  156. addr_ntpoff:
  157. owner.writer.AsmWrite('@ntpoff');
  158. addr_tlsgd:
  159. owner.writer.AsmWrite('@tlsgd');
  160. {$endif i386}
  161. {$ifdef x86_64}
  162. addr_tpoff:
  163. owner.writer.AsmWrite('@tpoff');
  164. addr_tlsgd:
  165. owner.writer.AsmWrite('@tlsgd');
  166. {$endif x86_64}
  167. else
  168. ;
  169. end;
  170. if offset<0 then
  171. owner.writer.AsmWrite(tostr(offset))
  172. else
  173. if (offset>0) then
  174. begin
  175. if assigned(symbol) then
  176. owner.writer.AsmWrite('+'+tostr(offset))
  177. else
  178. owner.writer.AsmWrite(tostr(offset));
  179. end
  180. else if (index=NR_NO) and (base=NR_NO) and (not assigned(symbol)) then
  181. owner.writer.AsmWrite('0');
  182. if (index<>NR_NO) and (base=NR_NO) then
  183. begin
  184. owner.writer.AsmWrite('(,'+gas_regname(index));
  185. if scalefactor<>0 then
  186. owner.writer.AsmWrite(','+tostr(scalefactor));
  187. owner.writer.AsmWrite(')');
  188. end
  189. else
  190. if (index=NR_NO) and (base<>NR_NO) then
  191. owner.writer.AsmWrite('('+gas_regname(base)+')')
  192. else
  193. if (index<>NR_NO) and (base<>NR_NO) then
  194. begin
  195. owner.writer.AsmWrite('('+gas_regname(base)+','+gas_regname(index));
  196. if scalefactor<>0 then
  197. owner.writer.AsmWrite(','+tostr(scalefactor));
  198. owner.writer.AsmWrite(')');
  199. end;
  200. end;
  201. end;
  202. procedure Tx86InstrWriter.WriteOper(const o:toper);
  203. begin
  204. if o.vopext and OTVE_VECTOR_SAE = OTVE_VECTOR_SAE then
  205. owner.writer.AsmWrite('{sae},');
  206. if o.vopext and OTVE_VECTOR_ER_MASK = OTVE_VECTOR_RNSAE then
  207. owner.writer.AsmWrite('{rn-sae},');
  208. if o.vopext and OTVE_VECTOR_ER_MASK = OTVE_VECTOR_RDSAE then
  209. owner.writer.AsmWrite('{rd-sae},');
  210. if o.vopext and OTVE_VECTOR_ER_MASK = OTVE_VECTOR_RUSAE then
  211. owner.writer.AsmWrite('{ru-sae},');
  212. if o.vopext and OTVE_VECTOR_ER_MASK = OTVE_VECTOR_RZSAE then
  213. owner.writer.AsmWrite('{rz-sae},');
  214. case o.typ of
  215. top_reg :
  216. { Solaris assembler does not accept %st instead of %st(0) }
  217. if (owner.asminfo^.id=as_solaris_as) and (o.reg=NR_ST) then
  218. owner.writer.AsmWrite(gas_regname(NR_ST0))
  219. else
  220. owner.writer.AsmWrite(gas_regname(o.reg));
  221. top_ref :
  222. if o.ref^.refaddr in [addr_no,addr_pic,addr_pic_no_got
  223. {$ifdef i386},addr_ntpoff,addr_tlsgd{$endif i386}
  224. {$ifdef x86_64},addr_tpoff,addr_tlsgd{$endif x86_64}
  225. ] then
  226. WriteReference(o.ref^)
  227. else
  228. begin
  229. owner.writer.AsmWrite('$');
  230. if assigned(o.ref^.symbol) then
  231. owner.writer.AsmWrite(o.ref^.symbol.name);
  232. if o.ref^.offset>0 then
  233. owner.writer.AsmWrite('+'+tostr(o.ref^.offset))
  234. else
  235. if o.ref^.offset<0 then
  236. owner.writer.AsmWrite(tostr(o.ref^.offset))
  237. else
  238. if not(assigned(o.ref^.symbol)) then
  239. owner.writer.AsmWrite('0');
  240. end;
  241. top_const :
  242. owner.writer.AsmWrite('$'+tostr(o.val));
  243. else
  244. internalerror(10001);
  245. end;
  246. if o.vopext and OTVE_VECTOR_WRITEMASK = OTVE_VECTOR_WRITEMASK then
  247. begin
  248. owner.writer.AsmWrite('{%k' + tostr(o.vopext and $07) + '} ');
  249. if o.vopext and OTVE_VECTOR_ZERO = OTVE_VECTOR_ZERO then
  250. owner.writer.AsmWrite('{z}');
  251. end;
  252. if o.vopext and OTVE_VECTOR_BCST = OTVE_VECTOR_BCST then
  253. begin
  254. case o.vopext and (OTVE_VECTOR_BCST2 or OTVE_VECTOR_BCST4 or OTVE_VECTOR_BCST8 or OTVE_VECTOR_BCST16) of
  255. OTVE_VECTOR_BCST2: owner.writer.AsmWrite('{1to2}');
  256. OTVE_VECTOR_BCST4: owner.writer.AsmWrite('{1to4}');
  257. OTVE_VECTOR_BCST8: owner.writer.AsmWrite('{1to8}');
  258. OTVE_VECTOR_BCST16: owner.writer.AsmWrite('{1to16}');
  259. else ; //TG TODO errormsg
  260. end;
  261. end;
  262. end;
  263. procedure Tx86InstrWriter.WriteOper_jmp(const o:toper);
  264. begin
  265. case o.typ of
  266. top_reg :
  267. owner.writer.AsmWrite('*'+gas_regname(o.reg));
  268. top_ref :
  269. begin
  270. if o.ref^.refaddr in [addr_no,addr_pic_no_got] then
  271. begin
  272. owner.writer.AsmWrite('*');
  273. WriteReference(o.ref^);
  274. end
  275. else
  276. begin
  277. owner.writer.AsmWrite(o.ref^.symbol.name);
  278. if o.ref^.refaddr=addr_pic then
  279. owner.writer.AsmWrite('@PLT');
  280. if o.ref^.offset>0 then
  281. owner.writer.AsmWrite('+'+tostr(o.ref^.offset))
  282. else
  283. if o.ref^.offset<0 then
  284. owner.writer.AsmWrite(tostr(o.ref^.offset));
  285. end;
  286. end;
  287. top_const :
  288. owner.writer.AsmWrite(tostr(o.val));
  289. else
  290. internalerror(10001);
  291. end;
  292. end;
  293. procedure Tx86InstrWriter.WriteInstruction(hp: tai);
  294. var
  295. op : tasmop;
  296. calljmp : boolean;
  297. i : integer;
  298. begin
  299. if hp.typ <> ait_instruction then
  300. exit;
  301. taicpu(hp).SetOperandOrder(op_att);
  302. op:=taicpu(hp).opcode;
  303. calljmp:=is_calljmp(op);
  304. { see fNoInterUnitMovQ declaration comment }
  305. if fNoInterUnitMovQ then
  306. begin
  307. if ((op=A_MOVQ) or
  308. (op=A_VMOVQ)) and
  309. (((taicpu(hp).oper[0]^.typ=top_reg) and
  310. (getregtype(taicpu(hp).oper[0]^.reg)=R_INTREGISTER)) or
  311. ((taicpu(hp).oper[1]^.typ=top_reg) and
  312. (getregtype(taicpu(hp).oper[1]^.reg)=R_INTREGISTER))) then
  313. begin
  314. if op=A_MOVQ then
  315. op:=A_MOVD
  316. else
  317. op:=A_VMOVD;
  318. taicpu(hp).opcode:=op;
  319. end;
  320. end;
  321. owner.writer.AsmWrite(#9);
  322. { movsd should not be translated to movsl when there
  323. are (xmm) arguments }
  324. if (op=A_MOVSD) and (taicpu(hp).ops>0) then
  325. owner.writer.AsmWrite('movsd')
  326. { the same applies to cmpsd as well }
  327. else if (op=A_CMPSD) and (taicpu(hp).ops>0) then
  328. owner.writer.AsmWrite('cmpsd')
  329. else
  330. owner.writer.AsmWrite(gas_op2str[op]);
  331. owner.writer.AsmWrite(cond2str[taicpu(hp).condition]);
  332. { suffix needed ? fnstsw,fldcw don't support suffixes
  333. with binutils 2.9.5 under linux }
  334. { if (Taicpu(hp).oper[0]^.typ=top_reg) and
  335. (Taicpu(hp).oper[0]^.reg.enum>lastreg) then
  336. internalerror(200301081);}
  337. if (not calljmp) and
  338. (gas_needsuffix[op]<>AttSufNONE) and
  339. (op<>A_FNSTSW) and
  340. (op<>A_FSTSW) and
  341. (op<>A_FNSTCW) and
  342. (op<>A_FSTCW) and
  343. (op<>A_FLDCW) and
  344. (not fskipPopcountSuffix or
  345. (op<>A_POPCNT)) and
  346. ((owner.asminfo^.id<>as_solaris_as) or (op<>A_Jcc) and (op<>A_SETcc)) and
  347. not(
  348. (taicpu(hp).ops<>0) and
  349. (taicpu(hp).oper[0]^.typ=top_reg) and
  350. (getregtype(taicpu(hp).oper[0]^.reg)=R_FPUREGISTER)
  351. ) then
  352. begin
  353. owner.writer.AsmWrite(gas_opsize2str[taicpu(hp).opsize]);
  354. end;
  355. { process operands }
  356. if taicpu(hp).ops<>0 then
  357. begin
  358. if calljmp then
  359. begin
  360. owner.writer.AsmWrite(#9);
  361. WriteOper_jmp(taicpu(hp).oper[0]^);
  362. end
  363. else
  364. begin
  365. for i:=0 to taicpu(hp).ops-1 do
  366. begin
  367. if i=0 then
  368. owner.writer.AsmWrite(#9)
  369. else
  370. owner.writer.AsmWrite(',');
  371. WriteOper(taicpu(hp).oper[i]^);
  372. end;
  373. end;
  374. end;
  375. owner.writer.AsmLn;
  376. end;
  377. {*****************************************************************************
  378. Initialize
  379. *****************************************************************************}
  380. const
  381. {$ifdef x86_64}
  382. as_x86_64_as_info : tasminfo =
  383. (
  384. id : as_gas;
  385. idtxt : 'AS';
  386. asmbin : 'as';
  387. asmcmd : '--64 -o $OBJ $BIGOBJ $EXTRAOPT $ASM';
  388. supported_targets : [system_x86_64_linux,system_x86_64_freebsd,
  389. system_x86_64_win64,system_x86_64_embedded,
  390. system_x86_64_openbsd,system_x86_64_netbsd,
  391. system_x86_64_dragonfly,system_x86_64_aros,
  392. system_x86_64_android,system_x86_64_haiku];
  393. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  394. labelprefix : '.L';
  395. labelmaxlen : -1;
  396. comment : '# ';
  397. dollarsign: '$';
  398. );
  399. as_x86_64_yasm_info : tasminfo =
  400. (
  401. id : as_yasm;
  402. idtxt : 'YASM';
  403. asmbin : 'yasm';
  404. asmcmd : '-a x86 -p gas -f $FORMAT -o $OBJ $EXTRAOPT $ASM';
  405. supported_targets : [system_x86_64_linux,system_x86_64_freebsd,system_x86_64_win64,system_x86_64_embedded];
  406. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  407. labelprefix : '.L';
  408. labelmaxlen : -1;
  409. comment : '# ';
  410. dollarsign: '$';
  411. );
  412. as_x86_64_gas_info : tasminfo =
  413. (
  414. id : as_ggas;
  415. idtxt : 'GAS';
  416. asmbin : 'gas';
  417. asmcmd : '--64 -o $OBJ $EXTRAOPT $ASM';
  418. supported_targets : [system_x86_64_solaris];
  419. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  420. labelprefix : '.L';
  421. labelmaxlen : -1;
  422. comment : '# ';
  423. dollarsign: '$';
  424. );
  425. as_x86_64_solaris_info : tasminfo =
  426. (
  427. id : as_solaris_as;
  428. idtxt : 'AS-SOL';
  429. asmbin : 'as';
  430. asmcmd : ' -m64 -o $OBJ $EXTRAOPT $ASM';
  431. supported_targets : [system_x86_64_solaris];
  432. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  433. labelprefix : '.L';
  434. labelmaxlen : -1;
  435. comment : '# ';
  436. dollarsign: '$';
  437. );
  438. as_x86_64_gas_darwin_info : tasminfo =
  439. (
  440. id : as_darwin;
  441. idtxt : 'AS-DARWIN';
  442. asmbin : 'as';
  443. asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch x86_64';
  444. supported_targets : [system_x86_64_darwin,system_x86_64_iphonesim];
  445. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  446. labelprefix : 'L';
  447. labelmaxlen : -1;
  448. comment : '# ';
  449. dollarsign: '$';
  450. );
  451. as_x86_64_clang_darwin_info : tasminfo =
  452. (
  453. id : as_clang_asdarwin;
  454. idtxt : 'CLANG';
  455. asmbin : 'clang';
  456. asmcmd : '-x assembler -c -target $TRIPLET -o $OBJ $EXTRAOPT -x assembler $ASM';
  457. supported_targets : [system_x86_64_darwin,system_x86_64_iphonesim];
  458. flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_no_stabs,af_llvm];
  459. labelprefix : 'L';
  460. labelmaxlen : -1;
  461. comment : '# ';
  462. dollarsign: '$';
  463. );
  464. {$else x86_64}
  465. as_i386_as_info : tasminfo =
  466. (
  467. id : as_gas;
  468. idtxt : 'AS';
  469. asmbin : 'as';
  470. asmcmd : '--32 -o $OBJ $BIGOBJ $EXTRAOPT $ASM';
  471. supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos,
  472. system_i386_netbsd,system_i386_Netware,system_i386_wdosx,system_i386_openbsd,
  473. system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,system_x86_6432_linux,
  474. system_i386_nativent,system_i386_android,system_i386_aros];
  475. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  476. labelprefix : '.L';
  477. labelmaxlen : -1;
  478. comment : '# ';
  479. dollarsign: '$';
  480. );
  481. as_i386_yasm_info : tasminfo =
  482. (
  483. id : as_yasm;
  484. idtxt : 'YASM';
  485. asmbin : 'yasm';
  486. asmcmd : '-a x86 -p gas -f $FORMAT -o $OBJ $EXTRAOPT $ASM';
  487. supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos,
  488. system_i386_netbsd,system_i386_Netware,system_i386_wdosx,system_i386_openbsd,
  489. system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,system_x86_6432_linux,
  490. system_i386_nativent];
  491. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  492. labelprefix : '.L';
  493. labelmaxlen : -1;
  494. comment : '# ';
  495. dollarsign: '$';
  496. );
  497. as_i386_as_aout_info : tasminfo =
  498. (
  499. id : as_i386_as_aout;
  500. idtxt : 'AS_AOUT';
  501. asmbin : 'as';
  502. asmcmd : '-o $OBJ $EXTRAOPT $ASM';
  503. supported_targets : [system_i386_linux,system_i386_OS2,system_i386_freebsd,system_i386_netbsd,system_i386_openbsd,system_i386_EMX,system_i386_embedded];
  504. flags : [af_needar,af_stabs_use_function_absolute_addresses];
  505. labelprefix : 'L';
  506. labelmaxlen : -1;
  507. comment : '# ';
  508. dollarsign: '$';
  509. );
  510. as_i386_gas_darwin_info : tasminfo =
  511. (
  512. id : as_darwin;
  513. idtxt : 'AS-DARWIN';
  514. asmbin : 'as';
  515. asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch i386';
  516. supported_targets : [system_i386_darwin,system_i386_iphonesim];
  517. flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_stabs_use_function_absolute_addresses];
  518. labelprefix : 'L';
  519. labelmaxlen : -1;
  520. comment : '# ';
  521. dollarsign: '$';
  522. );
  523. as_i386_clang_darwin_info : tasminfo =
  524. (
  525. id : as_clang_asdarwin;
  526. idtxt : 'CLANG';
  527. asmbin : 'clang';
  528. asmcmd : '-x assembler -c -target $TRIPLET -o $OBJ $EXTRAOPT -x assembler $ASM';
  529. supported_targets : [system_i386_darwin,system_i386_iphonesim];
  530. flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_no_stabs,af_llvm];
  531. labelprefix : 'L';
  532. labelmaxlen : -1;
  533. comment : '# ';
  534. dollarsign: '$';
  535. );
  536. as_i386_gas_info : tasminfo =
  537. (
  538. id : as_ggas;
  539. idtxt : 'GAS';
  540. asmbin : 'gas';
  541. asmcmd : '--32 -o $OBJ $EXTRAOPT $ASM';
  542. supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos,
  543. system_i386_netbsd,system_i386_Netware,system_i386_wdosx,system_i386_openbsd,
  544. system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,
  545. system_x86_6432_linux,system_i386_android];
  546. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  547. labelprefix : '.L';
  548. labelmaxlen : -1;
  549. comment : '# ';
  550. dollarsign: '$';
  551. );
  552. as_i386_solaris_info : tasminfo =
  553. (
  554. id : as_solaris_as;
  555. idtxt : 'AS-SOL';
  556. asmbin : 'as';
  557. asmcmd : ' -o $OBJ $EXTRAOPT $ASM';
  558. supported_targets : [system_i386_solaris];
  559. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  560. labelprefix : '.L';
  561. labelmaxlen : -1;
  562. comment : '# ';
  563. dollarsign: '$';
  564. );
  565. {$endif x86_64}
  566. initialization
  567. {$ifdef x86_64}
  568. RegisterAssembler(as_x86_64_as_info,Tx86ATTAssembler);
  569. RegisterAssembler(as_x86_64_yasm_info,Tx86ATTAssembler);
  570. RegisterAssembler(as_x86_64_gas_info,Tx86ATTAssembler);
  571. RegisterAssembler(as_x86_64_gas_darwin_info,Tx86AppleGNUAssembler);
  572. RegisterAssembler(as_x86_64_clang_darwin_info,Tx86AppleGNUAssembler);
  573. RegisterAssembler(as_x86_64_solaris_info,Tx86ATTAssembler);
  574. {$else x86_64}
  575. RegisterAssembler(as_i386_as_info,Tx86ATTAssembler);
  576. RegisterAssembler(as_i386_gas_info,Tx86ATTAssembler);
  577. RegisterAssembler(as_i386_yasm_info,Tx86ATTAssembler);
  578. RegisterAssembler(as_i386_gas_darwin_info,Tx86AppleGNUAssembler);
  579. RegisterAssembler(as_i386_clang_darwin_info,Tx86AppleGNUAssembler);
  580. RegisterAssembler(as_i386_as_aout_info,Tx86AoutGNUAssembler);
  581. RegisterAssembler(as_i386_solaris_info,Tx86ATTAssembler);
  582. {$endif x86_64}
  583. end.