psystem.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Load the system unit, create required defs for systemunit
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit psystem;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. symbase;
  23. procedure insertinternsyms(p : tsymtable);
  24. procedure insert_intern_types(p : tsymtable);
  25. procedure readconstdefs;
  26. procedure createconstdefs;
  27. procedure registernodes;
  28. procedure registertais;
  29. implementation
  30. uses
  31. globals,globtype,
  32. symconst,symtype,symsym,symdef,symtable,
  33. aasmtai,aasmcpu,
  34. {$ifdef GDB}
  35. gdb,
  36. {$endif GDB}
  37. node,nbas,nflw,nset,ncon,ncnv,nld,nmem,ncal,nmat,nadd,ninl,nopt
  38. {$ifdef Delphi}
  39. ,dmisc
  40. ,sysutils
  41. {$endif}
  42. ;
  43. procedure insertinternsyms(p : tsymtable);
  44. {
  45. all intern procedures for the system unit
  46. }
  47. begin
  48. p.insert(tsyssym.create('Concat',in_concat_x));
  49. p.insert(tsyssym.create('Write',in_write_x));
  50. p.insert(tsyssym.create('WriteLn',in_writeln_x));
  51. p.insert(tsyssym.create('Assigned',in_assigned_x));
  52. p.insert(tsyssym.create('Read',in_read_x));
  53. p.insert(tsyssym.create('ReadLn',in_readln_x));
  54. p.insert(tsyssym.create('Ofs',in_ofs_x));
  55. p.insert(tsyssym.create('SizeOf',in_sizeof_x));
  56. p.insert(tsyssym.create('TypeOf',in_typeof_x));
  57. p.insert(tsyssym.create('Low',in_low_x));
  58. p.insert(tsyssym.create('High',in_high_x));
  59. p.insert(tsyssym.create('Seg',in_seg_x));
  60. p.insert(tsyssym.create('Ord',in_ord_x));
  61. p.insert(tsyssym.create('Pred',in_pred_x));
  62. p.insert(tsyssym.create('Succ',in_succ_x));
  63. p.insert(tsyssym.create('Exclude',in_exclude_x_y));
  64. p.insert(tsyssym.create('Include',in_include_x_y));
  65. p.insert(tsyssym.create('Break',in_break));
  66. p.insert(tsyssym.create('Exit',in_exit));
  67. p.insert(tsyssym.create('Continue',in_continue));
  68. p.insert(tsyssym.create('Dec',in_dec_x));
  69. p.insert(tsyssym.create('Inc',in_inc_x));
  70. p.insert(tsyssym.create('Str',in_str_x_string));
  71. p.insert(tsyssym.create('Assert',in_assert_x_y));
  72. p.insert(tsyssym.create('Val',in_val_x));
  73. p.insert(tsyssym.create('Addr',in_addr_x));
  74. p.insert(tsyssym.create('TypeInfo',in_typeinfo_x));
  75. p.insert(tsyssym.create('SetLength',in_setlength_x));
  76. p.insert(tsyssym.create('Copy',in_copy_x));
  77. p.insert(tsyssym.create('Initialize',in_initialize_x));
  78. p.insert(tsyssym.create('Finalize',in_finalize_x));
  79. p.insert(tsyssym.create('Length',in_length_x));
  80. p.insert(tsyssym.create('New',in_new_x));
  81. p.insert(tsyssym.create('Dispose',in_dispose_x));
  82. end;
  83. procedure insert_intern_types(p : tsymtable);
  84. {
  85. all the types inserted into the system unit
  86. }
  87. function addtype(const s:string;const t:ttype):ttypesym;
  88. begin
  89. result:=ttypesym.create(s,t);
  90. p.insert(result);
  91. { add init/final table if required }
  92. if t.def.needs_inittable then
  93. generate_inittable(result);
  94. end;
  95. procedure adddef(const s:string;def:tdef);
  96. var
  97. t : ttype;
  98. begin
  99. t.setdef(def);
  100. p.insert(ttypesym.create(s,t));
  101. end;
  102. var
  103. { several defs to simulate more or less C++ objects for GDB }
  104. vmttype,
  105. vmtarraytype : ttype;
  106. hrecst : trecordsymtable;
  107. begin
  108. {$ifdef cpufpemu}
  109. { Normal types }
  110. if (cs_fp_emulation in aktmoduleswitches) then
  111. begin
  112. addtype('Single',s32floattype);
  113. { extended size is the best real type for the target }
  114. addtype('Real',s32floattype);
  115. pbestrealtype:=@s32floattype;
  116. { extended size is the best real type for the target }
  117. addtype('Extended',pbestrealtype^);
  118. end
  119. else
  120. {$endif cpufpemu}
  121. begin
  122. addtype('Single',s32floattype);
  123. addtype('Double',s64floattype);
  124. { extended size is the best real type for the target }
  125. addtype('Extended',pbestrealtype^);
  126. addtype('Real',s64floattype);
  127. end;
  128. {$ifdef x86}
  129. adddef('Comp',tfloatdef.create(s64comp));
  130. {$endif x86}
  131. addtype('Currency',s64currencytype);
  132. addtype('Pointer',voidpointertype);
  133. addtype('FarPointer',voidfarpointertype);
  134. addtype('ShortString',cshortstringtype);
  135. addtype('LongString',clongstringtype);
  136. addtype('AnsiString',cansistringtype);
  137. addtype('WideString',cwidestringtype);
  138. addtype('Boolean',booltype);
  139. addtype('ByteBool',booltype);
  140. adddef('WordBool',torddef.create(bool16bit,0,1));
  141. adddef('LongBool',torddef.create(bool32bit,0,1));
  142. addtype('Char',cchartype);
  143. addtype('WideChar',cwidechartype);
  144. adddef('Text',tfiledef.createtext);
  145. addtype('Longword',u32bittype);
  146. addtype('QWord',cu64bittype);
  147. addtype('Int64',cs64bittype);
  148. adddef('TypedFile',tfiledef.createtyped(voidtype));
  149. addtype('Variant',cvarianttype);
  150. addtype('OleVariant',colevarianttype);
  151. { Internal types }
  152. addtype('$formal',cformaltype);
  153. addtype('$void',voidtype);
  154. addtype('$byte',u8bittype);
  155. addtype('$word',u16bittype);
  156. addtype('$ulong',u32bittype);
  157. addtype('$longint',s32bittype);
  158. addtype('$qword',cu64bittype);
  159. addtype('$int64',cs64bittype);
  160. addtype('$char',cchartype);
  161. addtype('$widechar',cwidechartype);
  162. addtype('$shortstring',cshortstringtype);
  163. addtype('$longstring',clongstringtype);
  164. addtype('$ansistring',cansistringtype);
  165. addtype('$widestring',cwidestringtype);
  166. addtype('$openshortstring',openshortstringtype);
  167. addtype('$boolean',booltype);
  168. addtype('$void_pointer',voidpointertype);
  169. addtype('$char_pointer',charpointertype);
  170. addtype('$void_farpointer',voidfarpointertype);
  171. addtype('$openchararray',openchararraytype);
  172. addtype('$file',cfiletype);
  173. addtype('$variant',cvarianttype);
  174. addtype('$olevariant',cvarianttype);
  175. addtype('$s32real',s32floattype);
  176. addtype('$s64real',s64floattype);
  177. addtype('$s80real',s80floattype);
  178. addtype('$s64currency',s64currencytype);
  179. { Add a type for virtual method tables }
  180. hrecst:=trecordsymtable.create(aktpackrecords);
  181. vmttype.setdef(trecorddef.create(hrecst));
  182. pvmttype.setdef(tpointerdef.create(vmttype));
  183. hrecst.insertfield(tvarsym.create('$parent',vs_value,pvmttype),true);
  184. hrecst.insertfield(tvarsym.create('$length',vs_value,s32bittype),true);
  185. hrecst.insertfield(tvarsym.create('$mlength',vs_value,s32bittype),true);
  186. vmtarraytype.setdef(tarraydef.create(0,1,s32bittype));
  187. tarraydef(vmtarraytype.def).setelementtype(voidpointertype);
  188. hrecst.insertfield(tvarsym.create('$__pfn',vs_value,vmtarraytype),true);
  189. addtype('$__vtbl_ptr_type',vmttype);
  190. addtype('$pvmt',pvmttype);
  191. vmtarraytype.setdef(tarraydef.create(0,1,s32bittype));
  192. tarraydef(vmtarraytype.def).setelementtype(pvmttype);
  193. addtype('$vtblarray',vmtarraytype);
  194. { Add a type for methodpointers }
  195. hrecst:=trecordsymtable.create(1);
  196. hrecst.insertfield(tvarsym.create('$proc',vs_value,voidpointertype),true);
  197. hrecst.insertfield(tvarsym.create('$self',vs_value,voidpointertype),true);
  198. methodpointertype.setdef(trecorddef.create(hrecst));
  199. addtype('$methodpointer',methodpointertype);
  200. { Add functions that require compiler magic }
  201. insertinternsyms(p);
  202. end;
  203. procedure readconstdefs;
  204. {
  205. Load all default definitions for consts from the system unit
  206. }
  207. begin
  208. globaldef('byte',u8bittype);
  209. globaldef('word',u16bittype);
  210. globaldef('ulong',u32bittype);
  211. globaldef('longint',s32bittype);
  212. globaldef('qword',cu64bittype);
  213. globaldef('int64',cs64bittype);
  214. globaldef('formal',cformaltype);
  215. globaldef('void',voidtype);
  216. globaldef('char',cchartype);
  217. globaldef('widechar',cwidechartype);
  218. globaldef('shortstring',cshortstringtype);
  219. globaldef('longstring',clongstringtype);
  220. globaldef('ansistring',cansistringtype);
  221. globaldef('widestring',cwidestringtype);
  222. globaldef('openshortstring',openshortstringtype);
  223. globaldef('openchararray',openchararraytype);
  224. globaldef('s32real',s32floattype);
  225. globaldef('s64real',s64floattype);
  226. globaldef('s80real',s80floattype);
  227. globaldef('s64currency',s64currencytype);
  228. globaldef('boolean',booltype);
  229. globaldef('void_pointer',voidpointertype);
  230. globaldef('char_pointer',charpointertype);
  231. globaldef('void_farpointer',voidfarpointertype);
  232. globaldef('file',cfiletype);
  233. globaldef('pvmt',pvmttype);
  234. globaldef('variant',cvarianttype);
  235. globaldef('olevariant',colevarianttype);
  236. globaldef('methodpointer',methodpointertype);
  237. {$ifdef i386}
  238. ordpointertype:=u32bittype;
  239. defaultordconsttype:=s32bittype;
  240. {$endif i386}
  241. {$ifdef x86_64}
  242. ordpointertype:=cu64bittype;
  243. defaultordconsttype:=cs64bittype;
  244. {$endif x86_64}
  245. {$ifdef powerpc}
  246. ordpointertype:=u32bittype;
  247. defaultordconsttype:=s32bittype;
  248. {$endif powerpc}
  249. {$ifdef sparc}
  250. ordpointertype:=u32bittype;
  251. defaultordconsttype:=s32bittype;
  252. {$endif sparc}
  253. {$ifdef m68k}
  254. ordpointertype:=u32bittype;
  255. defaultordconsttype:=s32bittype;
  256. {$endif}
  257. {$ifdef arm}
  258. ordpointertype:=u32bittype;
  259. defaultordconsttype:=s32bittype;
  260. {$endif arm}
  261. {$ifdef cpu64bit}
  262. inttype:=cs64bittype;
  263. {$else cpu64bit}
  264. inttype:=s32bittype;
  265. {$endif cpu64bit}
  266. end;
  267. procedure createconstdefs;
  268. {
  269. Create all default definitions for consts for the system unit
  270. }
  271. var
  272. oldregisterdef : boolean;
  273. begin
  274. { create definitions for constants }
  275. oldregisterdef:=registerdef;
  276. registerdef:=false;
  277. cformaltype.setdef(tformaldef.create);
  278. voidtype.setdef(torddef.create(uvoid,0,0));
  279. u8bittype.setdef(torddef.create(u8bit,0,255));
  280. u16bittype.setdef(torddef.create(u16bit,0,65535));
  281. u32bittype.setdef(torddef.create(u32bit,0,high(longword)));
  282. s32bittype.setdef(torddef.create(s32bit,low(longint),high(longint)));
  283. cu64bittype.setdef(torddef.create(u64bit,low(qword),TConstExprInt(high(qword))));
  284. cs64bittype.setdef(torddef.create(s64bit,low(int64),high(int64)));
  285. booltype.setdef(torddef.create(bool8bit,0,1));
  286. cchartype.setdef(torddef.create(uchar,0,255));
  287. cwidechartype.setdef(torddef.create(uwidechar,0,65535));
  288. cshortstringtype.setdef(tstringdef.createshort(255));
  289. { should we give a length to the default long and ansi string definition ?? }
  290. clongstringtype.setdef(tstringdef.createlong(-1));
  291. cansistringtype.setdef(tstringdef.createansi(-1));
  292. cwidestringtype.setdef(tstringdef.createwide(-1));
  293. { length=0 for shortstring is open string (needed for readln(string) }
  294. openshortstringtype.setdef(tstringdef.createshort(0));
  295. openchararraytype.setdef(tarraydef.create(0,-1,s32bittype));
  296. tarraydef(openchararraytype.def).setelementtype(cchartype);
  297. {$ifdef x86}
  298. {$ifdef i386}
  299. ordpointertype:=u32bittype;
  300. defaultordconsttype:=s32bittype;
  301. {$endif i386}
  302. {$ifdef x86_64}
  303. ordpointertype:=cu64bittype;
  304. defaultordconsttype:=cs64bittype;
  305. {$endif x86_64}
  306. s32floattype.setdef(tfloatdef.create(s32real));
  307. s64floattype.setdef(tfloatdef.create(s64real));
  308. s80floattype.setdef(tfloatdef.create(s80real));
  309. s64currencytype.setdef(tfloatdef.create(s64currency));
  310. {$endif x86}
  311. {$ifdef powerpc}
  312. ordpointertype:=u32bittype;
  313. defaultordconsttype:=s32bittype;
  314. s32floattype.setdef(tfloatdef.create(s32real));
  315. s64floattype.setdef(tfloatdef.create(s64real));
  316. s80floattype.setdef(tfloatdef.create(s80real));
  317. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  318. {$endif powerpc}
  319. {$ifdef sparc}
  320. ordpointertype:=u32bittype;
  321. defaultordconsttype:=s32bittype;
  322. s32floattype.setdef(tfloatdef.create(s32real));
  323. s64floattype.setdef(tfloatdef.create(s64real));
  324. s80floattype.setdef(tfloatdef.create(s80real));
  325. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  326. {$endif sparc}
  327. {$ifdef m68k}
  328. ordpointertype:=u32bittype;
  329. defaultordconsttype:=s32bittype;
  330. s32floattype.setdef(tfloatdef.create(s32real));
  331. s64floattype.setdef(tfloatdef.create(s64real));
  332. s80floattype.setdef(tfloatdef.create(s80real));
  333. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  334. {$endif}
  335. {$ifdef arm}
  336. ordpointertype:=u32bittype;
  337. defaultordconsttype:=s32bittype;
  338. s32floattype.setdef(tfloatdef.create(s32real));
  339. s64floattype.setdef(tfloatdef.create(s64real));
  340. s80floattype.setdef(tfloatdef.create(s80real));
  341. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  342. {$endif arm}
  343. {$ifdef cpu64bit}
  344. inttype:=cs64bittype;
  345. {$else cpu64bit}
  346. inttype:=s32bittype;
  347. {$endif cpu64bit}
  348. { some other definitions }
  349. voidpointertype.setdef(tpointerdef.create(voidtype));
  350. charpointertype.setdef(tpointerdef.create(cchartype));
  351. voidfarpointertype.setdef(tpointerdef.createfar(voidtype));
  352. cfiletype.setdef(tfiledef.createuntyped);
  353. cvarianttype.setdef(tvariantdef.create(vt_normalvariant));
  354. colevarianttype.setdef(tvariantdef.create(vt_olevariant));
  355. registerdef:=oldregisterdef;
  356. end;
  357. procedure registernodes;
  358. {
  359. Register all possible nodes in the nodeclass array that
  360. will be used for loading the nodes from a ppu
  361. }
  362. begin
  363. nodeclass[addn]:=caddnode;
  364. nodeclass[muln]:=caddnode;
  365. nodeclass[subn]:=caddnode;
  366. nodeclass[divn]:=cmoddivnode;
  367. nodeclass[symdifn]:=caddnode;
  368. nodeclass[modn]:=cmoddivnode;
  369. nodeclass[assignn]:=cassignmentnode;
  370. nodeclass[loadn]:=cloadnode;
  371. nodeclass[rangen]:=crangenode;
  372. nodeclass[ltn]:=caddnode;
  373. nodeclass[lten]:=caddnode;
  374. nodeclass[gtn]:=caddnode;
  375. nodeclass[gten]:=caddnode;
  376. nodeclass[equaln]:=caddnode;
  377. nodeclass[unequaln]:=caddnode;
  378. nodeclass[inn]:=cinnode;
  379. nodeclass[orn]:=caddnode;
  380. nodeclass[xorn]:=caddnode;
  381. nodeclass[shrn]:=cshlshrnode;
  382. nodeclass[shln]:=cshlshrnode;
  383. nodeclass[slashn]:=caddnode;
  384. nodeclass[andn]:=caddnode;
  385. nodeclass[subscriptn]:=csubscriptnode;
  386. nodeclass[derefn]:=cderefnode;
  387. nodeclass[addrn]:=caddrnode;
  388. nodeclass[ordconstn]:=cordconstnode;
  389. nodeclass[typeconvn]:=ctypeconvnode;
  390. nodeclass[calln]:=ccallnode;
  391. nodeclass[callparan]:=ccallparanode;
  392. nodeclass[realconstn]:=crealconstnode;
  393. nodeclass[unaryminusn]:=cunaryminusnode;
  394. nodeclass[asmn]:=casmnode;
  395. nodeclass[vecn]:=cvecnode;
  396. nodeclass[pointerconstn]:=cpointerconstnode;
  397. nodeclass[stringconstn]:=cstringconstnode;
  398. nodeclass[notn]:=cnotnode;
  399. nodeclass[inlinen]:=cinlinenode;
  400. nodeclass[niln]:=cnilnode;
  401. nodeclass[errorn]:=cerrornode;
  402. nodeclass[typen]:=ctypenode;
  403. nodeclass[setelementn]:=csetelementnode;
  404. nodeclass[setconstn]:=csetconstnode;
  405. nodeclass[blockn]:=cblocknode;
  406. nodeclass[statementn]:=cstatementnode;
  407. nodeclass[ifn]:=cifnode;
  408. nodeclass[breakn]:=cbreaknode;
  409. nodeclass[continuen]:=ccontinuenode;
  410. nodeclass[whilerepeatn]:=cwhilerepeatnode;
  411. nodeclass[forn]:=cfornode;
  412. nodeclass[exitn]:=cexitnode;
  413. nodeclass[withn]:=cwithnode;
  414. nodeclass[casen]:=ccasenode;
  415. nodeclass[labeln]:=clabelnode;
  416. nodeclass[goton]:=cgotonode;
  417. nodeclass[tryexceptn]:=ctryexceptnode;
  418. nodeclass[raisen]:=craisenode;
  419. nodeclass[tryfinallyn]:=ctryfinallynode;
  420. nodeclass[onn]:=connode;
  421. nodeclass[isn]:=cisnode;
  422. nodeclass[asn]:=casnode;
  423. nodeclass[caretn]:=caddnode;
  424. nodeclass[starstarn]:=caddnode;
  425. nodeclass[arrayconstructorn]:=carrayconstructornode;
  426. nodeclass[arrayconstructorrangen]:=carrayconstructorrangenode;
  427. nodeclass[tempcreaten]:=ctempcreatenode;
  428. nodeclass[temprefn]:=ctemprefnode;
  429. nodeclass[tempdeleten]:=ctempdeletenode;
  430. nodeclass[addoptn]:=caddnode;
  431. nodeclass[nothingn]:=cnothingnode;
  432. nodeclass[loadvmtaddrn]:=cloadvmtaddrnode;
  433. nodeclass[guidconstn]:=cguidconstnode;
  434. nodeclass[rttin]:=crttinode;
  435. nodeclass[loadparentfpn]:=cloadparentfpnode;
  436. end;
  437. procedure registertais;
  438. {
  439. Register all possible tais in the taiclass array that
  440. will be used for loading the tais from a ppu
  441. }
  442. begin
  443. aiclass[ait_none]:=nil;
  444. aiclass[ait_align]:=tai_align;
  445. aiclass[ait_section]:=tai_section;
  446. aiclass[ait_comment]:=tai_comment;
  447. aiclass[ait_direct]:=tai_direct;
  448. aiclass[ait_string]:=tai_string;
  449. aiclass[ait_instruction]:=taicpu;
  450. aiclass[ait_datablock]:=tai_datablock;
  451. aiclass[ait_symbol]:=tai_symbol;
  452. aiclass[ait_symbol_end]:=tai_symbol_end;
  453. aiclass[ait_label]:=tai_label;
  454. aiclass[ait_const_32bit]:=tai_const;
  455. aiclass[ait_const_16bit]:=tai_const;
  456. aiclass[ait_const_8bit]:=tai_const;
  457. aiclass[ait_const_symbol]:=tai_const_symbol;
  458. aiclass[ait_const_rva]:=tai_const_symbol;
  459. aiclass[ait_real_32bit]:=tai_real_32bit;
  460. aiclass[ait_real_64bit]:=tai_real_64bit;
  461. aiclass[ait_real_80bit]:=tai_real_80bit;
  462. aiclass[ait_comp_64bit]:=tai_comp_64bit;
  463. {$ifdef GDB}
  464. aiclass[ait_stabn]:=tai_stabn;
  465. aiclass[ait_stabs]:=tai_stabs;
  466. aiclass[ait_force_line]:=tai_force_line;
  467. aiclass[ait_stab_function_name]:=tai_stab_function_name;
  468. {$endif GDB}
  469. {$ifdef alpha}
  470. { the follow is for the DEC Alpha }
  471. aiclass[ait_frame]:=tai_frame;
  472. aiclass[ait_ent]:=tai_ent;
  473. {$endif alpha}
  474. {$ifdef m68k}
  475. {$warning FIXME: tai_labeled_instruction doesn't exists}
  476. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  477. {$endif m68k}
  478. {$ifdef ia64}
  479. aiclass[ait_bundle]:=tai_bundle;
  480. aiclass[ait_stop]:=tai_stop;
  481. {$endif ia64}
  482. {$ifdef SPARC}
  483. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  484. {$endif SPARC}
  485. aiclass[ait_cut]:=tai_cut;
  486. aiclass[ait_regalloc]:=tai_regalloc;
  487. aiclass[ait_tempalloc]:=tai_tempalloc;
  488. aiclass[ait_marker]:=tai_marker;
  489. end;
  490. end.
  491. {
  492. $Log$
  493. Revision 1.60 2004-01-28 22:16:31 peter
  494. * more record alignment fixes
  495. Revision 1.59 2004/01/20 12:59:37 florian
  496. * common addnode code for x86-64 and i386
  497. Revision 1.58 2003/11/29 16:19:54 peter
  498. * Initialize() added
  499. Revision 1.57 2003/10/06 22:23:41 florian
  500. + added basic olevariant support
  501. Revision 1.56 2003/09/28 17:55:04 peter
  502. * parent framepointer changed to hidden parameter
  503. * tloadparentfpnode added
  504. Revision 1.55 2003/09/23 17:56:06 peter
  505. * locals and paras are allocated in the code generation
  506. * tvarsym.localloc contains the location of para/local when
  507. generating code for the current procedure
  508. Revision 1.54 2003/09/03 11:18:37 florian
  509. * fixed arm concatcopy
  510. + arm support in the common compiler sources added
  511. * moved some generic cg code around
  512. + tfputype added
  513. * ...
  514. Revision 1.53 2003/08/10 17:25:23 peter
  515. * fixed some reported bugs
  516. Revision 1.52 2003/05/26 21:17:18 peter
  517. * procinlinenode removed
  518. * aktexit2label removed, fast exit removed
  519. + tcallnode.inlined_pass_2 added
  520. Revision 1.51 2003/05/25 11:34:17 peter
  521. * methodpointer self pushing fixed
  522. Revision 1.50 2003/05/13 19:14:41 peter
  523. * failn removed
  524. * inherited result code check moven to pexpr
  525. Revision 1.49 2003/05/09 17:47:03 peter
  526. * self moved to hidden parameter
  527. * removed hdisposen,hnewn,selfn
  528. Revision 1.48 2003/05/01 07:59:42 florian
  529. * introduced defaultordconsttype to decribe the default size of ordinal constants
  530. on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
  531. + added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
  532. * int64s/qwords are allowed as for loop counter on 64 bit CPUs
  533. Revision 1.47 2003/04/25 20:59:34 peter
  534. * removed funcretn,funcretsym, function result is now in varsym
  535. and aliases for result and function name are added using absolutesym
  536. * vs_hidden parameter for funcret passed in parameter
  537. * vs_hidden fixes
  538. * writenode changed to printnode and released from extdebug
  539. * -vp option added to generate a tree.log with the nodetree
  540. * nicer printnode for statements, callnode
  541. Revision 1.46 2003/04/23 21:10:54 peter
  542. * fix compile for ppc,sparc,m68k
  543. Revision 1.45 2003/04/23 20:16:04 peter
  544. + added currency support based on int64
  545. + is_64bit for use in cg units instead of is_64bitint
  546. * removed cgmessage from n386add, replace with internalerrors
  547. Revision 1.44 2002/12/06 16:56:59 peter
  548. * only compile cs_fp_emulation support when cpufpuemu is defined
  549. * define cpufpuemu for m68k only
  550. Revision 1.43 2002/11/30 21:32:26 carl
  551. + Add loading of softfpu in emulation mode
  552. + Correct routine call for softfpu
  553. * Extended type must also be defined even with softfpu
  554. Revision 1.42 2002/10/05 12:43:27 carl
  555. * fixes for Delphi 6 compilation
  556. (warning : Some features do not work under Delphi)
  557. Revision 1.41 2002/10/02 18:20:53 peter
  558. * Copy() is now internal syssym that calls compilerprocs
  559. Revision 1.40 2002/09/27 21:13:29 carl
  560. * low-highval always checked if limit ober 2GB is reached (to avoid overflow)
  561. Revision 1.39 2002/09/07 20:46:10 carl
  562. * cardinal -> longword
  563. Revision 1.38 2002/08/23 13:11:11 mazen
  564. fixed compilation problem related to tai_labeled_instruction
  565. Revision 1.37 2002/08/18 20:06:25 peter
  566. * inlining is now also allowed in interface
  567. * renamed write/load to ppuwrite/ppuload
  568. * tnode storing in ppu
  569. * nld,ncon,nbas are already updated for storing in ppu
  570. Revision 1.36 2002/08/15 19:10:35 peter
  571. * first things tai,tnode storing in ppu
  572. Revision 1.35 2002/08/14 19:14:39 carl
  573. + fpu emulation support (generic and untested)
  574. Revision 1.34 2002/08/13 18:01:52 carl
  575. * rename swatoperands to swapoperands
  576. + m68k first compilable version (still needs a lot of testing):
  577. assembler generator, system information , inline
  578. assembler reader.
  579. Revision 1.33 2002/08/11 15:28:00 florian
  580. + support of explicit type case <any ordinal type>->pointer
  581. (delphi mode only)
  582. Revision 1.32 2002/07/25 17:54:24 carl
  583. + Extended is now CPU dependant (equal to bestrealtype)
  584. Revision 1.30 2002/07/07 09:52:32 florian
  585. * powerpc target fixed, very simple units can be compiled
  586. * some basic stuff for better callparanode handling, far from being finished
  587. Revision 1.29 2002/07/06 20:18:47 carl
  588. + more SPARC patches from Mazen
  589. Revision 1.28 2002/07/04 20:43:02 florian
  590. * first x86-64 patches
  591. Revision 1.27 2002/07/01 16:23:54 peter
  592. * cg64 patch
  593. * basics for currency
  594. * asnode updates for class and interface (not finished)
  595. Revision 1.26 2002/05/18 13:34:16 peter
  596. * readded missing revisions
  597. Revision 1.25 2002/05/16 19:46:44 carl
  598. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  599. + try to fix temp allocation (still in ifdef)
  600. + generic constructor calls
  601. + start of tassembler / tmodulebase class cleanup
  602. Revision 1.23 2002/05/12 16:53:09 peter
  603. * moved entry and exitcode to ncgutil and cgobj
  604. * foreach gets extra argument for passing local data to the
  605. iterator function
  606. * -CR checks also class typecasts at runtime by changing them
  607. into as
  608. * fixed compiler to cycle with the -CR option
  609. * fixed stabs with elf writer, finally the global variables can
  610. be watched
  611. * removed a lot of routines from cga unit and replaced them by
  612. calls to cgobj
  613. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  614. u32bit then the other is typecasted also to u32bit without giving
  615. a rangecheck warning/error.
  616. * fixed pascal calling method with reversing also the high tree in
  617. the parast, detected by tcalcst3 test
  618. Revision 1.22 2002/01/24 12:33:53 jonas
  619. * adapted ranges of native types to int64 (e.g. high cardinal is no
  620. longer longint($ffffffff), but just $fffffff in psystem)
  621. * small additional fix in 64bit rangecheck code generation for 32 bit
  622. processors
  623. * adaption of ranges required the matching talgorithm used for selecting
  624. which overloaded procedure to call to be adapted. It should now always
  625. select the closest match for ordinal parameters.
  626. + inttostr(qword) in sysstr.inc/sysstrh.inc
  627. + abs(int64), sqr(int64), sqr(qword) in systemh.inc/generic.inc (previous
  628. fixes were required to be able to add them)
  629. * is_in_limit() moved from ncal to types unit, should always be used
  630. instead of direct comparisons of low/high values of orddefs because
  631. qword is a special case
  632. }