ncgset.pas 48 KB

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