aasmcpu.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. {
  2. Copyright (c) 1999-2009 by Mazen Neifer and David Zhang
  3. Contains the assembler object for the MIPSEL
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit aasmcpu;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. cclasses,
  22. globtype, globals, verbose,
  23. aasmbase, aasmdata, aasmsym, aasmtai,
  24. cgbase, cgutils, cpubase, cpuinfo;
  25. const
  26. { "mov reg,reg" source operand number }
  27. O_MOV_SOURCE = 1;
  28. { "mov reg,reg" source operand number }
  29. O_MOV_DEST = 0;
  30. type
  31. { taicpu }
  32. taicpu = class(tai_cpu_abstract_sym)
  33. delayslot_annulled: boolean; { conditinal opcode with ,a }
  34. constructor op_none(op: tasmop);
  35. constructor op_reg(op: tasmop; _op1: tregister);
  36. constructor op_const(op: tasmop; _op1: longint);
  37. constructor op_ref(op: tasmop; const _op1: treference);
  38. constructor op_reg_reg(op: tasmop; _op1, _op2: tregister);
  39. constructor op_reg_ref(op: tasmop; _op1: tregister; const _op2: treference);
  40. constructor op_reg_const(op: tasmop; _op1: tregister; _op2: longint);
  41. constructor op_const_const(op: tasmop; _op1: aint; _op2: aint);
  42. constructor op_reg_reg_reg(op: tasmop; _op1, _op2, _op3: tregister);
  43. constructor op_reg_reg_ref(op: tasmop; _op1, _op2: tregister; const _op3: treference);
  44. constructor op_reg_reg_const(op: tasmop; _op1, _op2: tregister; _op3: aint);
  45. { INS and EXT }
  46. constructor op_reg_reg_const_const(op: tasmop; _op1,_op2: tregister; _op3,_op4: aint);
  47. constructor op_reg_const_reg(op: tasmop; _op1: tregister; _op2: aint; _op3: tregister);
  48. { this is for Jmp instructions }
  49. constructor op_sym(op: tasmop; _op1: tasmsymbol);
  50. constructor op_reg_reg_sym(op: tasmop; _op1, _op2: tregister; _op3: tasmsymbol);
  51. constructor op_reg_sym(op: tasmop; _op1: tregister; _op2: tasmsymbol);
  52. constructor op_sym_ofs(op: tasmop; _op1: tasmsymbol; _op1ofs: longint);
  53. { register allocation }
  54. function is_same_reg_move(regtype: Tregistertype): boolean; override;
  55. { register spilling code }
  56. function spilling_get_operation_type(opnr: longint): topertype; override;
  57. end;
  58. tai_align = class(tai_align_abstract)
  59. { nothing to add }
  60. end;
  61. procedure InitAsm;
  62. procedure DoneAsm;
  63. procedure fixup_jmps(list: TAsmList);
  64. function spilling_create_load(const ref: treference; r: tregister): taicpu;
  65. function spilling_create_store(r: tregister; const ref: treference): taicpu;
  66. implementation
  67. uses
  68. cutils;
  69. {*****************************************************************************
  70. taicpu Constructors
  71. *****************************************************************************}
  72. constructor taicpu.op_none(op: tasmop);
  73. begin
  74. inherited Create(op);
  75. end;
  76. constructor taicpu.op_reg(op: tasmop; _op1: tregister);
  77. begin
  78. inherited Create(op);
  79. ops := 1;
  80. loadreg(0, _op1);
  81. end;
  82. constructor taicpu.op_ref(op: tasmop; const _op1: treference);
  83. begin
  84. inherited Create(op);
  85. ops := 1;
  86. loadref(0, _op1);
  87. end;
  88. constructor taicpu.op_const(op: tasmop; _op1: longint);
  89. begin
  90. inherited Create(op);
  91. ops := 1;
  92. loadconst(0, _op1);
  93. end;
  94. constructor taicpu.op_reg_reg(op: tasmop; _op1, _op2: tregister);
  95. begin
  96. inherited Create(op);
  97. ops := 2;
  98. loadreg(0, _op1);
  99. loadreg(1, _op2);
  100. end;
  101. constructor taicpu.op_reg_const(op: tasmop; _op1: tregister; _op2: longint);
  102. begin
  103. inherited Create(op);
  104. ops := 2;
  105. loadreg(0, _op1);
  106. loadconst(1, _op2);
  107. end;
  108. constructor taicpu.op_const_const(op: tasmop; _op1: aint; _op2: aint);
  109. begin
  110. inherited Create(op);
  111. ops := 2;
  112. loadconst(0, _op1);
  113. loadconst(1, _op2);
  114. end;
  115. constructor taicpu.op_reg_ref(op: tasmop; _op1: tregister; const _op2: treference);
  116. begin
  117. inherited Create(op);
  118. ops := 2;
  119. loadreg(0, _op1);
  120. loadref(1, _op2);
  121. end;
  122. constructor taicpu.op_reg_reg_reg(op: tasmop; _op1, _op2, _op3: tregister);
  123. begin
  124. inherited Create(op);
  125. ops := 3;
  126. loadreg(0, _op1);
  127. loadreg(1, _op2);
  128. loadreg(2, _op3);
  129. end;
  130. constructor taicpu.op_reg_reg_ref(op: tasmop; _op1, _op2: tregister; const _op3: treference);
  131. begin
  132. inherited create(op);
  133. ops := 3;
  134. loadreg(0, _op1);
  135. loadreg(1, _op2);
  136. loadref(2, _op3);
  137. end;
  138. constructor taicpu.op_reg_reg_const(op: tasmop; _op1, _op2: tregister; _op3: aint);
  139. begin
  140. inherited create(op);
  141. ops := 3;
  142. loadreg(0, _op1);
  143. loadreg(1, _op2);
  144. loadconst(2, _op3);
  145. end;
  146. constructor taicpu.op_reg_reg_const_const(op: tasmop; _op1, _op2: tregister; _op3, _op4: aint);
  147. begin
  148. inherited create(op);
  149. ops := 4;
  150. loadreg(0, _op1);
  151. loadreg(1, _op2);
  152. loadconst(2, _op3);
  153. loadconst(3, _op4);
  154. end;
  155. constructor taicpu.op_reg_const_reg(op: tasmop; _op1: tregister; _op2: aint;
  156. _op3: tregister);
  157. begin
  158. inherited create(op);
  159. ops := 3;
  160. loadreg(0, _op1);
  161. loadconst(1, _op2);
  162. loadreg(2, _op3);
  163. end;
  164. constructor taicpu.op_sym(op: tasmop; _op1: tasmsymbol);
  165. begin
  166. inherited Create(op);
  167. is_jmp := op in [A_BC, A_BA];
  168. ops := 1;
  169. loadsymbol(0, _op1, 0);
  170. end;
  171. constructor taicpu.op_reg_reg_sym(op: tasmop; _op1, _op2: tregister; _op3: tasmsymbol);
  172. begin
  173. inherited create(op);
  174. is_jmp := op in [A_BC, A_BA];
  175. ops := 3;
  176. loadreg(0, _op1);
  177. loadreg(1, _op2);
  178. loadsymbol(2, _op3, 0);
  179. end;
  180. constructor taicpu.op_reg_sym(op: tasmop; _op1: tregister; _op2: tasmsymbol);
  181. begin
  182. inherited create(op);
  183. is_jmp := op in [A_BC, A_BA];
  184. ops := 2;
  185. loadreg(0, _op1);
  186. loadsymbol(1, _op2, 0);
  187. end;
  188. constructor taicpu.op_sym_ofs(op: tasmop; _op1: tasmsymbol; _op1ofs: longint);
  189. begin
  190. inherited Create(op);
  191. ops := 1;
  192. loadsymbol(0, _op1, _op1ofs);
  193. end;
  194. function taicpu.is_same_reg_move(regtype: Tregistertype): boolean;
  195. begin
  196. Result := (
  197. ((opcode = A_MOVE) and (regtype = R_INTREGISTER)) or
  198. ((regtype = R_FPUREGISTER) and (opcode in [A_MOV_S, A_MOV_D]))
  199. ) and
  200. (oper[0]^.reg = oper[1]^.reg);
  201. end;
  202. function taicpu.spilling_get_operation_type(opnr: longint): topertype;
  203. type
  204. op_write_set_type = set of TAsmOp;
  205. const
  206. op_write_set: op_write_set_type =
  207. [A_NEG,
  208. A_NEGU,
  209. A_LI,
  210. A_DLI,
  211. A_LA,
  212. A_MOVE,
  213. A_LB,
  214. A_LBU,
  215. A_LH,
  216. A_LHU,
  217. A_LW,
  218. A_LWU,
  219. A_LWL,
  220. A_LWR,
  221. A_LD,
  222. A_LDL,
  223. A_LDR,
  224. A_LL,
  225. A_LLD,
  226. A_ADDI,
  227. A_DADDI,
  228. A_ADDIU,
  229. A_DADDIU,
  230. A_SLTI,
  231. A_SLTIU,
  232. A_ANDI,
  233. A_ORI,
  234. A_XORI,
  235. A_LUI,
  236. A_DNEG,
  237. A_DNEGU,
  238. A_ADD,
  239. A_DADD,
  240. A_ADDU,
  241. A_DADDU,
  242. A_SUB,
  243. A_DSUB,
  244. A_SUBU,
  245. A_DSUBU,
  246. A_SLT,
  247. A_SLTU,
  248. A_AND,
  249. A_OR,
  250. A_XOR,
  251. A_NOR,
  252. { We can get into trouble if an instruction can be interpreted as
  253. macros with different operands. The following commented out ones
  254. refer to elementary instructions: DIV[U], MULT[U] do not modify
  255. first operand. Rest are subject to check. }
  256. A_MUL,
  257. A_MULO,
  258. A_MULOU,
  259. A_DMUL,
  260. A_DMULO,
  261. A_DMULOU,
  262. // A_DIV,
  263. // A_DIVU,
  264. A_DDIV,
  265. A_DDIVU,
  266. A_REM,
  267. A_REMU,
  268. A_DREM,
  269. A_DREMU,
  270. // A_MULT,
  271. A_DMULT,
  272. // A_MULTU,
  273. A_DMULTU,
  274. A_MFHI,
  275. A_MFLO,
  276. A_SLL,
  277. A_SRL,
  278. A_SRA,
  279. A_SLLV,
  280. A_SRLV,
  281. A_SRAV,
  282. A_DSLL,
  283. A_DSRL,
  284. A_DSRA,
  285. A_DSLLV,
  286. A_DSRLV,
  287. A_DSRAV,
  288. A_DSLL32,
  289. A_DSRL32,
  290. A_DSRA32,
  291. A_LWC1,
  292. A_LDC1,
  293. A_ADD_S,
  294. A_ADD_D,
  295. A_SUB_S,
  296. A_SUB_D,
  297. A_MUL_S,
  298. A_MUL_D,
  299. A_DIV_S,
  300. A_DIV_D,
  301. A_ABS_S,
  302. A_ABS_D,
  303. A_NEG_S,
  304. A_NEG_D,
  305. A_SQRT_S,
  306. A_SQRT_D,
  307. A_MOV_S,
  308. A_MOV_D,
  309. A_CVT_S_D,
  310. A_CVT_S_W,
  311. A_CVT_S_L,
  312. A_CVT_D_S,
  313. A_CVT_D_W,
  314. A_CVT_D_L,
  315. A_CVT_W_S,
  316. A_CVT_W_D,
  317. A_CVT_L_S,
  318. A_CVT_L_D,
  319. A_ROUND_W_S,
  320. A_ROUND_W_D,
  321. A_ROUND_L_S,
  322. A_ROUND_L_D,
  323. A_TRUNC_W_S,
  324. A_TRUNC_W_D,
  325. A_TRUNC_L_S,
  326. A_TRUNC_L_D,
  327. A_CEIL_W_S,
  328. A_CEIL_W_D,
  329. A_CEIL_L_S,
  330. A_CEIL_L_D,
  331. A_FLOOR_W_S,
  332. A_FLOOR_W_D,
  333. A_FLOOR_L_S,
  334. A_FLOOR_L_D,
  335. A_SEQ,
  336. A_SGE,
  337. A_SGEU,
  338. A_SGT,
  339. A_SGTU,
  340. A_SLE,
  341. A_SLEU,
  342. A_SNE,
  343. A_EXT,
  344. A_INS,
  345. A_MFC0,
  346. A_SEB,
  347. A_SEH];
  348. begin
  349. result := operand_read;
  350. case opcode of
  351. A_DIV, { these have 3 operands if used as macros }
  352. A_DIVU:
  353. if (ops=3) and (opnr=0) then
  354. result:=operand_write;
  355. else
  356. if opcode in op_write_set then
  357. if opnr = 0 then
  358. result := operand_write;
  359. end;
  360. end;
  361. function spilling_create_load(const ref: treference; r: tregister): taicpu;
  362. begin
  363. case getregtype(r) of
  364. R_INTREGISTER :
  365. result:=taicpu.op_reg_ref(A_LW,r,ref);
  366. R_FPUREGISTER :
  367. begin
  368. case getsubreg(r) of
  369. R_SUBFS :
  370. result:=taicpu.op_reg_ref(A_LWC1,r,ref);
  371. R_SUBFD :
  372. result:=taicpu.op_reg_ref(A_LDC1,r,ref);
  373. else
  374. internalerror(200401042);
  375. end;
  376. end
  377. else
  378. internalerror(200401041);
  379. end;
  380. end;
  381. function spilling_create_store(r: tregister; const ref: treference): taicpu;
  382. begin
  383. case getregtype(r) of
  384. R_INTREGISTER :
  385. result:=taicpu.op_reg_ref(A_SW,r,ref);
  386. R_FPUREGISTER :
  387. begin
  388. case getsubreg(r) of
  389. R_SUBFS :
  390. result:=taicpu.op_reg_ref(A_SWC1,r,ref);
  391. R_SUBFD :
  392. result:=taicpu.op_reg_ref(A_SDC1,r,ref);
  393. else
  394. internalerror(200401042);
  395. end;
  396. end
  397. else
  398. internalerror(200401041);
  399. end;
  400. end;
  401. procedure InitAsm;
  402. begin
  403. end;
  404. procedure DoneAsm;
  405. begin
  406. end;
  407. procedure fixup_jmps(list: TAsmList);
  408. var
  409. p,pdelayslot: tai;
  410. newcomment: tai_comment;
  411. newins,newjmp,newnoop: taicpu;
  412. labelpositions: TFPList;
  413. instrpos: ptrint;
  414. l: tasmlabel;
  415. inserted_something: boolean;
  416. href: treference;
  417. begin
  418. // if certainly not enough instructions to cause an overflow, dont bother
  419. if (list.count <= (high(smallint) div 4)) then
  420. exit;
  421. labelpositions := TFPList.create;
  422. p := tai(list.first);
  423. instrpos := 1;
  424. // record label positions
  425. while assigned(p) do
  426. begin
  427. if p.typ = ait_label then
  428. begin
  429. if (tai_label(p).labsym.labelnr >= labelpositions.count) then
  430. labelpositions.count := tai_label(p).labsym.labelnr * 2;
  431. labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos);
  432. end;
  433. { ait_const is for jump tables }
  434. case p.typ of
  435. ait_instruction:
  436. { probleim here: pseudo-instructions can translate into
  437. several CPU instructions, possibly depending on assembler options,
  438. to obe on safe side, let's assume a mean of two. }
  439. inc(instrpos,2);
  440. ait_const:
  441. begin
  442. if (tai_const(p).consttype<>aitconst_32bit) then
  443. internalerror(2008052101);
  444. inc(instrpos);
  445. end;
  446. end;
  447. p := tai(p.next);
  448. end;
  449. { If the number of instructions is below limit, we can't overflow either }
  450. if (instrpos <= (high(smallint) div 4)) then
  451. exit;
  452. // check and fix distances
  453. repeat
  454. inserted_something := false;
  455. p := tai(list.first);
  456. instrpos := 1;
  457. while assigned(p) do
  458. begin
  459. case p.typ of
  460. ait_label:
  461. // update labelposition in case it changed due to insertion
  462. // of jumps
  463. begin
  464. // can happen because of newly inserted labels
  465. if (tai_label(p).labsym.labelnr > labelpositions.count) then
  466. labelpositions.count := tai_label(p).labsym.labelnr * 2;
  467. labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos);
  468. end;
  469. ait_instruction:
  470. begin
  471. inc(instrpos,2);
  472. case taicpu(p).opcode of
  473. A_BA:
  474. if (taicpu(p).oper[0]^.typ = top_ref) and
  475. assigned(taicpu(p).oper[0]^.ref^.symbol) and
  476. (taicpu(p).oper[0]^.ref^.symbol is tasmlabel) and
  477. (labelpositions[tasmlabel(taicpu(p).oper[0]^.ref^.symbol).labelnr] <> NIL) and
  478. {$push}
  479. {$q-}
  480. (ptruint(abs(ptrint(labelpositions[tasmlabel(taicpu(p).oper[0]^.ref^.symbol).labelnr]-instrpos)) - (low(smallint) div 4)) > ptruint((high(smallint) - low(smallint)) div 4)) then
  481. {$pop}
  482. begin
  483. if (cs_create_pic in current_settings.moduleswitches) then
  484. begin
  485. newcomment:=tai_comment.create(strpnew('fixup_jmps, A_BA changed into PIC sequence'));
  486. list.insertbefore(newcomment,p);
  487. href:=taicpu(p).oper[0]^.ref^;
  488. href.refaddr:=addr_pic;
  489. href.base:=NR_GP;
  490. newins:=taicpu.op_reg_ref(A_LW,NR_PIC_FUNC,href);
  491. newins.fileinfo:=taicpu(p).fileinfo;
  492. list.insertbefore(newins,p);
  493. inc(instrpos,2);
  494. if (href.symbol.bind=AB_LOCAL) then
  495. begin
  496. href.refaddr:=addr_low;
  497. href.base:=NR_NO;
  498. newins:=taicpu.op_reg_reg_ref(A_ADDIU,NR_PIC_FUNC,NR_PIC_FUNC,href);
  499. newins.fileinfo:=taicpu(p).fileinfo;
  500. list.insertbefore(newins,p);
  501. inc(instrpos,2);
  502. end;
  503. taicpu(p).opcode:=A_JR;
  504. taicpu(p).loadreg(0,NR_PIC_FUNC);
  505. end
  506. else
  507. begin
  508. taicpu(p).opcode:=A_J;
  509. newcomment:=tai_comment.create(strpnew('fixup_jmps, A_BA changed into A_J'));
  510. list.insertbefore(newcomment,p);
  511. end;
  512. end;
  513. A_BC:
  514. if (taicpu(p).ops=3) and (taicpu(p).oper[2]^.typ = top_ref) and
  515. assigned(taicpu(p).oper[2]^.ref^.symbol) and
  516. (taicpu(p).oper[2]^.ref^.symbol is tasmlabel) and
  517. (labelpositions[tasmlabel(taicpu(p).oper[2]^.ref^.symbol).labelnr] <> NIL) and
  518. {$push}
  519. {$q-}
  520. (ptruint(abs(ptrint(labelpositions[tasmlabel(taicpu(p).oper[2]^.ref^.symbol).labelnr]-instrpos)) - (low(smallint) div 4)) > ptruint((high(smallint) - low(smallint)) div 4)) then
  521. {$pop}
  522. begin
  523. // add a new label after this jump
  524. current_asmdata.getjumplabel(l);
  525. { new label -> may have to increase array size }
  526. if (l.labelnr >= labelpositions.count) then
  527. labelpositions.count := l.labelnr + 10;
  528. { newjmp will be inserted before the label, and it's inserted after }
  529. { plus delay slot }
  530. { the current jump -> instrpos+3 }
  531. labelpositions[l.labelnr] := pointer(instrpos+2*3);
  532. pdelayslot:=tai(p.next);
  533. { We need to insert the new instruction after the delay slot instruction ! }
  534. while assigned(pdelayslot) and (pdelayslot.typ<>ait_instruction) do
  535. pdelayslot:=tai(pdelayslot.next);
  536. list.insertafter(tai_label.create(l),pdelayslot);
  537. // add a new unconditional jump between this jump and the label
  538. newcomment:=tai_comment.create(strpnew('fixup_jmps, A_BXX changed into A_BNOTXX label;A_J;label:'));
  539. list.insertbefore(newcomment,p);
  540. if (cs_create_pic in current_settings.moduleswitches) then
  541. begin
  542. reference_reset_symbol(href,taicpu(p).oper[2]^.ref^.symbol,0,sizeof(pint));
  543. href.refaddr:=addr_pic;
  544. href.base:=NR_GP;
  545. newins:=taicpu.op_reg_ref(A_LW,NR_PIC_FUNC,href);
  546. newins.fileinfo:=taicpu(p).fileinfo;
  547. list.insertafter(newins,pdelayslot);
  548. pdelayslot:=newins;
  549. inc(instrpos,2);
  550. if (href.symbol.bind=AB_LOCAL) then
  551. begin
  552. href.base:=NR_NO;
  553. href.refaddr:=addr_low;
  554. newins:=taicpu.op_reg_reg_ref(A_ADDIU,NR_PIC_FUNC,NR_PIC_FUNC,href);
  555. newins.fileinfo:=taicpu(p).fileinfo;
  556. list.insertafter(newins,pdelayslot);
  557. pdelayslot:=newins;
  558. inc(instrpos,2);
  559. end;
  560. newjmp:=taicpu.op_reg(A_JR,NR_PIC_FUNC);
  561. newjmp.fileinfo:=taicpu(p).fileinfo;
  562. list.insertafter(newjmp,pdelayslot);
  563. inc(instrpos,2);
  564. end
  565. else
  566. begin
  567. newjmp := taicpu.op_sym(A_J,taicpu(p).oper[2]^.ref^.symbol);
  568. newjmp.is_jmp := true;
  569. newjmp.fileinfo := taicpu(p).fileinfo;
  570. list.insertafter(newjmp,pdelayslot);
  571. inc(instrpos,2);
  572. end;
  573. { Add a delay slot for new A_J instruction }
  574. newnoop:=taicpu.op_none(A_NOP);
  575. newnoop.fileinfo := taicpu(p).fileinfo;
  576. list.insertafter(newnoop,newjmp);
  577. inc(instrpos,2);
  578. // change the conditional jump to point to the newly inserted label
  579. tasmlabel(taicpu(p).oper[2]^.ref^.symbol).decrefs;
  580. taicpu(p).oper[2]^.ref^.symbol := l;
  581. l.increfs;
  582. // and invert its condition code
  583. taicpu(p).condition := inverse_cond(taicpu(p).condition);
  584. // we inserted an instruction, so will have to check everything again
  585. inserted_something := true;
  586. end;
  587. end;
  588. end;
  589. ait_const:
  590. inc(instrpos);
  591. end;
  592. p := tai(p.next);
  593. end;
  594. until not inserted_something;
  595. labelpositions.free;
  596. end;
  597. begin
  598. cai_cpu := taicpu;
  599. cai_align := tai_align;
  600. end.