2
0

psystem.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Load the system unit, create required defs for systemunit
  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. unit psystem;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. symbase;
  22. procedure create_intern_symbols;
  23. procedure create_intern_types;
  24. procedure load_intern_types;
  25. procedure registernodes;
  26. procedure registertais;
  27. implementation
  28. uses
  29. globals,globtype,verbose,constexp,
  30. systems,
  31. symconst,symtype,symsym,symdef,symtable,
  32. aasmtai,aasmdata,aasmcpu,
  33. ncgutil,ncgrtti,fmodule,
  34. node,nbas,nflw,nset,ncon,ncnv,nld,nmem,ncal,nmat,nadd,ninl,nopt
  35. ;
  36. procedure create_intern_symbols;
  37. {
  38. all intern procedures for the system unit
  39. }
  40. begin
  41. systemunit.insert(tsyssym.create('Concat',in_concat_x));
  42. systemunit.insert(tsyssym.create('Write',in_write_x));
  43. systemunit.insert(tsyssym.create('WriteLn',in_writeln_x));
  44. systemunit.insert(tsyssym.create('WriteStr',in_writestr_x));
  45. systemunit.insert(tsyssym.create('Assigned',in_assigned_x));
  46. systemunit.insert(tsyssym.create('Read',in_read_x));
  47. systemunit.insert(tsyssym.create('ReadLn',in_readln_x));
  48. systemunit.insert(tsyssym.create('ReadStr',in_readstr_x));
  49. systemunit.insert(tsyssym.create('Ofs',in_ofs_x));
  50. systemunit.insert(tsyssym.create('SizeOf',in_sizeof_x));
  51. systemunit.insert(tsyssym.create('BitSizeOf',in_bitsizeof_x));
  52. systemunit.insert(tsyssym.create('TypeOf',in_typeof_x));
  53. systemunit.insert(tsyssym.create('Low',in_low_x));
  54. systemunit.insert(tsyssym.create('High',in_high_x));
  55. systemunit.insert(tsyssym.create('Slice',in_slice_x));
  56. systemunit.insert(tsyssym.create('Seg',in_seg_x));
  57. systemunit.insert(tsyssym.create('Ord',in_ord_x));
  58. systemunit.insert(tsyssym.create('Pred',in_pred_x));
  59. systemunit.insert(tsyssym.create('Succ',in_succ_x));
  60. systemunit.insert(tsyssym.create('Exclude',in_exclude_x_y));
  61. systemunit.insert(tsyssym.create('Include',in_include_x_y));
  62. systemunit.insert(tsyssym.create('Pack',in_pack_x_y_z));
  63. systemunit.insert(tsyssym.create('Unpack',in_unpack_x_y_z));
  64. systemunit.insert(tsyssym.create('Break',in_break));
  65. systemunit.insert(tsyssym.create('Exit',in_exit));
  66. systemunit.insert(tsyssym.create('Continue',in_continue));
  67. systemunit.insert(tsyssym.create('Leave',in_leave)); {macpas only}
  68. systemunit.insert(tsyssym.create('Cycle',in_cycle)); {macpas only}
  69. systemunit.insert(tsyssym.create('Dec',in_dec_x));
  70. systemunit.insert(tsyssym.create('Inc',in_inc_x));
  71. systemunit.insert(tsyssym.create('Str',in_str_x_string));
  72. systemunit.insert(tsyssym.create('Assert',in_assert_x_y));
  73. systemunit.insert(tsyssym.create('Val',in_val_x));
  74. systemunit.insert(tsyssym.create('Addr',in_addr_x));
  75. systemunit.insert(tsyssym.create('TypeInfo',in_typeinfo_x));
  76. systemunit.insert(tsyssym.create('SetLength',in_setlength_x));
  77. systemunit.insert(tsyssym.create('Copy',in_copy_x));
  78. systemunit.insert(tsyssym.create('Initialize',in_initialize_x));
  79. systemunit.insert(tsyssym.create('Finalize',in_finalize_x));
  80. systemunit.insert(tsyssym.create('Length',in_length_x));
  81. systemunit.insert(tsyssym.create('New',in_new_x));
  82. systemunit.insert(tsyssym.create('Dispose',in_dispose_x));
  83. {$if defined(x86) or defined(arm)}
  84. systemunit.insert(tsyssym.create('Get_Frame',in_get_frame));
  85. {$endif defined(x86) or defined(arm)}
  86. {$ifdef SUPPORT_UNALIGNED}
  87. systemunit.insert(tsyssym.create('Unaligned',in_unaligned_x));
  88. {$endif SUPPORT_UNALIGNED}
  89. end;
  90. procedure create_intern_types;
  91. {
  92. all the types inserted into the system unit
  93. }
  94. function addtype(const s:string;def:tdef):ttypesym;
  95. begin
  96. result:=ttypesym.create(s,def);
  97. systemunit.insert(result);
  98. end;
  99. var
  100. hrecst : trecordsymtable;
  101. begin
  102. symtablestack.push(systemunit);
  103. cundefinedtype:=tundefineddef.create;
  104. cformaltype:=tformaldef.create(false);
  105. ctypedformaltype:=tformaldef.create(true);
  106. voidtype:=torddef.create(uvoid,0,0);
  107. u8inttype:=torddef.create(u8bit,0,255);
  108. s8inttype:=torddef.create(s8bit,int64(-128),127);
  109. u16inttype:=torddef.create(u16bit,0,65535);
  110. s16inttype:=torddef.create(s16bit,int64(-32768),32767);
  111. u32inttype:=torddef.create(u32bit,0,high(longword));
  112. s32inttype:=torddef.create(s32bit,int64(low(longint)),int64(high(longint)));
  113. u64inttype:=torddef.create(u64bit,low(qword),high(qword));
  114. s64inttype:=torddef.create(s64bit,low(int64),high(int64));
  115. booltype:=torddef.create(bool8bit,0,1);
  116. bool16type:=torddef.create(bool16bit,0,1);
  117. bool32type:=torddef.create(bool32bit,0,1);
  118. bool64type:=torddef.create(bool64bit,0,1);
  119. cchartype:=torddef.create(uchar,0,255);
  120. cwidechartype:=torddef.create(uwidechar,0,65535);
  121. cshortstringtype:=tstringdef.createshort(255);
  122. { should we give a length to the default long and ansi string definition ?? }
  123. clongstringtype:=tstringdef.createlong(-1);
  124. cansistringtype:=tstringdef.createansi(-1);
  125. cwidestringtype:=tstringdef.createwide(-1);
  126. { length=0 for shortstring is open string (needed for readln(string) }
  127. openshortstringtype:=tstringdef.createshort(0);
  128. openchararraytype:=tarraydef.create(0,-1,s32inttype);
  129. tarraydef(openchararraytype).elementdef:=cchartype;
  130. {$ifdef x86}
  131. s32floattype:=tfloatdef.create(s32real);
  132. s64floattype:=tfloatdef.create(s64real);
  133. s80floattype:=tfloatdef.create(s80real);
  134. if target_info.system<>system_x86_64_win64 then
  135. s64currencytype:=tfloatdef.create(s64currency)
  136. else
  137. begin
  138. s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
  139. pbestrealtype:=@s64floattype;
  140. end;
  141. {$endif x86}
  142. {$ifdef powerpc}
  143. s32floattype:=tfloatdef.create(s32real);
  144. s64floattype:=tfloatdef.create(s64real);
  145. s80floattype:=tfloatdef.create(s80real);
  146. s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
  147. {$endif powerpc}
  148. {$ifdef POWERPC64}
  149. s32floattype:=tfloatdef.create(s32real);
  150. s64floattype:=tfloatdef.create(s64real);
  151. s80floattype:=tfloatdef.create(s80real);
  152. s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
  153. {$endif POWERPC64}
  154. {$ifdef sparc}
  155. s32floattype:=tfloatdef.create(s32real);
  156. s64floattype:=tfloatdef.create(s64real);
  157. s80floattype:=tfloatdef.create(s80real);
  158. s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
  159. {$endif sparc}
  160. {$ifdef m68k}
  161. s32floattype:=tfloatdef.create(s32real);
  162. s64floattype:=tfloatdef.create(s64real);
  163. s80floattype:=tfloatdef.create(s80real);
  164. s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
  165. {$endif}
  166. {$ifdef arm}
  167. s32floattype:=tfloatdef.create(s32real);
  168. s64floattype:=tfloatdef.create(s64real);
  169. s80floattype:=tfloatdef.create(s80real);
  170. s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
  171. {$endif arm}
  172. {$ifdef cpu64bit}
  173. uinttype:=u64inttype;
  174. sinttype:=s64inttype;
  175. ptruinttype:=u64inttype;
  176. ptrsinttype:=s64inttype;
  177. {$else cpu64bit}
  178. uinttype:=u32inttype;
  179. sinttype:=s32inttype;
  180. ptruinttype:=u32inttype;
  181. ptrsinttype:=s32inttype;
  182. {$endif cpu64bit}
  183. { some other definitions }
  184. voidpointertype:=tpointerdef.create(voidtype);
  185. charpointertype:=tpointerdef.create(cchartype);
  186. widecharpointertype:=tpointerdef.create(cwidechartype);
  187. voidfarpointertype:=tpointerdef.createfar(voidtype);
  188. cfiletype:=tfiledef.createuntyped;
  189. cvarianttype:=tvariantdef.create(vt_normalvariant);
  190. colevarianttype:=tvariantdef.create(vt_olevariant);
  191. {$ifdef cpufpemu}
  192. { Normal types }
  193. (* we use the same types as without emulator, the only
  194. difference is that direct calls to the emulator are generated
  195. if (cs_fp_emulation in current_settings.moduleswitches) then
  196. begin
  197. addtype('Single',s32floattype);
  198. { extended size is the best real type for the target }
  199. addtype('Real',s32floattype);
  200. pbestrealtype:=@s32floattype;
  201. { extended size is the best real type for the target }
  202. addtype('Extended',pbestrealtype^);
  203. end
  204. else
  205. *)
  206. {$endif cpufpemu}
  207. begin
  208. addtype('Single',s32floattype);
  209. addtype('Double',s64floattype);
  210. { extended size is the best real type for the target }
  211. addtype('Extended',pbestrealtype^);
  212. end;
  213. {$ifdef x86}
  214. if target_info.system<>system_x86_64_win64 then
  215. addtype('Comp',tfloatdef.create(s64comp));
  216. {$endif x86}
  217. addtype('Currency',s64currencytype);
  218. addtype('Pointer',voidpointertype);
  219. {$ifdef x86}
  220. addtype('FarPointer',voidfarpointertype);
  221. {$endif x86}
  222. addtype('ShortString',cshortstringtype);
  223. {$ifdef support_longstring}
  224. addtype('LongString',clongstringtype);
  225. {$endif support_longstring}
  226. addtype('AnsiString',cansistringtype);
  227. addtype('WideString',cwidestringtype);
  228. addtype('OpenString',openshortstringtype);
  229. addtype('Boolean',booltype);
  230. addtype('ByteBool',booltype);
  231. addtype('WordBool',bool16type);
  232. addtype('LongBool',bool32type);
  233. addtype('QWordBool',bool64type);
  234. addtype('Byte',u8inttype);
  235. addtype('ShortInt',s8inttype);
  236. addtype('Word',u16inttype);
  237. addtype('SmallInt',s16inttype);
  238. addtype('LongWord',u32inttype);
  239. addtype('LongInt',s32inttype);
  240. addtype('QWord',u64inttype);
  241. addtype('Int64',s64inttype);
  242. addtype('Char',cchartype);
  243. addtype('WideChar',cwidechartype);
  244. addtype('Text',tfiledef.createtext);
  245. addtype('TypedFile',tfiledef.createtyped(voidtype));
  246. addtype('Variant',cvarianttype);
  247. addtype('OleVariant',colevarianttype);
  248. { Internal types }
  249. addtype('$undefined',cundefinedtype);
  250. addtype('$formal',cformaltype);
  251. addtype('$typedformal',ctypedformaltype);
  252. addtype('$void',voidtype);
  253. addtype('$byte',u8inttype);
  254. addtype('$shortint',s8inttype);
  255. addtype('$word',u16inttype);
  256. addtype('$smallint',s16inttype);
  257. addtype('$ulong',u32inttype);
  258. addtype('$longint',s32inttype);
  259. addtype('$qword',u64inttype);
  260. addtype('$int64',s64inttype);
  261. addtype('$char',cchartype);
  262. addtype('$widechar',cwidechartype);
  263. addtype('$shortstring',cshortstringtype);
  264. addtype('$longstring',clongstringtype);
  265. addtype('$ansistring',cansistringtype);
  266. addtype('$widestring',cwidestringtype);
  267. addtype('$openshortstring',openshortstringtype);
  268. addtype('$boolean',booltype);
  269. addtype('$boolean16',bool16type);
  270. addtype('$boolean32',bool32type);
  271. addtype('$boolean64',bool64type);
  272. addtype('$void_pointer',voidpointertype);
  273. addtype('$char_pointer',charpointertype);
  274. addtype('$widechar_pointer',widecharpointertype);
  275. addtype('$void_farpointer',voidfarpointertype);
  276. addtype('$openchararray',openchararraytype);
  277. addtype('$file',cfiletype);
  278. addtype('$variant',cvarianttype);
  279. addtype('$olevariant',cvarianttype);
  280. addtype('$s32real',s32floattype);
  281. addtype('$s64real',s64floattype);
  282. addtype('$s80real',s80floattype);
  283. addtype('$s64currency',s64currencytype);
  284. { Add a type for virtual method tables }
  285. hrecst:=trecordsymtable.create(current_settings.packrecords);
  286. vmttype:=trecorddef.create(hrecst);
  287. pvmttype:=tpointerdef.create(vmttype);
  288. { can't use addtype for pvmt because the rtti of the pointed
  289. type is not available. The rtti for pvmt will be written implicitly
  290. by thev tblarray below }
  291. systemunit.insert(ttypesym.create('$pvmt',pvmttype));
  292. hrecst.insertfield(tfieldvarsym.create('$parent',vs_value,pvmttype,[]));
  293. hrecst.insertfield(tfieldvarsym.create('$length',vs_value,s32inttype,[]));
  294. hrecst.insertfield(tfieldvarsym.create('$mlength',vs_value,s32inttype,[]));
  295. vmtarraytype:=tarraydef.create(0,1,s32inttype);
  296. tarraydef(vmtarraytype).elementdef:=voidpointertype;
  297. hrecst.insertfield(tfieldvarsym.create('$__pfn',vs_value,vmtarraytype,[]));
  298. addtype('$__vtbl_ptr_type',vmttype);
  299. vmtarraytype:=tarraydef.create(0,1,s32inttype);
  300. tarraydef(vmtarraytype).elementdef:=pvmttype;
  301. addtype('$vtblarray',vmtarraytype);
  302. { Add a type for methodpointers }
  303. hrecst:=trecordsymtable.create(1);
  304. hrecst.insertfield(tfieldvarsym.create('$proc',vs_value,voidpointertype,[]));
  305. hrecst.insertfield(tfieldvarsym.create('$self',vs_value,voidpointertype,[]));
  306. methodpointertype:=trecorddef.create(hrecst);
  307. addtype('$methodpointer',methodpointertype);
  308. symtablestack.pop(systemunit);
  309. end;
  310. procedure load_intern_types;
  311. {
  312. Load all default definitions for consts from the system unit
  313. }
  314. procedure loadtype(const s:string;var def:tdef);
  315. var
  316. srsym : ttypesym;
  317. begin
  318. srsym:=search_system_type(s);
  319. def:=srsym.typedef;
  320. end;
  321. var
  322. oldcurrentmodule : tmodule;
  323. begin
  324. if target_info.system=system_x86_64_win64 then
  325. pbestrealtype:=@s64floattype;
  326. oldcurrentmodule:=current_module;
  327. set_current_module(nil);
  328. loadtype('byte',u8inttype);
  329. loadtype('shortint',s8inttype);
  330. loadtype('word',u16inttype);
  331. loadtype('smallint',s16inttype);
  332. loadtype('ulong',u32inttype);
  333. loadtype('longint',s32inttype);
  334. loadtype('qword',u64inttype);
  335. loadtype('int64',s64inttype);
  336. loadtype('undefined',cundefinedtype);
  337. loadtype('formal',cformaltype);
  338. loadtype('typedformal',ctypedformaltype);
  339. loadtype('void',voidtype);
  340. loadtype('char',cchartype);
  341. loadtype('widechar',cwidechartype);
  342. loadtype('shortstring',cshortstringtype);
  343. loadtype('longstring',clongstringtype);
  344. loadtype('ansistring',cansistringtype);
  345. loadtype('widestring',cwidestringtype);
  346. loadtype('openshortstring',openshortstringtype);
  347. loadtype('openchararray',openchararraytype);
  348. loadtype('s32real',s32floattype);
  349. loadtype('s64real',s64floattype);
  350. loadtype('s80real',s80floattype);
  351. loadtype('s64currency',s64currencytype);
  352. loadtype('boolean',booltype);
  353. loadtype('boolean16',bool16type);
  354. loadtype('boolean32',bool32type);
  355. loadtype('boolean64',bool64type);
  356. loadtype('void_pointer',voidpointertype);
  357. loadtype('char_pointer',charpointertype);
  358. loadtype('widechar_pointer',widecharpointertype);
  359. loadtype('void_farpointer',voidfarpointertype);
  360. loadtype('file',cfiletype);
  361. loadtype('pvmt',pvmttype);
  362. loadtype('vtblarray',vmtarraytype);
  363. loadtype('__vtbl_ptr_type',vmttype);
  364. loadtype('variant',cvarianttype);
  365. loadtype('olevariant',colevarianttype);
  366. loadtype('methodpointer',methodpointertype);
  367. loadtype('HRESULT',hresultdef);
  368. {$ifdef cpu64bit}
  369. uinttype:=u64inttype;
  370. sinttype:=s64inttype;
  371. ptruinttype:=u64inttype;
  372. ptrsinttype:=s64inttype;
  373. {$else cpu64bit}
  374. uinttype:=u32inttype;
  375. sinttype:=s32inttype;
  376. ptruinttype:=u32inttype;
  377. ptrsinttype:=s32inttype;
  378. {$endif cpu64bit}
  379. set_current_module(oldcurrentmodule);
  380. end;
  381. procedure registernodes;
  382. {
  383. Register all possible nodes in the nodeclass array that
  384. will be used for loading the nodes from a ppu
  385. }
  386. begin
  387. nodeclass[addn]:=caddnode;
  388. nodeclass[muln]:=caddnode;
  389. nodeclass[subn]:=caddnode;
  390. nodeclass[divn]:=cmoddivnode;
  391. nodeclass[symdifn]:=caddnode;
  392. nodeclass[modn]:=cmoddivnode;
  393. nodeclass[assignn]:=cassignmentnode;
  394. nodeclass[loadn]:=cloadnode;
  395. nodeclass[rangen]:=crangenode;
  396. nodeclass[ltn]:=caddnode;
  397. nodeclass[lten]:=caddnode;
  398. nodeclass[gtn]:=caddnode;
  399. nodeclass[gten]:=caddnode;
  400. nodeclass[equaln]:=caddnode;
  401. nodeclass[unequaln]:=caddnode;
  402. nodeclass[inn]:=cinnode;
  403. nodeclass[orn]:=caddnode;
  404. nodeclass[xorn]:=caddnode;
  405. nodeclass[shrn]:=cshlshrnode;
  406. nodeclass[shln]:=cshlshrnode;
  407. nodeclass[slashn]:=caddnode;
  408. nodeclass[andn]:=caddnode;
  409. nodeclass[subscriptn]:=csubscriptnode;
  410. nodeclass[derefn]:=cderefnode;
  411. nodeclass[addrn]:=caddrnode;
  412. nodeclass[ordconstn]:=cordconstnode;
  413. nodeclass[typeconvn]:=ctypeconvnode;
  414. nodeclass[calln]:=ccallnode;
  415. nodeclass[callparan]:=ccallparanode;
  416. nodeclass[realconstn]:=crealconstnode;
  417. nodeclass[unaryminusn]:=cunaryminusnode;
  418. nodeclass[asmn]:=casmnode;
  419. nodeclass[vecn]:=cvecnode;
  420. nodeclass[pointerconstn]:=cpointerconstnode;
  421. nodeclass[stringconstn]:=cstringconstnode;
  422. nodeclass[notn]:=cnotnode;
  423. nodeclass[inlinen]:=cinlinenode;
  424. nodeclass[niln]:=cnilnode;
  425. nodeclass[errorn]:=cerrornode;
  426. nodeclass[typen]:=ctypenode;
  427. nodeclass[setelementn]:=csetelementnode;
  428. nodeclass[setconstn]:=csetconstnode;
  429. nodeclass[blockn]:=cblocknode;
  430. nodeclass[statementn]:=cstatementnode;
  431. nodeclass[ifn]:=cifnode;
  432. nodeclass[breakn]:=cbreaknode;
  433. nodeclass[continuen]:=ccontinuenode;
  434. nodeclass[whilerepeatn]:=cwhilerepeatnode;
  435. nodeclass[forn]:=cfornode;
  436. nodeclass[exitn]:=cexitnode;
  437. nodeclass[withn]:=cwithnode;
  438. nodeclass[casen]:=ccasenode;
  439. nodeclass[labeln]:=clabelnode;
  440. nodeclass[goton]:=cgotonode;
  441. nodeclass[tryexceptn]:=ctryexceptnode;
  442. nodeclass[raisen]:=craisenode;
  443. nodeclass[tryfinallyn]:=ctryfinallynode;
  444. nodeclass[onn]:=connode;
  445. nodeclass[isn]:=cisnode;
  446. nodeclass[asn]:=casnode;
  447. nodeclass[starstarn]:=caddnode;
  448. nodeclass[arrayconstructorn]:=carrayconstructornode;
  449. nodeclass[arrayconstructorrangen]:=carrayconstructorrangenode;
  450. nodeclass[tempcreaten]:=ctempcreatenode;
  451. nodeclass[temprefn]:=ctemprefnode;
  452. nodeclass[tempdeleten]:=ctempdeletenode;
  453. nodeclass[addoptn]:=caddnode;
  454. nodeclass[nothingn]:=cnothingnode;
  455. nodeclass[loadvmtaddrn]:=cloadvmtaddrnode;
  456. nodeclass[guidconstn]:=cguidconstnode;
  457. nodeclass[rttin]:=crttinode;
  458. nodeclass[loadparentfpn]:=cloadparentfpnode;
  459. end;
  460. procedure registertais;
  461. {
  462. Register all possible tais in the taiclass array that
  463. will be used for loading the tais from a ppu
  464. }
  465. begin
  466. aiclass[ait_none]:=nil;
  467. aiclass[ait_align]:=tai_align;
  468. aiclass[ait_section]:=tai_section;
  469. aiclass[ait_comment]:=tai_comment;
  470. aiclass[ait_string]:=tai_string;
  471. aiclass[ait_instruction]:=taicpu;
  472. aiclass[ait_datablock]:=tai_datablock;
  473. aiclass[ait_symbol]:=tai_symbol;
  474. aiclass[ait_symbol_end]:=tai_symbol_end;
  475. aiclass[ait_directive]:=tai_directive;
  476. aiclass[ait_label]:=tai_label;
  477. aiclass[ait_const]:=tai_const;
  478. aiclass[ait_real_32bit]:=tai_real_32bit;
  479. aiclass[ait_real_64bit]:=tai_real_64bit;
  480. aiclass[ait_real_80bit]:=tai_real_80bit;
  481. aiclass[ait_comp_64bit]:=tai_comp_64bit;
  482. aiclass[ait_stab]:=tai_stab;
  483. aiclass[ait_force_line]:=tai_force_line;
  484. aiclass[ait_function_name]:=tai_function_name;
  485. {$ifdef alpha}
  486. { the follow is for the DEC Alpha }
  487. aiclass[ait_frame]:=tai_frame;
  488. aiclass[ait_ent]:=tai_ent;
  489. {$endif alpha}
  490. {$ifdef m68k}
  491. {$warning FIXME: tai_labeled_instruction doesn't exists}
  492. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  493. {$endif m68k}
  494. {$ifdef ia64}
  495. aiclass[ait_bundle]:=tai_bundle;
  496. aiclass[ait_stop]:=tai_stop;
  497. {$endif ia64}
  498. {$ifdef SPARC}
  499. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  500. {$endif SPARC}
  501. aiclass[ait_cutobject]:=tai_cutobject;
  502. aiclass[ait_regalloc]:=tai_regalloc;
  503. aiclass[ait_tempalloc]:=tai_tempalloc;
  504. aiclass[ait_marker]:=tai_marker;
  505. aiclass[ait_file]:=tai_file;
  506. aiclass[ait_loc]:=tai_loc;
  507. end;
  508. end.