ncgset.pas 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl and Carl Eric Codere
  4. Generate generic assembler for in set/case nodes
  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 ncgset;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. node,nset,cpubase,cginfo,cgbase,cgobj,aasmbase,aasmtai,globals;
  23. type
  24. tcgsetelementnode = class(tsetelementnode)
  25. procedure pass_2;override;
  26. end;
  27. tcginnode = class(tinnode)
  28. procedure pass_2;override;
  29. protected
  30. {# Routine to test bitnumber in bitnumber register on value
  31. in value register. The __result register should be set
  32. to one if the bit is set, otherwise __result register
  33. should be set to zero.
  34. Should be overriden on processors which have specific
  35. instructions to do bit tests.
  36. }
  37. procedure emit_bit_test_reg_reg(list : taasmoutput; bitnumber : tregister;
  38. value : tregister; __result :tregister);virtual;
  39. end;
  40. tcgcasenode = class(tcasenode)
  41. {
  42. Emits the case node statement. Contrary to the intel
  43. 80x86 version, this version does not emit jump tables,
  44. because of portability problems.
  45. }
  46. procedure pass_2;override;
  47. protected
  48. with_sign : boolean;
  49. opsize : tcgsize;
  50. jmp_gt,jmp_lt,jmp_le : topcmp;
  51. { register with case expression }
  52. hregister,hregister2 : tregister;
  53. endlabel,elselabel : tasmlabel;
  54. { true, if we can omit the range check of the jump table }
  55. jumptable_no_range : boolean;
  56. { has the implementation jumptable support }
  57. min_label : tconstexprint;
  58. procedure optimizevalues(var max_linear_list:longint;var max_dist:cardinal);virtual;
  59. function has_jumptable : boolean;virtual;
  60. procedure genjumptable(hp : pcaserecord;min_,max_ : longint); virtual;
  61. procedure genlinearlist(hp : pcaserecord); virtual;
  62. procedure genlinearcmplist(hp : pcaserecord); virtual;
  63. procedure gentreejmp(p : pcaserecord);
  64. end;
  65. implementation
  66. uses
  67. globtype,systems,
  68. verbose,
  69. symconst,symdef,defutil,
  70. paramgr,
  71. pass_2,
  72. nbas,ncon,nflw,
  73. tgobj,ncgutil,regvars,rgobj,cpuinfo;
  74. {*****************************************************************************
  75. TCGSETELEMENTNODE
  76. *****************************************************************************}
  77. procedure tcgsetelementnode.pass_2;
  78. var
  79. pushedregs : tmaybesave;
  80. begin
  81. { load first value in 32bit register }
  82. secondpass(left);
  83. if left.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  84. location_force_reg(exprasmlist,left.location,OS_32,false);
  85. { also a second value ? }
  86. if assigned(right) then
  87. begin
  88. {$ifndef newra}
  89. maybe_save(exprasmlist,right.registers32,left.location,pushedregs);
  90. {$endif}
  91. secondpass(right);
  92. if codegenerror then
  93. exit;
  94. {$ifndef newra}
  95. maybe_restore(exprasmlist,left.location,pushedregs);
  96. {$endif newra}
  97. if right.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  98. location_force_reg(exprasmlist,right.location,OS_32,false);
  99. end;
  100. { we doesn't modify the left side, we check only the type }
  101. location_copy(location,left.location);
  102. end;
  103. {*****************************************************************************
  104. *****************************************************************************}
  105. {**********************************************************************}
  106. { Description: Emit operation to do a bit test, where the bitnumber }
  107. { to test is in the bitnumber register. The value to test against is }
  108. { located in the value register. }
  109. { WARNING: Bitnumber register value is DESTROYED! }
  110. { __Result register is set to 1, if the bit is set otherwise, __Result}
  111. { is set to zero. __RESULT register is also used as scratch. }
  112. {**********************************************************************}
  113. procedure tcginnode.emit_bit_test_reg_reg(list : taasmoutput; bitnumber : tregister; value : tregister; __result :tregister);
  114. begin
  115. { first make sure that the bit number is modulo 32 }
  116. { not necessary, since if it's > 31, we have a range error -> will }
  117. { be caught when range checking is on! (JM) }
  118. { cg.a_op_const_reg(list,OP_AND,31,bitnumber); }
  119. { rotate value register "bitnumber" bits to the right }
  120. cg.a_op_reg_reg_reg(list,OP_SHR,OS_INT,bitnumber,value,__result);
  121. { extract the bit we want }
  122. cg.a_op_const_reg(list,OP_AND,1,__result);
  123. end;
  124. procedure tcginnode.pass_2;
  125. type
  126. Tsetpart=record
  127. range : boolean; {Part is a range.}
  128. start,stop : byte; {Start/stop when range; Stop=element when an element.}
  129. end;
  130. var
  131. genjumps,
  132. use_small,
  133. ranges : boolean;
  134. hr,hr2,hr3,
  135. pleftreg : tregister;
  136. opsize : tcgsize;
  137. setparts : array[1..8] of Tsetpart;
  138. i,numparts : byte;
  139. adjustment : longint;
  140. pushedregs : tmaybesave;
  141. l,l2,l3 : tasmlabel;
  142. r:Tregister;
  143. {$ifdef oldset}
  144. function analizeset(Aset:Pconstset;is_small:boolean):boolean;
  145. type
  146. byteset=set of byte;
  147. {$else}
  148. function analizeset(const Aset:Tconstset;is_small:boolean):boolean;
  149. {$endif}
  150. var
  151. compares,maxcompares:word;
  152. i:byte;
  153. begin
  154. analizeset:=false;
  155. ranges:=false;
  156. numparts:=0;
  157. compares:=0;
  158. { Lots of comparisions take a lot of time, so do not allow
  159. too much comparisions. 8 comparisions are, however, still
  160. smalller than emitting the set }
  161. if cs_littlesize in aktglobalswitches then
  162. maxcompares:=8
  163. else
  164. maxcompares:=5;
  165. { when smallset is possible allow only 3 compares the smallset
  166. code is for littlesize also smaller when more compares are used }
  167. if is_small then
  168. maxcompares:=3;
  169. for i:=0 to 255 do
  170. {$ifdef oldset}
  171. if i in byteset(Aset^) then
  172. {$else}
  173. if i in Aset then
  174. {$endif}
  175. begin
  176. if (numparts=0) or (i<>setparts[numparts].stop+1) then
  177. begin
  178. {Set element is a separate element.}
  179. inc(compares);
  180. if compares>maxcompares then
  181. exit;
  182. inc(numparts);
  183. setparts[numparts].range:=false;
  184. setparts[numparts].stop:=i;
  185. end
  186. else
  187. {Set element is part of a range.}
  188. if not setparts[numparts].range then
  189. begin
  190. {Transform an element into a range.}
  191. setparts[numparts].range:=true;
  192. setparts[numparts].start:=setparts[numparts].stop;
  193. setparts[numparts].stop:=i;
  194. ranges := true;
  195. { there's only one compare per range anymore. Only a }
  196. { sub is added, but that's much faster than a }
  197. { cmp/jcc combo so neglect its effect }
  198. { inc(compares);
  199. if compares>maxcompares then
  200. exit; }
  201. end
  202. else
  203. begin
  204. {Extend a range.}
  205. setparts[numparts].stop:=i;
  206. end;
  207. end;
  208. analizeset:=true;
  209. end;
  210. begin
  211. { We check first if we can generate jumps, this can be done
  212. because the resulttype.def is already set in firstpass }
  213. { check if we can use smallset operation using btl which is limited
  214. to 32 bits, the left side may also not contain higher values !! }
  215. use_small:=(tsetdef(right.resulttype.def).settype=smallset) and
  216. ((left.resulttype.def.deftype=orddef) and (torddef(left.resulttype.def).high<=32) or
  217. (left.resulttype.def.deftype=enumdef) and (tenumdef(left.resulttype.def).max<=32));
  218. { Can we generate jumps? Possible for all types of sets }
  219. {$ifdef oldset}
  220. genjumps:=(right.nodetype=setconstn) and
  221. analizeset(Tsetconstnode(right).value_set,use_small);
  222. {$else}
  223. genjumps:=(right.nodetype=setconstn) and
  224. analizeset(Tsetconstnode(right).value_set^,use_small);
  225. {$endif}
  226. { calculate both operators }
  227. { the complex one first }
  228. firstcomplex(self);
  229. secondpass(left);
  230. { Only process the right if we are not generating jumps }
  231. if not genjumps then
  232. begin
  233. {$ifndef newra}
  234. maybe_save(exprasmlist,right.registers32,left.location,pushedregs);
  235. {$endif}
  236. secondpass(right);
  237. {$ifndef newra}
  238. maybe_restore(exprasmlist,left.location,pushedregs);
  239. {$endif}
  240. end;
  241. if codegenerror then
  242. exit;
  243. { ofcourse not commutative }
  244. if nf_swaped in flags then
  245. swapleftright;
  246. { location is always LOC_JUMP }
  247. location_reset(location,LOC_REGISTER,OS_INT);
  248. { allocate a register for the result }
  249. location.register := rg.getregisterint(exprasmlist,OS_INT);
  250. if genjumps then
  251. begin
  252. { Get a label to jump to the end }
  253. objectlibrary.getlabel(l);
  254. { clear the register value, indicating result is FALSE }
  255. cg.a_load_const_reg(exprasmlist,OS_INT,0,location.register);
  256. opsize := def_cgsize(left.resulttype.def);
  257. { If register is used, use only lower 8 bits }
  258. if left.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  259. begin
  260. { for ranges we always need a 32bit register, because then we }
  261. { use the register as base in a reference (JM) }
  262. if ranges then
  263. begin
  264. pleftreg:=rg.makeregsize(left.location.register,OS_INT);
  265. cg.a_load_reg_reg(exprasmlist,left.location.size,OS_INT,left.location.register,pleftreg);
  266. if opsize <> OS_INT then
  267. cg.a_op_const_reg(exprasmlist,OP_AND,255,pleftreg);
  268. opsize := OS_INT;
  269. end
  270. else
  271. { otherwise simply use the lower 8 bits (no "and" }
  272. { necessary this way) (JM) }
  273. begin
  274. pleftreg:=rg.makeregsize(left.location.register,OS_8);
  275. opsize := OS_8;
  276. end;
  277. end
  278. else
  279. begin
  280. { load the value in a register }
  281. {$ifdef newra}
  282. pleftreg:=rg.getregisterint(exprasmlist,OS_INT);
  283. {$else}
  284. pleftreg := cg.get_scratch_reg_int(exprasmlist,OS_INT);
  285. {$endif}
  286. opsize := OS_INT;
  287. cg.a_load_ref_reg(exprasmlist,def_cgsize(left.resulttype.def),left.location.reference,pleftreg);
  288. end;
  289. { how much have we already substracted from the x in the }
  290. { "x in [y..z]" expression }
  291. adjustment := 0;
  292. hr.enum := R_NO;
  293. for i:=1 to numparts do
  294. if setparts[i].range then
  295. { use fact that a <= x <= b <=> cardinal(x-a) <= cardinal(b-a) }
  296. begin
  297. { is the range different from all legal values? }
  298. if (setparts[i].stop-setparts[i].start <> 255) then
  299. begin
  300. { yes, is the lower bound <> 0? }
  301. if (setparts[i].start <> 0) then
  302. { we're going to substract from the left register, }
  303. { so in case of a LOC_CREGISTER first move the value }
  304. { to edi (not done before because now we can do the }
  305. { move and substract in one instruction with LEA) }
  306. if (left.location.loc = LOC_CREGISTER) and
  307. (hr.enum <> pleftreg.enum) then
  308. begin
  309. {$ifdef newra}
  310. hr:=rg.getregisterint(exprasmlist,OS_INT);
  311. {$else}
  312. hr:=cg.get_scratch_reg_int(exprasmlist,OS_INT);
  313. {$endif}
  314. cg.a_op_const_reg_reg(exprasmlist,OP_SUB,opsize,setparts[i].start,pleftreg,hr);
  315. pleftreg:=hr;
  316. opsize := OS_INT;
  317. end
  318. else
  319. begin
  320. { otherwise, the value is already in a register }
  321. { that can be modified }
  322. cg.a_op_const_reg(exprasmlist,OP_SUB,
  323. setparts[i].start-adjustment,pleftreg)
  324. end;
  325. { new total value substracted from x: }
  326. { adjustment + (setparts[i].start - adjustment) }
  327. adjustment := setparts[i].start;
  328. { check if result < b-a+1 (not "result <= b-a", since }
  329. { we need a carry in case the element is in the range }
  330. { (this will never overflow since we check at the }
  331. { beginning whether stop-start <> 255) }
  332. cg.a_cmp_const_reg_label(exprasmlist, opsize, OC_B,
  333. setparts[i].stop-setparts[i].start+1,pleftreg,l);
  334. end
  335. else
  336. { if setparts[i].start = 0 and setparts[i].stop = 255, }
  337. { it's always true since "in" is only allowed for bytes }
  338. begin
  339. cg.a_jmp_always(exprasmlist,l);
  340. end;
  341. end
  342. else
  343. begin
  344. { Emit code to check if left is an element }
  345. cg.a_cmp_const_reg_label(exprasmlist, opsize, OC_EQ,
  346. setparts[i].stop-adjustment,pleftreg,l);
  347. end;
  348. { To compensate for not doing a second pass }
  349. right.location.reference.symbol:=nil;
  350. objectlibrary.getlabel(l3);
  351. cg.a_jmp_always(exprasmlist,l3);
  352. { Now place the end label if IN success }
  353. cg.a_label(exprasmlist,l);
  354. { result register is 1 }
  355. cg.a_load_const_reg(exprasmlist,OS_INT,1,location.register);
  356. { in case value is not found }
  357. cg.a_label(exprasmlist,l3);
  358. case left.location.loc of
  359. LOC_CREGISTER :
  360. {$ifdef newra}
  361. rg.ungetregisterint(exprasmlist,pleftreg);
  362. {$else}
  363. cg.free_scratch_reg(exprasmlist,pleftreg);
  364. {$endif}
  365. LOC_REGISTER :
  366. rg.ungetregisterint(exprasmlist,pleftreg);
  367. else
  368. begin
  369. reference_release(exprasmlist,left.location.reference);
  370. {$ifdef newra}
  371. rg.ungetregisterint(exprasmlist,pleftreg);
  372. {$else}
  373. cg.free_scratch_reg(exprasmlist,pleftreg);
  374. {$endif}
  375. end;
  376. end;
  377. end
  378. else
  379. {*****************************************************************}
  380. { NO JUMP TABLE GENERATION }
  381. {*****************************************************************}
  382. begin
  383. { We will now generated code to check the set itself, no jmps,
  384. handle smallsets separate, because it allows faster checks }
  385. if use_small then
  386. begin
  387. {**************************** SMALL SET **********************}
  388. if left.nodetype=ordconstn then
  389. begin
  390. { clear the register value, indicating result is FALSE }
  391. cg.a_load_const_reg(exprasmlist,OS_INT,0,location.register);
  392. case right.location.loc of
  393. LOC_REGISTER:
  394. hr:=right.location.register;
  395. LOC_CREGISTER:
  396. begin
  397. hr:=rg.getregisterint(exprasmlist,OS_INT);
  398. { load set value into register }
  399. cg.a_load_reg_reg(exprasmlist,OS_32,OS_32,
  400. right.location.register,hr);
  401. location_release(exprasmlist,right.location);
  402. end;
  403. LOC_REFERENCE,
  404. LOC_CREFERENCE :
  405. begin
  406. hr:=rg.getregisterint(exprasmlist,OS_INT);
  407. { load set value into register }
  408. cg.a_load_ref_reg(exprasmlist,OS_32,
  409. right.location.reference,hr);
  410. location_release(exprasmlist,right.location);
  411. end;
  412. else
  413. internalerror(200203312);
  414. end;
  415. { then SHR the register }
  416. cg.a_op_const_reg(exprasmlist,OP_SHR,
  417. tordconstnode(left).value and 31,hr);
  418. { then extract the lowest bit }
  419. cg.a_op_const_reg(exprasmlist,OP_AND,1,hr);
  420. location.register:=hr;
  421. end
  422. else
  423. begin
  424. case left.location.loc of
  425. LOC_REGISTER,
  426. LOC_CREGISTER:
  427. begin
  428. hr3.enum:=R_INTREGISTER;
  429. hr3.number:=(left.location.register.number and not $ff) or R_SUBWHOLE;
  430. cg.a_load_reg_reg(exprasmlist,left.location.size,OS_INT,left.location.register,hr3);
  431. {$ifdef newra}
  432. hr:=rg.getregisterint(exprasmlist,OS_INT);
  433. {$else}
  434. hr:=cg.get_scratch_reg_int(exprasmlist,OS_INT);
  435. {$endif}
  436. cg.a_load_reg_reg(exprasmlist,OS_INT,OS_INT,hr3,hr);
  437. end;
  438. else
  439. begin
  440. {$ifdef newra}
  441. hr:=rg.getregisterint(exprasmlist,OS_INT);
  442. {$else}
  443. hr:=cg.get_scratch_reg_int(exprasmlist,OS_INT);
  444. {$endif}
  445. cg.a_load_ref_reg(exprasmlist,def_cgsize(left.resulttype.def),
  446. left.location.reference,hr);
  447. location_release(exprasmlist,left.location);
  448. end;
  449. end;
  450. case right.location.loc of
  451. LOC_REGISTER,
  452. LOC_CREGISTER :
  453. begin
  454. hr2:=right.location.register;
  455. end;
  456. LOC_CONSTANT :
  457. begin
  458. hr2:=rg.getregisterint(exprasmlist,OS_32);
  459. cg.a_load_const_reg(exprasmlist,OS_32,
  460. right.location.value,hr2);
  461. end;
  462. LOC_CREFERENCE,
  463. LOC_REFERENCE :
  464. begin
  465. location_release(exprasmlist,right.location);
  466. hr2:=rg.getregisterint(exprasmlist,OS_32);
  467. cg.a_load_ref_reg(exprasmlist, OS_32,
  468. right.location.reference,hr2);
  469. end;
  470. else
  471. internalerror(2002032210);
  472. end;
  473. { emit bit test operation }
  474. emit_bit_test_reg_reg(exprasmlist,hr,hr2,location.register);
  475. { free the resources }
  476. case right.location.loc of
  477. LOC_REGISTER,
  478. LOC_CREGISTER :
  479. rg.ungetregisterint(exprasmlist,right.location.register);
  480. LOC_CONSTANT ,
  481. LOC_CREFERENCE,
  482. LOC_REFERENCE :
  483. rg.ungetregisterint(exprasmlist,hr2);
  484. else
  485. internalerror(2002032210);
  486. end;
  487. { free bitnumber register }
  488. {$ifdef newra}
  489. rg.ungetregisterint(exprasmlist,hr);
  490. {$else}
  491. cg.free_scratch_reg(exprasmlist,hr);
  492. {$endif}
  493. end;
  494. end
  495. else
  496. {************************** NOT SMALL SET ********************}
  497. begin
  498. if right.location.loc=LOC_CONSTANT then
  499. begin
  500. { this section has not been tested! }
  501. { can it actually occur currently? CEC }
  502. { yes: "if bytevar in [1,3,5,7,9,11,13,15]" (JM) }
  503. objectlibrary.getlabel(l);
  504. objectlibrary.getlabel(l2);
  505. case left.location.loc of
  506. LOC_REGISTER,
  507. LOC_CREGISTER:
  508. begin
  509. hr:=rg.makeregsize(left.location.register,OS_INT);
  510. cg.a_load_reg_reg(exprasmlist,left.location.size,OS_INT,left.location.register,hr);
  511. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,OC_BE,31,hr,l);
  512. { reset of result register is done in routine entry }
  513. cg.a_jmp_always(exprasmlist,l2);
  514. cg.a_label(exprasmlist,l);
  515. { We have to load the value into a register because
  516. btl does not accept values only refs or regs (PFV) }
  517. hr2:=rg.getregisterint(exprasmlist,OS_INT);
  518. cg.a_load_const_reg(exprasmlist,OS_INT,right.location.value,hr2);
  519. end;
  520. LOC_REFERENCE,LOC_CREFERENCE:
  521. begin
  522. cg.a_cmp_const_ref_label(exprasmlist,OS_8,OC_BE,31,left.location.reference,l);
  523. cg.a_jmp_always(exprasmlist,l2);
  524. cg.a_label(exprasmlist,l);
  525. location_release(exprasmlist,left.location);
  526. hr:=rg.getregisterint(exprasmlist,OS_32);
  527. cg.a_load_ref_reg(exprasmlist,OS_32,left.location.reference,hr);
  528. { We have to load the value into a register because
  529. btl does not accept values only refs or regs (PFV) }
  530. hr2:=rg.getregisterint(exprasmlist,OS_INT);
  531. cg.a_load_const_reg(exprasmlist,OS_INT,
  532. right.location.value,hr2);
  533. end;
  534. else
  535. internalerror(2002081002);
  536. end;
  537. { emit bit test operation }
  538. emit_bit_test_reg_reg(exprasmlist,hr,hr2,location.register);
  539. rg.ungetregisterint(exprasmlist,hr2);
  540. if not (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  541. rg.ungetregisterint(exprasmlist,hr);
  542. cg.a_label(exprasmlist,l2);
  543. end { of right.location.loc=LOC_CONSTANT }
  544. { do search in a normal set which could have >32 elementsm
  545. but also used if the left side contains higher values > 32 }
  546. else if left.nodetype=ordconstn then
  547. begin
  548. { use location.register as scratch register here }
  549. inc(right.location.reference.offset,tordconstnode(left).value shr 3);
  550. cg.a_load_ref_reg(exprasmlist, OS_8, right.location.reference, location.register);
  551. location_release(exprasmlist,right.location);
  552. cg.a_op_const_reg(exprasmlist,OP_SHR, tordconstnode(left).value and 7,
  553. location.register);
  554. cg.a_op_const_reg(exprasmlist, OP_AND,1,location.register);
  555. end
  556. else
  557. begin
  558. if (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  559. pleftreg:=rg.makeregsize(left.location.register,OS_INT)
  560. else
  561. pleftreg:=rg.getregisterint(exprasmlist,OS_INT);
  562. cg.a_load_loc_reg(exprasmlist,left.location,pleftreg);
  563. location_freetemp(exprasmlist,left.location);
  564. location_release(exprasmlist,left.location);
  565. cg.a_param_reg(exprasmlist,OS_8,pleftreg,paramanager.getintparaloc(2));
  566. cg.a_param_ref(exprasmlist,OS_ADDR,right.location.reference,paramanager.getintparaloc(1));
  567. cg.a_call_name(exprasmlist,'FPC_SET_IN_BYTE');
  568. { result of value is always one full register }
  569. r.enum:=R_INTREGISTER;
  570. r.number:=NR_ACCUMULATOR;
  571. cg.a_load_reg_reg(exprasmlist,OS_INT,OS_INT,r,location.register);
  572. { release the allocated register }
  573. if not (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  574. rg.ungetregisterint(exprasmlist,pleftreg);
  575. location_release(exprasmlist,right.location);
  576. end;
  577. end;
  578. end;
  579. location_freetemp(exprasmlist,right.location);
  580. end;
  581. {*****************************************************************************
  582. TCGCASENODE
  583. *****************************************************************************}
  584. procedure tcgcasenode.optimizevalues(var max_linear_list:longint;var max_dist:cardinal);
  585. begin
  586. { no changes by default }
  587. end;
  588. function tcgcasenode.has_jumptable : boolean;
  589. begin
  590. { No jumptable support in the default implementation }
  591. has_jumptable:=false;
  592. end;
  593. procedure tcgcasenode.genjumptable(hp : pcaserecord;min_,max_ : longint);
  594. begin
  595. internalerror(200209161);
  596. end;
  597. procedure tcgcasenode.genlinearlist(hp : pcaserecord);
  598. var
  599. first : boolean;
  600. last : TConstExprInt;
  601. scratch_reg: tregister;
  602. procedure genitem(t : pcaserecord);
  603. procedure gensub(value:longint);
  604. begin
  605. { here, since the sub and cmp are separate we need
  606. to move the result before subtract to a help
  607. register.
  608. }
  609. cg.a_load_reg_reg(exprasmlist, opsize, opsize, hregister, scratch_reg);
  610. cg.a_op_const_reg(exprasmlist, OP_SUB, value, hregister);
  611. end;
  612. begin
  613. if assigned(t^.less) then
  614. genitem(t^.less);
  615. { need we to test the first value }
  616. if first and (t^._low>get_min_value(left.resulttype.def)) then
  617. begin
  618. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,jmp_lt,aword(t^._low),hregister,elselabel);
  619. end;
  620. if t^._low=t^._high then
  621. begin
  622. if t^._low-last=0 then
  623. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ,0,hregister,t^.statement)
  624. else
  625. begin
  626. gensub(longint(t^._low-last));
  627. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ,aword(t^._low-last),scratch_reg,t^.statement);
  628. end;
  629. last:=t^._low;
  630. end
  631. else
  632. begin
  633. { it begins with the smallest label, if the value }
  634. { is even smaller then jump immediately to the }
  635. { ELSE-label }
  636. if first then
  637. begin
  638. { have we to ajust the first value ? }
  639. if (t^._low>get_min_value(left.resulttype.def)) then
  640. gensub(longint(t^._low));
  641. end
  642. else
  643. begin
  644. { if there is no unused label between the last and the }
  645. { present label then the lower limit can be checked }
  646. { immediately. else check the range in between: }
  647. gensub(longint(t^._low-last));
  648. cg.a_cmp_const_reg_label(exprasmlist, OS_INT,jmp_lt,aword(t^._low-last),scratch_reg,elselabel);
  649. end;
  650. gensub(longint(t^._high-t^._low));
  651. cg.a_cmp_const_reg_label(exprasmlist, OS_INT,jmp_le,aword(t^._high-t^._low),scratch_reg,t^.statement);
  652. last:=t^._high;
  653. end;
  654. first:=false;
  655. if assigned(t^.greater) then
  656. genitem(t^.greater);
  657. end;
  658. begin
  659. { do we need to generate cmps? }
  660. if (with_sign and (min_label<0)) then
  661. genlinearcmplist(hp)
  662. else
  663. begin
  664. last:=0;
  665. first:=true;
  666. {$ifdef newra}
  667. scratch_reg:=rg.getregisterint(exprasmlist,OS_INT);
  668. {$else newra}
  669. scratch_reg := cg.get_scratch_reg_int(exprasmlist,OS_INT);
  670. {$endif}
  671. genitem(hp);
  672. {$ifdef newra}
  673. rg.ungetregisterint(exprasmlist,scratch_reg);
  674. {$else}
  675. cg.free_scratch_reg(exprasmlist,scratch_reg);
  676. {$endif}
  677. cg.a_jmp_always(exprasmlist,elselabel);
  678. end;
  679. end;
  680. procedure tcgcasenode.genlinearcmplist(hp : pcaserecord);
  681. var
  682. first : boolean;
  683. last : TConstExprInt;
  684. procedure genitem(t : pcaserecord);
  685. var
  686. l1 : tasmlabel;
  687. begin
  688. if assigned(t^.less) then
  689. genitem(t^.less);
  690. if t^._low=t^._high then
  691. begin
  692. if opsize in [OS_S64,OS_64] then
  693. begin
  694. objectlibrary.getlabel(l1);
  695. {$ifdef Delphi}
  696. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_NE, hi((t^._low)),hregister2,l1);
  697. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ, lo((t^._low)),hregister, t^.statement);
  698. {$else}
  699. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_NE, aword(hi(int64(t^._low))),hregister2,l1);
  700. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ, aword(lo(int64(t^._low))),hregister, t^.statement);
  701. {$endif}
  702. cg.a_label(exprasmlist,l1);
  703. end
  704. else
  705. begin
  706. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ, aword(t^._low),hregister, t^.statement);
  707. last:=t^._low;
  708. end;
  709. end
  710. else
  711. begin
  712. { it begins with the smallest label, if the value }
  713. { is even smaller then jump immediately to the }
  714. { ELSE-label }
  715. if first or (t^._low-last>1) then
  716. begin
  717. if opsize in [OS_64,OS_S64] then
  718. begin
  719. objectlibrary.getlabel(l1);
  720. {$ifdef Delphi}
  721. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi((t^._low))),
  722. hregister2, elselabel);
  723. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi((t^._low))),
  724. hregister2, l1);
  725. { the comparisation of the low dword must be always unsigned! }
  726. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_B, aword(lo((t^._low))), hregister, elselabel);
  727. {$else}
  728. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi(int64(t^._low))),
  729. hregister2, elselabel);
  730. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi(int64(t^._low))),
  731. hregister2, l1);
  732. { the comparisation of the low dword must be always unsigned! }
  733. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_B, aword(lo(int64(t^._low))), hregister, elselabel);
  734. {$endif}
  735. cg.a_label(exprasmlist,l1);
  736. end
  737. else
  738. begin
  739. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(t^._low), hregister,
  740. elselabel);
  741. end;
  742. end;
  743. if opsize in [OS_S64,OS_64] then
  744. begin
  745. objectlibrary.getlabel(l1);
  746. {$ifdef Delphi}
  747. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi(t^._high)), hregister2,
  748. t^.statement);
  749. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi(t^._high)), hregister2,
  750. l1);
  751. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_BE, aword(lo(t^._high)), hregister, t^.statement);
  752. {$else}
  753. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi(int64(t^._high))), hregister2,
  754. t^.statement);
  755. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi(int64(t^._high))), hregister2,
  756. l1);
  757. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_BE, aword(lo(int64(t^._high))), hregister, t^.statement);
  758. {$endif}
  759. cg.a_label(exprasmlist,l1);
  760. end
  761. else
  762. begin
  763. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_le, aword(t^._high), hregister, t^.statement);
  764. end;
  765. last:=t^._high;
  766. end;
  767. first:=false;
  768. if assigned(t^.greater) then
  769. genitem(t^.greater);
  770. end;
  771. begin
  772. last:=0;
  773. first:=true;
  774. genitem(hp);
  775. cg.a_jmp_always(exprasmlist,elselabel);
  776. end;
  777. procedure tcgcasenode.gentreejmp(p : pcaserecord);
  778. var
  779. lesslabel,greaterlabel : tasmlabel;
  780. begin
  781. cg.a_label(exprasmlist,p^._at);
  782. { calculate labels for left and right }
  783. if (p^.less=nil) then
  784. lesslabel:=elselabel
  785. else
  786. lesslabel:=p^.less^._at;
  787. if (p^.greater=nil) then
  788. greaterlabel:=elselabel
  789. else
  790. greaterlabel:=p^.greater^._at;
  791. { calculate labels for left and right }
  792. { no range label: }
  793. if p^._low=p^._high then
  794. begin
  795. if greaterlabel=lesslabel then
  796. begin
  797. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_NE,p^._low,hregister, lesslabel);
  798. end
  799. else
  800. begin
  801. cg.a_cmp_const_reg_label(exprasmlist,OS_INT, jmp_lt,p^._low,hregister, lesslabel);
  802. cg.a_cmp_const_reg_label(exprasmlist,OS_INT, jmp_gt,p^._low,hregister, greaterlabel);
  803. end;
  804. cg.a_jmp_always(exprasmlist,p^.statement);
  805. end
  806. else
  807. begin
  808. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,jmp_lt,p^._low, hregister, lesslabel);
  809. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,jmp_gt,p^._high,hregister, greaterlabel);
  810. cg.a_jmp_always(exprasmlist,p^.statement);
  811. end;
  812. if assigned(p^.less) then
  813. gentreejmp(p^.less);
  814. if assigned(p^.greater) then
  815. gentreejmp(p^.greater);
  816. end;
  817. procedure ReLabel(var p:tasmsymbol);
  818. begin
  819. if p.defbind = AB_LOCAL then
  820. begin
  821. if not assigned(p.altsymbol) then
  822. objectlibrary.GenerateAltSymbol(p);
  823. p:=p.altsymbol;
  824. p.increfs;
  825. end;
  826. end;
  827. procedure relabelcaserecord(p : pcaserecord);
  828. begin
  829. Relabel(p^.statement);
  830. Relabel(p^._at);
  831. if assigned(p^.greater) then
  832. relabelcaserecord(p^.greater);
  833. if assigned(p^.less) then
  834. relabelcaserecord(p^.less);
  835. end;
  836. procedure tcgcasenode.pass_2;
  837. var
  838. lv,hv,
  839. max_label: tconstexprint;
  840. labels : longint;
  841. max_linear_list : longint;
  842. otl, ofl: tasmlabel;
  843. isjump : boolean;
  844. max_dist,
  845. dist : cardinal;
  846. hp : tstatementnode;
  847. begin
  848. location_reset(location,LOC_VOID,OS_NO);
  849. { Relabel for inlining? }
  850. if inlining_procedure and assigned(nodes) then
  851. begin
  852. objectlibrary.CreateUsedAsmSymbolList;
  853. relabelcaserecord(nodes);
  854. end;
  855. objectlibrary.getlabel(endlabel);
  856. objectlibrary.getlabel(elselabel);
  857. with_sign:=is_signed(left.resulttype.def);
  858. if with_sign then
  859. begin
  860. jmp_gt:=OC_GT;
  861. jmp_lt:=OC_LT;
  862. jmp_le:=OC_LTE;
  863. end
  864. else
  865. begin
  866. jmp_gt:=OC_A;
  867. jmp_lt:=OC_B;
  868. jmp_le:=OC_BE;
  869. end;
  870. {$ifndef newra}
  871. rg.cleartempgen;
  872. {$endif}
  873. { save current truelabel and falselabel }
  874. isjump:=false;
  875. if left.location.loc=LOC_JUMP then
  876. begin
  877. otl:=truelabel;
  878. objectlibrary.getlabel(truelabel);
  879. ofl:=falselabel;
  880. objectlibrary.getlabel(falselabel);
  881. isjump:=true;
  882. end;
  883. secondpass(left);
  884. { determines the size of the operand }
  885. opsize:=def_cgsize(left.resulttype.def);
  886. { copy the case expression to a register }
  887. location_force_reg(exprasmlist,left.location,opsize,false);
  888. if opsize in [OS_S64,OS_64] then
  889. begin
  890. hregister:=left.location.registerlow;
  891. hregister2:=left.location.registerhigh;
  892. end
  893. else
  894. hregister:=left.location.register;
  895. if isjump then
  896. begin
  897. truelabel:=otl;
  898. falselabel:=ofl;
  899. end;
  900. { we need the min_label always to choose between }
  901. { cmps and subs/decs }
  902. min_label:=case_get_min(nodes);
  903. load_all_regvars(exprasmlist);
  904. { now generate the jumps }
  905. if opsize in [OS_64,OS_S64] then
  906. genlinearcmplist(nodes)
  907. else
  908. begin
  909. if cs_optimize in aktglobalswitches then
  910. begin
  911. { procedures are empirically passed on }
  912. { consumption can also be calculated }
  913. { but does it pay on the different }
  914. { processors? }
  915. { moreover can the size only be appro- }
  916. { ximated as it is not known if rel8, }
  917. { rel16 or rel32 jumps are used }
  918. max_label:=case_get_max(nodes);
  919. labels:=case_count_labels(nodes);
  920. { can we omit the range check of the jump table ? }
  921. getrange(left.resulttype.def,lv,hv);
  922. jumptable_no_range:=(lv=min_label) and (hv=max_label);
  923. { hack a little bit, because the range can be greater }
  924. { than the positive range of a longint }
  925. if (min_label<0) and (max_label>0) then
  926. begin
  927. if min_label=TConstExprInt($80000000) then
  928. dist:=Cardinal(max_label)+Cardinal($80000000)
  929. else
  930. dist:=Cardinal(max_label)+Cardinal(-min_label)
  931. end
  932. else
  933. dist:=max_label-min_label;
  934. { optimize for size ? }
  935. if cs_littlesize in aktglobalswitches then
  936. begin
  937. if (has_jumptable) and
  938. not((labels<=2) or
  939. ((max_label-min_label)<0) or
  940. ((max_label-min_label)>3*labels)) then
  941. begin
  942. { if the labels less or more a continuum then }
  943. genjumptable(nodes,min_label,max_label);
  944. end
  945. else
  946. begin
  947. { a linear list is always smaller than a jump tree }
  948. genlinearlist(nodes);
  949. end;
  950. end
  951. else
  952. begin
  953. max_dist:=4*cardinal(labels);
  954. if jumptable_no_range then
  955. max_linear_list:=4
  956. else
  957. max_linear_list:=2;
  958. { allow processor specific values }
  959. optimizevalues(max_linear_list,max_dist);
  960. if (labels<=max_linear_list) then
  961. genlinearlist(nodes)
  962. else
  963. begin
  964. if (has_jumptable) and
  965. (dist<max_dist) then
  966. genjumptable(nodes,min_label,max_label)
  967. else
  968. begin
  969. if labels>16 then
  970. gentreejmp(nodes)
  971. else
  972. genlinearlist(nodes);
  973. end;
  974. end;
  975. end;
  976. end
  977. else
  978. { it's always not bad }
  979. genlinearlist(nodes);
  980. end;
  981. rg.ungetregisterint(exprasmlist,hregister);
  982. { now generate the instructions }
  983. hp:=tstatementnode(right);
  984. while assigned(hp) do
  985. begin
  986. {$ifndef newra}
  987. rg.cleartempgen;
  988. {$endif}
  989. { relabel when inlining }
  990. if inlining_procedure then
  991. begin
  992. if hp.left.nodetype<>labeln then
  993. internalerror(200211261);
  994. Relabel(tlabelnode(hp.left).labelnr);
  995. end;
  996. secondpass(hp.left);
  997. { don't come back to case line }
  998. aktfilepos:=exprasmList.getlasttaifilepos^;
  999. load_all_regvars(exprasmlist);
  1000. cg.a_jmp_always(exprasmlist,endlabel);
  1001. hp:=tstatementnode(hp.right);
  1002. end;
  1003. cg.a_label(exprasmlist,elselabel);
  1004. { ...and the else block }
  1005. if assigned(elseblock) then
  1006. begin
  1007. {$ifndef newra}
  1008. rg.cleartempgen;
  1009. {$endif}
  1010. secondpass(elseblock);
  1011. load_all_regvars(exprasmlist);
  1012. end;
  1013. cg.a_label(exprasmlist,endlabel);
  1014. { Remove relabels for inlining }
  1015. if inlining_procedure and
  1016. assigned(nodes) then
  1017. begin
  1018. { restore used symbols }
  1019. objectlibrary.UsedAsmSymbolListResetAltSym;
  1020. objectlibrary.DestroyUsedAsmSymbolList;
  1021. end;
  1022. end;
  1023. begin
  1024. csetelementnode:=tcgsetelementnode;
  1025. cinnode:=tcginnode;
  1026. ccasenode:=tcgcasenode;
  1027. end.
  1028. {
  1029. $Log$
  1030. Revision 1.31 2003-04-25 08:25:26 daniel
  1031. * Ifdefs around a lot of calls to cleartempgen
  1032. * Fixed registers that are allocated but not freed in several nodes
  1033. * Tweak to register allocator to cause less spills
  1034. * 8-bit registers now interfere with esi,edi and ebp
  1035. Compiler can now compile rtl successfully when using new register
  1036. allocator
  1037. Revision 1.30 2003/04/22 23:50:23 peter
  1038. * firstpass uses expectloc
  1039. * checks if there are differences between the expectloc and
  1040. location.loc from secondpass in EXTDEBUG
  1041. Revision 1.29 2003/04/22 14:33:38 peter
  1042. * removed some notes/hints
  1043. Revision 1.28 2003/04/22 12:45:58 florian
  1044. * fixed generic in operator code
  1045. + added debug code to check if all scratch registers are released
  1046. Revision 1.27 2003/04/22 10:09:35 daniel
  1047. + Implemented the actual register allocator
  1048. + Scratch registers unavailable when new register allocator used
  1049. + maybe_save/maybe_restore unavailable when new register allocator used
  1050. Revision 1.26 2003/02/19 22:00:14 daniel
  1051. * Code generator converted to new register notation
  1052. - Horribily outdated todo.txt removed
  1053. Revision 1.25 2003/01/08 18:43:56 daniel
  1054. * Tregister changed into a record
  1055. Revision 1.24 2002/11/27 02:37:13 peter
  1056. * case statement inlining added
  1057. * fixed inlining of write()
  1058. * switched statementnode left and right parts so the statements are
  1059. processed in the correct order when getcopy is used. This is
  1060. required for tempnodes
  1061. Revision 1.23 2002/11/25 17:43:18 peter
  1062. * splitted defbase in defutil,symutil,defcmp
  1063. * merged isconvertable and is_equal into compare_defs(_ext)
  1064. * made operator search faster by walking the list only once
  1065. Revision 1.22 2002/10/05 12:43:25 carl
  1066. * fixes for Delphi 6 compilation
  1067. (warning : Some features do not work under Delphi)
  1068. Revision 1.21 2002/10/03 21:31:10 carl
  1069. * range check error fixes
  1070. Revision 1.20 2002/09/17 18:54:03 jonas
  1071. * a_load_reg_reg() now has two size parameters: source and dest. This
  1072. allows some optimizations on architectures that don't encode the
  1073. register size in the register name.
  1074. Revision 1.19 2002/09/16 18:08:26 peter
  1075. * fix last optimization in genlinearlist, detected by bug tw1066
  1076. * use generic casenode.pass2 routine and override genlinearlist
  1077. * add jumptable support to generic casenode, by default there is
  1078. no jumptable support
  1079. Revision 1.18 2002/08/15 15:11:53 carl
  1080. * oldset define is now correct for all cpu's except i386
  1081. * correct compilation problems because of the above
  1082. Revision 1.17 2002/08/13 18:01:52 carl
  1083. * rename swatoperands to swapoperands
  1084. + m68k first compilable version (still needs a lot of testing):
  1085. assembler generator, system information , inline
  1086. assembler reader.
  1087. Revision 1.16 2002/08/11 14:32:27 peter
  1088. * renamed current_library to objectlibrary
  1089. Revision 1.15 2002/08/11 13:24:12 peter
  1090. * saving of asmsymbols in ppu supported
  1091. * asmsymbollist global is removed and moved into a new class
  1092. tasmlibrarydata that will hold the info of a .a file which
  1093. corresponds with a single module. Added librarydata to tmodule
  1094. to keep the library info stored for the module. In the future the
  1095. objectfiles will also be stored to the tasmlibrarydata class
  1096. * all getlabel/newasmsymbol and friends are moved to the new class
  1097. Revision 1.14 2002/08/11 11:37:42 jonas
  1098. * genlinear(cmp)list can now be overridden by descendents
  1099. Revision 1.13 2002/08/11 06:14:40 florian
  1100. * fixed powerpc compilation problems
  1101. Revision 1.12 2002/08/10 17:15:12 jonas
  1102. * optimizations and bugfix
  1103. Revision 1.11 2002/07/28 09:24:18 carl
  1104. + generic case node
  1105. Revision 1.10 2002/07/23 14:31:00 daniel
  1106. * Added internal error when asked to generate code for 'if expr in []'
  1107. Revision 1.9 2002/07/23 12:34:30 daniel
  1108. * Readded old set code. To use it define 'oldset'. Activated by default
  1109. for ppc.
  1110. Revision 1.8 2002/07/22 11:48:04 daniel
  1111. * Sets are now internally sets.
  1112. Revision 1.7 2002/07/21 16:58:20 jonas
  1113. * fixed some bugs in tcginnode.pass_2() and optimized the bit test
  1114. Revision 1.6 2002/07/20 11:57:54 florian
  1115. * types.pas renamed to defbase.pas because D6 contains a types
  1116. unit so this would conflicts if D6 programms are compiled
  1117. + Willamette/SSE2 instructions to assembler added
  1118. Revision 1.5 2002/07/11 14:41:28 florian
  1119. * start of the new generic parameter handling
  1120. Revision 1.4 2002/07/07 10:16:29 florian
  1121. * problems with last commit fixed
  1122. Revision 1.3 2002/07/06 20:19:25 carl
  1123. + generic set handling
  1124. Revision 1.2 2002/07/01 16:23:53 peter
  1125. * cg64 patch
  1126. * basics for currency
  1127. * asnode updates for class and interface (not finished)
  1128. Revision 1.1 2002/06/16 08:14:56 carl
  1129. + generic sets
  1130. }