ncgset.pas 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265
  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. { adjust for endianess differences }
  551. if (source_info.endian <> target_info.endian) then
  552. right.location.reference.offset := right.location.reference.offset xor 3;
  553. cg.a_load_ref_reg(exprasmlist, OS_8, right.location.reference, location.register);
  554. location_release(exprasmlist,right.location);
  555. cg.a_op_const_reg(exprasmlist,OP_SHR, tordconstnode(left).value and 7,
  556. location.register);
  557. cg.a_op_const_reg(exprasmlist, OP_AND,1,location.register);
  558. end
  559. else
  560. begin
  561. if (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  562. pleftreg:=rg.makeregsize(left.location.register,OS_INT)
  563. else
  564. pleftreg:=rg.getregisterint(exprasmlist,OS_INT);
  565. cg.a_load_loc_reg(exprasmlist,left.location,pleftreg);
  566. location_freetemp(exprasmlist,left.location);
  567. location_release(exprasmlist,left.location);
  568. cg.a_param_reg(exprasmlist,OS_8,pleftreg,paramanager.getintparaloc(2));
  569. cg.a_paramaddr_ref(exprasmlist,right.location.reference,paramanager.getintparaloc(1));
  570. cg.a_call_name(exprasmlist,'FPC_SET_IN_BYTE');
  571. { result of value is always one full register }
  572. r.enum:=R_INTREGISTER;
  573. r.number:=NR_ACCUMULATOR;
  574. cg.a_load_reg_reg(exprasmlist,OS_INT,OS_INT,r,location.register);
  575. { release the allocated register }
  576. if not (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  577. rg.ungetregisterint(exprasmlist,pleftreg);
  578. location_release(exprasmlist,right.location);
  579. end;
  580. end;
  581. end;
  582. location_freetemp(exprasmlist,right.location);
  583. end;
  584. {*****************************************************************************
  585. TCGCASENODE
  586. *****************************************************************************}
  587. procedure tcgcasenode.optimizevalues(var max_linear_list:longint;var max_dist:cardinal);
  588. begin
  589. { no changes by default }
  590. end;
  591. function tcgcasenode.has_jumptable : boolean;
  592. begin
  593. { No jumptable support in the default implementation }
  594. has_jumptable:=false;
  595. end;
  596. procedure tcgcasenode.genjumptable(hp : pcaserecord;min_,max_ : longint);
  597. begin
  598. internalerror(200209161);
  599. end;
  600. procedure tcgcasenode.genlinearlist(hp : pcaserecord);
  601. var
  602. first : boolean;
  603. last : TConstExprInt;
  604. scratch_reg: tregister;
  605. procedure genitem(t : pcaserecord);
  606. procedure gensub(value:longint);
  607. begin
  608. { here, since the sub and cmp are separate we need
  609. to move the result before subtract to a help
  610. register.
  611. }
  612. cg.a_load_reg_reg(exprasmlist, opsize, opsize, hregister, scratch_reg);
  613. cg.a_op_const_reg(exprasmlist, OP_SUB, value, hregister);
  614. end;
  615. begin
  616. if assigned(t^.less) then
  617. genitem(t^.less);
  618. { need we to test the first value }
  619. if first and (t^._low>get_min_value(left.resulttype.def)) then
  620. begin
  621. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,jmp_lt,aword(t^._low),hregister,elselabel);
  622. end;
  623. if t^._low=t^._high then
  624. begin
  625. if t^._low-last=0 then
  626. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ,0,hregister,t^.statement)
  627. else
  628. begin
  629. gensub(longint(t^._low-last));
  630. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ,aword(t^._low-last),scratch_reg,t^.statement);
  631. end;
  632. last:=t^._low;
  633. end
  634. else
  635. begin
  636. { it begins with the smallest label, if the value }
  637. { is even smaller then jump immediately to the }
  638. { ELSE-label }
  639. if first then
  640. begin
  641. { have we to ajust the first value ? }
  642. if (t^._low>get_min_value(left.resulttype.def)) then
  643. gensub(longint(t^._low));
  644. end
  645. else
  646. begin
  647. { if there is no unused label between the last and the }
  648. { present label then the lower limit can be checked }
  649. { immediately. else check the range in between: }
  650. gensub(longint(t^._low-last));
  651. cg.a_cmp_const_reg_label(exprasmlist, OS_INT,jmp_lt,aword(t^._low-last),scratch_reg,elselabel);
  652. end;
  653. gensub(longint(t^._high-t^._low));
  654. cg.a_cmp_const_reg_label(exprasmlist, OS_INT,jmp_le,aword(t^._high-t^._low),scratch_reg,t^.statement);
  655. last:=t^._high;
  656. end;
  657. first:=false;
  658. if assigned(t^.greater) then
  659. genitem(t^.greater);
  660. end;
  661. begin
  662. { do we need to generate cmps? }
  663. if (with_sign and (min_label<0)) then
  664. genlinearcmplist(hp)
  665. else
  666. begin
  667. last:=0;
  668. first:=true;
  669. {$ifdef newra}
  670. scratch_reg:=rg.getregisterint(exprasmlist,OS_INT);
  671. {$else newra}
  672. scratch_reg := cg.get_scratch_reg_int(exprasmlist,OS_INT);
  673. {$endif}
  674. genitem(hp);
  675. {$ifdef newra}
  676. rg.ungetregisterint(exprasmlist,scratch_reg);
  677. {$else}
  678. cg.free_scratch_reg(exprasmlist,scratch_reg);
  679. {$endif}
  680. cg.a_jmp_always(exprasmlist,elselabel);
  681. end;
  682. end;
  683. procedure tcgcasenode.genlinearcmplist(hp : pcaserecord);
  684. var
  685. first : boolean;
  686. last : TConstExprInt;
  687. procedure genitem(t : pcaserecord);
  688. var
  689. l1 : tasmlabel;
  690. begin
  691. if assigned(t^.less) then
  692. genitem(t^.less);
  693. if t^._low=t^._high then
  694. begin
  695. if opsize in [OS_S64,OS_64] then
  696. begin
  697. objectlibrary.getlabel(l1);
  698. {$ifdef Delphi}
  699. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_NE, hi((t^._low)),hregister2,l1);
  700. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ, lo((t^._low)),hregister, t^.statement);
  701. {$else}
  702. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_NE, aword(hi(int64(t^._low))),hregister2,l1);
  703. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ, aword(lo(int64(t^._low))),hregister, t^.statement);
  704. {$endif}
  705. cg.a_label(exprasmlist,l1);
  706. end
  707. else
  708. begin
  709. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_EQ, aword(t^._low),hregister, t^.statement);
  710. last:=t^._low;
  711. end;
  712. end
  713. else
  714. begin
  715. { it begins with the smallest label, if the value }
  716. { is even smaller then jump immediately to the }
  717. { ELSE-label }
  718. if first or (t^._low-last>1) then
  719. begin
  720. if opsize in [OS_64,OS_S64] then
  721. begin
  722. objectlibrary.getlabel(l1);
  723. {$ifdef Delphi}
  724. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi((t^._low))),
  725. hregister2, elselabel);
  726. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi((t^._low))),
  727. hregister2, l1);
  728. { the comparisation of the low dword must be always unsigned! }
  729. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_B, aword(lo((t^._low))), hregister, elselabel);
  730. {$else}
  731. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi(int64(t^._low))),
  732. hregister2, elselabel);
  733. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi(int64(t^._low))),
  734. hregister2, l1);
  735. { the comparisation of the low dword must be always unsigned! }
  736. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_B, aword(lo(int64(t^._low))), hregister, elselabel);
  737. {$endif}
  738. cg.a_label(exprasmlist,l1);
  739. end
  740. else
  741. begin
  742. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(t^._low), hregister,
  743. elselabel);
  744. end;
  745. end;
  746. if opsize in [OS_S64,OS_64] then
  747. begin
  748. objectlibrary.getlabel(l1);
  749. {$ifdef Delphi}
  750. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi(t^._high)), hregister2,
  751. t^.statement);
  752. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi(t^._high)), hregister2,
  753. l1);
  754. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_BE, aword(lo(t^._high)), hregister, t^.statement);
  755. {$else}
  756. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_lt, aword(hi(int64(t^._high))), hregister2,
  757. t^.statement);
  758. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_gt, aword(hi(int64(t^._high))), hregister2,
  759. l1);
  760. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_BE, aword(lo(int64(t^._high))), hregister, t^.statement);
  761. {$endif}
  762. cg.a_label(exprasmlist,l1);
  763. end
  764. else
  765. begin
  766. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, jmp_le, aword(t^._high), hregister, t^.statement);
  767. end;
  768. last:=t^._high;
  769. end;
  770. first:=false;
  771. if assigned(t^.greater) then
  772. genitem(t^.greater);
  773. end;
  774. begin
  775. last:=0;
  776. first:=true;
  777. genitem(hp);
  778. cg.a_jmp_always(exprasmlist,elselabel);
  779. end;
  780. procedure tcgcasenode.gentreejmp(p : pcaserecord);
  781. var
  782. lesslabel,greaterlabel : tasmlabel;
  783. begin
  784. cg.a_label(exprasmlist,p^._at);
  785. { calculate labels for left and right }
  786. if (p^.less=nil) then
  787. lesslabel:=elselabel
  788. else
  789. lesslabel:=p^.less^._at;
  790. if (p^.greater=nil) then
  791. greaterlabel:=elselabel
  792. else
  793. greaterlabel:=p^.greater^._at;
  794. { calculate labels for left and right }
  795. { no range label: }
  796. if p^._low=p^._high then
  797. begin
  798. if greaterlabel=lesslabel then
  799. begin
  800. cg.a_cmp_const_reg_label(exprasmlist, OS_INT, OC_NE,p^._low,hregister, lesslabel);
  801. end
  802. else
  803. begin
  804. cg.a_cmp_const_reg_label(exprasmlist,OS_INT, jmp_lt,p^._low,hregister, lesslabel);
  805. cg.a_cmp_const_reg_label(exprasmlist,OS_INT, jmp_gt,p^._low,hregister, greaterlabel);
  806. end;
  807. cg.a_jmp_always(exprasmlist,p^.statement);
  808. end
  809. else
  810. begin
  811. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,jmp_lt,p^._low, hregister, lesslabel);
  812. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,jmp_gt,p^._high,hregister, greaterlabel);
  813. cg.a_jmp_always(exprasmlist,p^.statement);
  814. end;
  815. if assigned(p^.less) then
  816. gentreejmp(p^.less);
  817. if assigned(p^.greater) then
  818. gentreejmp(p^.greater);
  819. end;
  820. procedure ReLabel(var p:tasmsymbol);
  821. begin
  822. if p.defbind = AB_LOCAL then
  823. begin
  824. if not assigned(p.altsymbol) then
  825. objectlibrary.GenerateAltSymbol(p);
  826. p:=p.altsymbol;
  827. p.increfs;
  828. end;
  829. end;
  830. procedure relabelcaserecord(p : pcaserecord);
  831. begin
  832. Relabel(p^.statement);
  833. Relabel(p^._at);
  834. if assigned(p^.greater) then
  835. relabelcaserecord(p^.greater);
  836. if assigned(p^.less) then
  837. relabelcaserecord(p^.less);
  838. end;
  839. procedure tcgcasenode.pass_2;
  840. var
  841. lv,hv,
  842. max_label: tconstexprint;
  843. labels : longint;
  844. max_linear_list : longint;
  845. otl, ofl: tasmlabel;
  846. isjump : boolean;
  847. max_dist,
  848. dist : cardinal;
  849. hp : tstatementnode;
  850. begin
  851. location_reset(location,LOC_VOID,OS_NO);
  852. { Relabel for inlining? }
  853. if inlining_procedure and assigned(nodes) then
  854. begin
  855. objectlibrary.CreateUsedAsmSymbolList;
  856. relabelcaserecord(nodes);
  857. end;
  858. objectlibrary.getlabel(endlabel);
  859. objectlibrary.getlabel(elselabel);
  860. with_sign:=is_signed(left.resulttype.def);
  861. if with_sign then
  862. begin
  863. jmp_gt:=OC_GT;
  864. jmp_lt:=OC_LT;
  865. jmp_le:=OC_LTE;
  866. end
  867. else
  868. begin
  869. jmp_gt:=OC_A;
  870. jmp_lt:=OC_B;
  871. jmp_le:=OC_BE;
  872. end;
  873. {$ifndef newra}
  874. rg.cleartempgen;
  875. {$endif}
  876. { save current truelabel and falselabel }
  877. isjump:=false;
  878. if left.location.loc=LOC_JUMP then
  879. begin
  880. otl:=truelabel;
  881. objectlibrary.getlabel(truelabel);
  882. ofl:=falselabel;
  883. objectlibrary.getlabel(falselabel);
  884. isjump:=true;
  885. end;
  886. secondpass(left);
  887. { determines the size of the operand }
  888. opsize:=def_cgsize(left.resulttype.def);
  889. { copy the case expression to a register }
  890. location_force_reg(exprasmlist,left.location,opsize,false);
  891. if opsize in [OS_S64,OS_64] then
  892. begin
  893. hregister:=left.location.registerlow;
  894. hregister2:=left.location.registerhigh;
  895. end
  896. else
  897. hregister:=left.location.register;
  898. if isjump then
  899. begin
  900. truelabel:=otl;
  901. falselabel:=ofl;
  902. end;
  903. { we need the min_label always to choose between }
  904. { cmps and subs/decs }
  905. min_label:=case_get_min(nodes);
  906. load_all_regvars(exprasmlist);
  907. { now generate the jumps }
  908. if opsize in [OS_64,OS_S64] then
  909. genlinearcmplist(nodes)
  910. else
  911. begin
  912. if cs_optimize in aktglobalswitches then
  913. begin
  914. { procedures are empirically passed on }
  915. { consumption can also be calculated }
  916. { but does it pay on the different }
  917. { processors? }
  918. { moreover can the size only be appro- }
  919. { ximated as it is not known if rel8, }
  920. { rel16 or rel32 jumps are used }
  921. max_label:=case_get_max(nodes);
  922. labels:=case_count_labels(nodes);
  923. { can we omit the range check of the jump table ? }
  924. getrange(left.resulttype.def,lv,hv);
  925. jumptable_no_range:=(lv=min_label) and (hv=max_label);
  926. { hack a little bit, because the range can be greater }
  927. { than the positive range of a longint }
  928. if (min_label<0) and (max_label>0) then
  929. begin
  930. if min_label=TConstExprInt($80000000) then
  931. dist:=Cardinal(max_label)+Cardinal($80000000)
  932. else
  933. dist:=Cardinal(max_label)+Cardinal(-min_label)
  934. end
  935. else
  936. dist:=max_label-min_label;
  937. { optimize for size ? }
  938. if cs_littlesize in aktglobalswitches then
  939. begin
  940. if (has_jumptable) and
  941. not((labels<=2) or
  942. ((max_label-min_label)<0) or
  943. ((max_label-min_label)>3*labels)) then
  944. begin
  945. { if the labels less or more a continuum then }
  946. genjumptable(nodes,min_label,max_label);
  947. end
  948. else
  949. begin
  950. { a linear list is always smaller than a jump tree }
  951. genlinearlist(nodes);
  952. end;
  953. end
  954. else
  955. begin
  956. max_dist:=4*cardinal(labels);
  957. if jumptable_no_range then
  958. max_linear_list:=4
  959. else
  960. max_linear_list:=2;
  961. { allow processor specific values }
  962. optimizevalues(max_linear_list,max_dist);
  963. if (labels<=max_linear_list) then
  964. genlinearlist(nodes)
  965. else
  966. begin
  967. if (has_jumptable) and
  968. (dist<max_dist) then
  969. genjumptable(nodes,min_label,max_label)
  970. else
  971. begin
  972. if labels>16 then
  973. gentreejmp(nodes)
  974. else
  975. genlinearlist(nodes);
  976. end;
  977. end;
  978. end;
  979. end
  980. else
  981. { it's always not bad }
  982. genlinearlist(nodes);
  983. end;
  984. rg.ungetregisterint(exprasmlist,hregister);
  985. { now generate the instructions }
  986. hp:=tstatementnode(right);
  987. while assigned(hp) do
  988. begin
  989. {$ifndef newra}
  990. rg.cleartempgen;
  991. {$endif}
  992. { relabel when inlining }
  993. if inlining_procedure then
  994. begin
  995. if hp.left.nodetype<>labeln then
  996. internalerror(200211261);
  997. Relabel(tlabelnode(hp.left).labelnr);
  998. end;
  999. secondpass(hp.left);
  1000. { don't come back to case line }
  1001. aktfilepos:=exprasmList.getlasttaifilepos^;
  1002. load_all_regvars(exprasmlist);
  1003. cg.a_jmp_always(exprasmlist,endlabel);
  1004. hp:=tstatementnode(hp.right);
  1005. end;
  1006. cg.a_label(exprasmlist,elselabel);
  1007. { ...and the else block }
  1008. if assigned(elseblock) then
  1009. begin
  1010. {$ifndef newra}
  1011. rg.cleartempgen;
  1012. {$endif}
  1013. secondpass(elseblock);
  1014. load_all_regvars(exprasmlist);
  1015. end;
  1016. cg.a_label(exprasmlist,endlabel);
  1017. { Remove relabels for inlining }
  1018. if inlining_procedure and
  1019. assigned(nodes) then
  1020. begin
  1021. { restore used symbols }
  1022. objectlibrary.UsedAsmSymbolListResetAltSym;
  1023. objectlibrary.DestroyUsedAsmSymbolList;
  1024. end;
  1025. end;
  1026. begin
  1027. csetelementnode:=tcgsetelementnode;
  1028. cinnode:=tcginnode;
  1029. ccasenode:=tcgcasenode;
  1030. end.
  1031. {
  1032. $Log$
  1033. Revision 1.32 2003-05-01 12:26:50 jonas
  1034. * fixed endian issue in inlined in-test for smallsets
  1035. * pass the address of normalsets to fpc_set_in_set_byte instead of the
  1036. contents of the first 4 bytes
  1037. Revision 1.31 2003/04/25 08:25:26 daniel
  1038. * Ifdefs around a lot of calls to cleartempgen
  1039. * Fixed registers that are allocated but not freed in several nodes
  1040. * Tweak to register allocator to cause less spills
  1041. * 8-bit registers now interfere with esi,edi and ebp
  1042. Compiler can now compile rtl successfully when using new register
  1043. allocator
  1044. Revision 1.30 2003/04/22 23:50:23 peter
  1045. * firstpass uses expectloc
  1046. * checks if there are differences between the expectloc and
  1047. location.loc from secondpass in EXTDEBUG
  1048. Revision 1.29 2003/04/22 14:33:38 peter
  1049. * removed some notes/hints
  1050. Revision 1.28 2003/04/22 12:45:58 florian
  1051. * fixed generic in operator code
  1052. + added debug code to check if all scratch registers are released
  1053. Revision 1.27 2003/04/22 10:09:35 daniel
  1054. + Implemented the actual register allocator
  1055. + Scratch registers unavailable when new register allocator used
  1056. + maybe_save/maybe_restore unavailable when new register allocator used
  1057. Revision 1.26 2003/02/19 22:00:14 daniel
  1058. * Code generator converted to new register notation
  1059. - Horribily outdated todo.txt removed
  1060. Revision 1.25 2003/01/08 18:43:56 daniel
  1061. * Tregister changed into a record
  1062. Revision 1.24 2002/11/27 02:37:13 peter
  1063. * case statement inlining added
  1064. * fixed inlining of write()
  1065. * switched statementnode left and right parts so the statements are
  1066. processed in the correct order when getcopy is used. This is
  1067. required for tempnodes
  1068. Revision 1.23 2002/11/25 17:43:18 peter
  1069. * splitted defbase in defutil,symutil,defcmp
  1070. * merged isconvertable and is_equal into compare_defs(_ext)
  1071. * made operator search faster by walking the list only once
  1072. Revision 1.22 2002/10/05 12:43:25 carl
  1073. * fixes for Delphi 6 compilation
  1074. (warning : Some features do not work under Delphi)
  1075. Revision 1.21 2002/10/03 21:31:10 carl
  1076. * range check error fixes
  1077. Revision 1.20 2002/09/17 18:54:03 jonas
  1078. * a_load_reg_reg() now has two size parameters: source and dest. This
  1079. allows some optimizations on architectures that don't encode the
  1080. register size in the register name.
  1081. Revision 1.19 2002/09/16 18:08:26 peter
  1082. * fix last optimization in genlinearlist, detected by bug tw1066
  1083. * use generic casenode.pass2 routine and override genlinearlist
  1084. * add jumptable support to generic casenode, by default there is
  1085. no jumptable support
  1086. Revision 1.18 2002/08/15 15:11:53 carl
  1087. * oldset define is now correct for all cpu's except i386
  1088. * correct compilation problems because of the above
  1089. Revision 1.17 2002/08/13 18:01:52 carl
  1090. * rename swatoperands to swapoperands
  1091. + m68k first compilable version (still needs a lot of testing):
  1092. assembler generator, system information , inline
  1093. assembler reader.
  1094. Revision 1.16 2002/08/11 14:32:27 peter
  1095. * renamed current_library to objectlibrary
  1096. Revision 1.15 2002/08/11 13:24:12 peter
  1097. * saving of asmsymbols in ppu supported
  1098. * asmsymbollist global is removed and moved into a new class
  1099. tasmlibrarydata that will hold the info of a .a file which
  1100. corresponds with a single module. Added librarydata to tmodule
  1101. to keep the library info stored for the module. In the future the
  1102. objectfiles will also be stored to the tasmlibrarydata class
  1103. * all getlabel/newasmsymbol and friends are moved to the new class
  1104. Revision 1.14 2002/08/11 11:37:42 jonas
  1105. * genlinear(cmp)list can now be overridden by descendents
  1106. Revision 1.13 2002/08/11 06:14:40 florian
  1107. * fixed powerpc compilation problems
  1108. Revision 1.12 2002/08/10 17:15:12 jonas
  1109. * optimizations and bugfix
  1110. Revision 1.11 2002/07/28 09:24:18 carl
  1111. + generic case node
  1112. Revision 1.10 2002/07/23 14:31:00 daniel
  1113. * Added internal error when asked to generate code for 'if expr in []'
  1114. Revision 1.9 2002/07/23 12:34:30 daniel
  1115. * Readded old set code. To use it define 'oldset'. Activated by default
  1116. for ppc.
  1117. Revision 1.8 2002/07/22 11:48:04 daniel
  1118. * Sets are now internally sets.
  1119. Revision 1.7 2002/07/21 16:58:20 jonas
  1120. * fixed some bugs in tcginnode.pass_2() and optimized the bit test
  1121. Revision 1.6 2002/07/20 11:57:54 florian
  1122. * types.pas renamed to defbase.pas because D6 contains a types
  1123. unit so this would conflicts if D6 programms are compiled
  1124. + Willamette/SSE2 instructions to assembler added
  1125. Revision 1.5 2002/07/11 14:41:28 florian
  1126. * start of the new generic parameter handling
  1127. Revision 1.4 2002/07/07 10:16:29 florian
  1128. * problems with last commit fixed
  1129. Revision 1.3 2002/07/06 20:19:25 carl
  1130. + generic set handling
  1131. Revision 1.2 2002/07/01 16:23:53 peter
  1132. * cg64 patch
  1133. * basics for currency
  1134. * asnode updates for class and interface (not finished)
  1135. Revision 1.1 2002/06/16 08:14:56 carl
  1136. + generic sets
  1137. }