aasmcpu.pas 20 KB

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