agx86att.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  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. cclasses,cpubase,systems,
  24. globals,globtype,cgutils,
  25. aasmbase,aasmtai,aasmdata,assemble,aggas;
  26. type
  27. Tx86ATTAssembler=class(TGNUassembler)
  28. constructor create(info: pasminfo; smart: boolean); override;
  29. function MakeCmdLine: TCmdStr; override;
  30. end;
  31. Tx86AppleGNUAssembler=class(TAppleGNUassembler)
  32. constructor create(info: pasminfo; smart: boolean); override;
  33. end;
  34. Tx86AoutGNUAssembler=class(TAoutGNUassembler)
  35. constructor create(info: pasminfo; 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.create(info: pasminfo; 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.create(info: pasminfo; 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.create(info: pasminfo; 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. if ref.refaddr=addr_pic then
  141. begin
  142. { @GOT and @GOTPCREL references are only allowed for symbol alone,
  143. indexing, relsymbol or offset cannot be present. }
  144. if assigned(relsymbol) or (offset<>0) or (index<>NR_NO) then
  145. InternalError(2015011801);
  146. {$ifdef x86_64}
  147. if (base<>NR_RIP) then
  148. InternalError(2015011802);
  149. owner.writer.AsmWrite('@GOTPCREL');
  150. {$else x86_64}
  151. owner.writer.AsmWrite('@GOT');
  152. {$endif x86_64}
  153. end;
  154. if offset<0 then
  155. owner.writer.AsmWrite(tostr(offset))
  156. else
  157. if (offset>0) then
  158. begin
  159. if assigned(symbol) then
  160. owner.writer.AsmWrite('+'+tostr(offset))
  161. else
  162. owner.writer.AsmWrite(tostr(offset));
  163. end
  164. else if (index=NR_NO) and (base=NR_NO) and (not assigned(symbol)) then
  165. owner.writer.AsmWrite('0');
  166. if (index<>NR_NO) and (base=NR_NO) then
  167. begin
  168. if scalefactor in [0,1] then
  169. { Switching index to base position gives shorter
  170. assembler instructions }
  171. begin
  172. owner.writer.AsmWrite('('+gas_regname(index)+')');
  173. end
  174. else
  175. begin
  176. owner.writer.AsmWrite('(,'+gas_regname(index));
  177. if scalefactor<>0 then
  178. owner.writer.AsmWrite(','+tostr(scalefactor)+')')
  179. else
  180. owner.writer.AsmWrite(')');
  181. end;
  182. end
  183. else
  184. if (index=NR_NO) and (base<>NR_NO) then
  185. owner.writer.AsmWrite('('+gas_regname(base)+')')
  186. else
  187. if (index<>NR_NO) and (base<>NR_NO) then
  188. begin
  189. owner.writer.AsmWrite('('+gas_regname(base)+','+gas_regname(index));
  190. if scalefactor<>0 then
  191. owner.writer.AsmWrite(','+tostr(scalefactor));
  192. owner.writer.AsmWrite(')');
  193. end;
  194. end;
  195. end;
  196. procedure Tx86InstrWriter.WriteOper(const o:toper);
  197. begin
  198. case o.typ of
  199. top_reg :
  200. { Solaris assembler does not accept %st instead of %st(0) }
  201. if (owner.asminfo^.id=as_solaris_as) and (o.reg=NR_ST) then
  202. owner.writer.AsmWrite(gas_regname(NR_ST0))
  203. else
  204. owner.writer.AsmWrite(gas_regname(o.reg));
  205. top_ref :
  206. if o.ref^.refaddr in [addr_no,addr_pic,addr_pic_no_got] then
  207. WriteReference(o.ref^)
  208. else
  209. begin
  210. owner.writer.AsmWrite('$');
  211. if assigned(o.ref^.symbol) then
  212. owner.writer.AsmWrite(o.ref^.symbol.name);
  213. if o.ref^.offset>0 then
  214. owner.writer.AsmWrite('+'+tostr(o.ref^.offset))
  215. else
  216. if o.ref^.offset<0 then
  217. owner.writer.AsmWrite(tostr(o.ref^.offset))
  218. else
  219. if not(assigned(o.ref^.symbol)) then
  220. owner.writer.AsmWrite('0');
  221. end;
  222. top_const :
  223. owner.writer.AsmWrite('$'+tostr(o.val));
  224. else
  225. internalerror(10001);
  226. end;
  227. end;
  228. procedure Tx86InstrWriter.WriteOper_jmp(const o:toper);
  229. begin
  230. case o.typ of
  231. top_reg :
  232. owner.writer.AsmWrite('*'+gas_regname(o.reg));
  233. top_ref :
  234. begin
  235. if o.ref^.refaddr in [addr_no,addr_pic_no_got] then
  236. begin
  237. owner.writer.AsmWrite('*');
  238. WriteReference(o.ref^);
  239. end
  240. else
  241. begin
  242. owner.writer.AsmWrite(o.ref^.symbol.name);
  243. if o.ref^.refaddr=addr_pic then
  244. owner.writer.AsmWrite('@PLT');
  245. if o.ref^.offset>0 then
  246. owner.writer.AsmWrite('+'+tostr(o.ref^.offset))
  247. else
  248. if o.ref^.offset<0 then
  249. owner.writer.AsmWrite(tostr(o.ref^.offset));
  250. end;
  251. end;
  252. top_const :
  253. owner.writer.AsmWrite(tostr(o.val));
  254. else
  255. internalerror(10001);
  256. end;
  257. end;
  258. procedure Tx86InstrWriter.WriteInstruction(hp: tai);
  259. var
  260. op : tasmop;
  261. calljmp : boolean;
  262. i : integer;
  263. sreg : string;
  264. begin
  265. if hp.typ <> ait_instruction then
  266. exit;
  267. taicpu(hp).SetOperandOrder(op_att);
  268. op:=taicpu(hp).opcode;
  269. calljmp:=is_calljmp(op);
  270. // BUGFIX GAS-assembler
  271. // Intel "Intel 64 and IA-32 Architectures Software Developers manual 12/2011"
  272. // Intel: VCVTDQ2PD YMMREG, YMMREG/mem128 ((intel syntax))
  273. // GAS: VCVTDQ2PD YMMREG, XMMREG/mem128 ((intel syntax))
  274. if (op = A_VCVTDQ2PD) and
  275. (taicpu(hp).ops = 2) and
  276. (taicpu(hp).oper[0]^.typ = top_reg) and
  277. (taicpu(hp).oper[1]^.typ = top_reg) then
  278. begin
  279. if ((taicpu(hp).oper[0]^.ot and OT_YMMREG) = OT_YMMREG) and
  280. ((taicpu(hp).oper[1]^.ot and OT_YMMREG) = OT_YMMREG) then
  281. begin
  282. // change registertype in oper[0] from OT_YMMREG to OT_XMMREG
  283. taicpu(hp).oper[0]^.ot := taicpu(hp).oper[0]^.ot and not(OT_YMMREG) or OT_XMMREG;
  284. sreg := gas_regname(taicpu(hp).oper[0]^.reg);
  285. if (copy(sreg, 1, 2) = '%y') or
  286. (copy(sreg, 1, 2) = '%Y') then
  287. taicpu(hp).oper[0]^.reg := gas_regnum_search('%x' + copy(sreg, 3, length(sreg) - 2));
  288. end;
  289. end;
  290. { see fNoInterUnitMovQ declaration comment }
  291. if fNoInterUnitMovQ then
  292. begin
  293. if ((op=A_MOVQ) or
  294. (op=A_VMOVQ)) and
  295. (((taicpu(hp).oper[0]^.typ=top_reg) and
  296. (getregtype(taicpu(hp).oper[0]^.reg)=R_INTREGISTER)) or
  297. ((taicpu(hp).oper[1]^.typ=top_reg) and
  298. (getregtype(taicpu(hp).oper[1]^.reg)=R_INTREGISTER))) then
  299. begin
  300. if op=A_MOVQ then
  301. op:=A_MOVD
  302. else
  303. op:=A_VMOVD;
  304. taicpu(hp).opcode:=op;
  305. end;
  306. end;
  307. owner.writer.AsmWrite(#9);
  308. { movsd should not be translated to movsl when there
  309. are (xmm) arguments }
  310. if (op=A_MOVSD) and (taicpu(hp).ops>0) then
  311. owner.writer.AsmWrite('movsd')
  312. else
  313. owner.writer.AsmWrite(gas_op2str[op]);
  314. owner.writer.AsmWrite(cond2str[taicpu(hp).condition]);
  315. { suffix needed ? fnstsw,fldcw don't support suffixes
  316. with binutils 2.9.5 under linux }
  317. { if (Taicpu(hp).oper[0]^.typ=top_reg) and
  318. (Taicpu(hp).oper[0]^.reg.enum>lastreg) then
  319. internalerror(200301081);}
  320. if (not calljmp) and
  321. (gas_needsuffix[op]<>AttSufNONE) and
  322. (op<>A_FNSTSW) and
  323. (op<>A_FSTSW) and
  324. (op<>A_FNSTCW) and
  325. (op<>A_FSTCW) and
  326. (op<>A_FLDCW) and
  327. (not fskipPopcountSuffix or
  328. (op<>A_POPCNT)) and
  329. ((owner.asminfo^.id<>as_solaris_as) or (op<>A_Jcc) and (op<>A_SETcc)) and
  330. not(
  331. (taicpu(hp).ops<>0) and
  332. (taicpu(hp).oper[0]^.typ=top_reg) and
  333. (getregtype(taicpu(hp).oper[0]^.reg)=R_FPUREGISTER)
  334. ) then
  335. begin
  336. if (gas_needsuffix[op] = AttSufMM)then
  337. begin
  338. for i:=0 to taicpu(hp).ops-1 do
  339. begin
  340. if (taicpu(hp).oper[i]^.typ = top_ref) then
  341. begin
  342. case taicpu(hp).oper[i]^.ot and OT_SIZE_MASK of
  343. OT_BITS32: begin
  344. owner.writer.AsmWrite(gas_opsize2str[S_L]);
  345. break;
  346. end;
  347. OT_BITS64: begin
  348. owner.writer.AsmWrite(gas_opsize2str[S_Q]);
  349. break;
  350. end;
  351. OT_BITS128: begin
  352. owner.writer.AsmWrite(gas_opsize2str[S_XMM]);
  353. break;
  354. end;
  355. OT_BITS256: begin
  356. owner.writer.AsmWrite(gas_opsize2str[S_YMM]);
  357. break;
  358. end;
  359. 0: begin
  360. owner.writer.AsmWrite(gas_opsize2str[taicpu(hp).opsize]);
  361. break;
  362. end;
  363. end;
  364. end;
  365. end;
  366. end
  367. else owner.writer.AsmWrite(gas_opsize2str[taicpu(hp).opsize]);
  368. end;
  369. { process operands }
  370. if taicpu(hp).ops<>0 then
  371. begin
  372. if calljmp then
  373. begin
  374. owner.writer.AsmWrite(#9);
  375. WriteOper_jmp(taicpu(hp).oper[0]^);
  376. end
  377. else
  378. begin
  379. for i:=0 to taicpu(hp).ops-1 do
  380. begin
  381. if i=0 then
  382. owner.writer.AsmWrite(#9)
  383. else
  384. owner.writer.AsmWrite(',');
  385. WriteOper(taicpu(hp).oper[i]^);
  386. end;
  387. end;
  388. end;
  389. owner.writer.AsmLn;
  390. end;
  391. {*****************************************************************************
  392. Initialize
  393. *****************************************************************************}
  394. const
  395. {$ifdef x86_64}
  396. as_x86_64_as_info : tasminfo =
  397. (
  398. id : as_gas;
  399. idtxt : 'AS';
  400. asmbin : 'as';
  401. asmcmd : '--64 -o $OBJ $EXTRAOPT $ASM';
  402. supported_targets : [system_x86_64_linux,system_x86_64_freebsd,
  403. system_x86_64_win64,system_x86_64_embedded,
  404. system_x86_64_openbsd,system_x86_64_netbsd,
  405. system_x86_64_dragonfly,system_x86_64_aros];
  406. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  407. labelprefix : '.L';
  408. comment : '# ';
  409. dollarsign: '$';
  410. );
  411. as_x86_64_yasm_info : tasminfo =
  412. (
  413. id : as_yasm;
  414. idtxt : 'YASM';
  415. asmbin : 'yasm';
  416. asmcmd : '-a x86 -p gas -f $FORMAT -o $OBJ $EXTRAOPT $ASM';
  417. supported_targets : [system_x86_64_linux,system_x86_64_freebsd,system_x86_64_win64,system_x86_64_embedded];
  418. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  419. labelprefix : '.L';
  420. comment : '# ';
  421. dollarsign: '$';
  422. );
  423. as_x86_64_gas_info : tasminfo =
  424. (
  425. id : as_ggas;
  426. idtxt : 'GAS';
  427. asmbin : 'gas';
  428. asmcmd : '--64 -o $OBJ $EXTRAOPT $ASM';
  429. supported_targets : [system_x86_64_solaris];
  430. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  431. labelprefix : '.L';
  432. comment : '# ';
  433. dollarsign: '$';
  434. );
  435. as_x86_64_solaris_info : tasminfo =
  436. (
  437. id : as_solaris_as;
  438. idtxt : 'AS-SOL';
  439. asmbin : 'as';
  440. asmcmd : ' -m64 -o $OBJ $EXTRAOPT $ASM';
  441. supported_targets : [system_x86_64_solaris];
  442. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  443. labelprefix : '.L';
  444. comment : '# ';
  445. dollarsign: '$';
  446. );
  447. as_x86_64_gas_darwin_info : tasminfo =
  448. (
  449. id : as_darwin;
  450. idtxt : 'AS-DARWIN';
  451. asmbin : 'as';
  452. asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch x86_64';
  453. supported_targets : [system_x86_64_darwin,system_x86_64_iphonesim];
  454. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  455. labelprefix : 'L';
  456. comment : '# ';
  457. dollarsign: '$';
  458. );
  459. as_x86_64_clang_darwin_info : tasminfo =
  460. (
  461. id : as_clang;
  462. idtxt : 'CLANG';
  463. asmbin : 'clang';
  464. asmcmd : '-c -o $OBJ $EXTRAOPT -arch x86_64 $DARWINVERSION -x assembler $ASM';
  465. supported_targets : [system_x86_64_darwin,system_x86_64_iphonesim];
  466. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  467. labelprefix : 'L';
  468. comment : '# ';
  469. dollarsign: '$';
  470. );
  471. {$else x86_64}
  472. as_i386_as_info : tasminfo =
  473. (
  474. id : as_gas;
  475. idtxt : 'AS';
  476. asmbin : 'as';
  477. asmcmd : '--32 -o $OBJ $EXTRAOPT $ASM';
  478. supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos,
  479. system_i386_netbsd,system_i386_Netware,system_i386_qnx,system_i386_wdosx,system_i386_openbsd,
  480. system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,system_x86_6432_linux,
  481. system_i386_nativent,system_i386_android,system_i386_aros];
  482. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  483. labelprefix : '.L';
  484. comment : '# ';
  485. dollarsign: '$';
  486. );
  487. as_i386_yasm_info : tasminfo =
  488. (
  489. id : as_yasm;
  490. idtxt : 'YASM';
  491. asmbin : 'yasm';
  492. asmcmd : '-a x86 -p gas -f $FORMAT -o $OBJ $EXTRAOPT $ASM';
  493. supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos,
  494. system_i386_netbsd,system_i386_Netware,system_i386_qnx,system_i386_wdosx,system_i386_openbsd,
  495. system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,system_x86_6432_linux,
  496. system_i386_nativent];
  497. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  498. labelprefix : '.L';
  499. comment : '# ';
  500. dollarsign: '$';
  501. );
  502. as_i386_as_aout_info : tasminfo =
  503. (
  504. id : as_i386_as_aout;
  505. idtxt : 'AS_AOUT';
  506. asmbin : 'as';
  507. asmcmd : '-o $OBJ $EXTRAOPT $ASM';
  508. supported_targets : [system_i386_linux,system_i386_OS2,system_i386_freebsd,system_i386_netbsd,system_i386_openbsd,system_i386_EMX,system_i386_embedded];
  509. flags : [af_needar,af_stabs_use_function_absolute_addresses];
  510. labelprefix : 'L';
  511. comment : '# ';
  512. dollarsign: '$';
  513. );
  514. as_i386_gas_darwin_info : tasminfo =
  515. (
  516. id : as_darwin;
  517. idtxt : 'AS-DARWIN';
  518. asmbin : 'as';
  519. asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch i386';
  520. supported_targets : [system_i386_darwin,system_i386_iphonesim];
  521. flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_stabs_use_function_absolute_addresses];
  522. labelprefix : 'L';
  523. comment : '# ';
  524. dollarsign: '$';
  525. );
  526. as_i386_clang_darwin_info : tasminfo =
  527. (
  528. id : as_clang;
  529. idtxt : 'CLANG';
  530. asmbin : 'clang';
  531. asmcmd : '-c -o $OBJ $EXTRAOPT -arch i386 $DARWINVERSION -x assembler $ASM';
  532. supported_targets : [system_i386_darwin,system_i386_iphonesim];
  533. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  534. labelprefix : 'L';
  535. comment : '# ';
  536. dollarsign: '$';
  537. );
  538. as_i386_gas_info : tasminfo =
  539. (
  540. id : as_ggas;
  541. idtxt : 'GAS';
  542. asmbin : 'gas';
  543. asmcmd : '--32 -o $OBJ $EXTRAOPT $ASM';
  544. supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos,
  545. system_i386_netbsd,system_i386_Netware,system_i386_qnx,system_i386_wdosx,system_i386_openbsd,
  546. system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,
  547. system_x86_6432_linux,system_i386_android];
  548. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  549. labelprefix : '.L';
  550. comment : '# ';
  551. dollarsign: '$';
  552. );
  553. as_i386_solaris_info : tasminfo =
  554. (
  555. id : as_solaris_as;
  556. idtxt : 'AS-SOL';
  557. asmbin : 'as';
  558. asmcmd : ' -o $OBJ $EXTRAOPT $ASM';
  559. supported_targets : [system_i386_solaris];
  560. flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
  561. labelprefix : '.L';
  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.