cgx86.pas 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit implements the common parts of the code generator for the i386 and the x86-64.
  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. { This unit implements the common parts of the code generator for the i386 and the x86-64.
  19. }
  20. unit cgx86;
  21. {$i fpcdefs.inc}
  22. interface
  23. uses
  24. globtype,
  25. cgbase,cgutils,cgobj,
  26. aasmbase,aasmtai,aasmcpu,
  27. cpubase,cpuinfo,rgobj,rgx86,rgcpu,
  28. symconst,symtype;
  29. type
  30. tcgx86 = class(tcg)
  31. rgfpu : Trgx86fpu;
  32. procedure done_register_allocators;override;
  33. function getfpuregister(list:Taasmoutput;size:Tcgsize):Tregister;override;
  34. function getmmxregister(list:Taasmoutput):Tregister;
  35. procedure getcpuregister(list:Taasmoutput;r:Tregister);override;
  36. procedure ungetcpuregister(list:Taasmoutput;r:Tregister);override;
  37. procedure alloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);override;
  38. procedure dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);override;
  39. function uses_registers(rt:Tregistertype):boolean;override;
  40. procedure add_reg_instruction(instr:Tai;r:tregister);override;
  41. procedure dec_fpu_stack;
  42. procedure inc_fpu_stack;
  43. procedure a_call_name(list : taasmoutput;const s : string);override;
  44. procedure a_call_reg(list : taasmoutput;reg : tregister);override;
  45. procedure a_op_const_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; a: aint; reg: TRegister); override;
  46. procedure a_op_const_ref(list : taasmoutput; Op: TOpCG; size: TCGSize; a: aint; const ref: TReference); override;
  47. procedure a_op_reg_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; src, dst: TRegister); override;
  48. procedure a_op_ref_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; const ref: TReference; reg: TRegister); override;
  49. procedure a_op_reg_ref(list : taasmoutput; Op: TOpCG; size: TCGSize;reg: TRegister; const ref: TReference); override;
  50. procedure a_op_const_reg_reg(list: taasmoutput; op: TOpCg;
  51. size: tcgsize; a: aint; src, dst: tregister); override;
  52. procedure a_op_reg_reg_reg(list: taasmoutput; op: TOpCg;
  53. size: tcgsize; src1, src2, dst: tregister); override;
  54. { move instructions }
  55. procedure a_load_const_reg(list : taasmoutput; tosize: tcgsize; a : aint;reg : tregister);override;
  56. procedure a_load_const_ref(list : taasmoutput; tosize: tcgsize; a : aint;const ref : treference);override;
  57. procedure a_load_reg_ref(list : taasmoutput;fromsize,tosize: tcgsize; reg : tregister;const ref : treference);override;
  58. procedure a_load_ref_reg(list : taasmoutput;fromsize,tosize: tcgsize;const ref : treference;reg : tregister);override;
  59. procedure a_load_reg_reg(list : taasmoutput;fromsize,tosize: tcgsize;reg1,reg2 : tregister);override;
  60. procedure a_loadaddr_ref_reg(list : taasmoutput;const ref : treference;r : tregister);override;
  61. { fpu move instructions }
  62. procedure a_loadfpu_reg_reg(list: taasmoutput; size: tcgsize; reg1, reg2: tregister); override;
  63. procedure a_loadfpu_ref_reg(list: taasmoutput; size: tcgsize; const ref: treference; reg: tregister); override;
  64. procedure a_loadfpu_reg_ref(list: taasmoutput; size: tcgsize; reg: tregister; const ref: treference); override;
  65. { vector register move instructions }
  66. procedure a_loadmm_reg_reg(list: taasmoutput; fromsize, tosize : tcgsize;reg1, reg2: tregister;shuffle : pmmshuffle); override;
  67. procedure a_loadmm_ref_reg(list: taasmoutput; fromsize, tosize : tcgsize;const ref: treference; reg: tregister;shuffle : pmmshuffle); override;
  68. procedure a_loadmm_reg_ref(list: taasmoutput; fromsize, tosize : tcgsize;reg: tregister; const ref: treference;shuffle : pmmshuffle); override;
  69. procedure a_opmm_ref_reg(list: taasmoutput; Op: TOpCG; size : tcgsize;const ref: treference; reg: tregister;shuffle : pmmshuffle); override;
  70. procedure a_opmm_reg_reg(list: taasmoutput; Op: TOpCG; size : tcgsize;src,dst: tregister;shuffle : pmmshuffle);override;
  71. { comparison operations }
  72. procedure a_cmp_const_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;a : aint;reg : tregister;
  73. l : tasmlabel);override;
  74. procedure a_cmp_const_ref_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;a : aint;const ref : treference;
  75. l : tasmlabel);override;
  76. procedure a_cmp_reg_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;reg1,reg2 : tregister;l : tasmlabel); override;
  77. procedure a_cmp_ref_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;const ref: treference; reg : tregister; l : tasmlabel); override;
  78. procedure a_cmp_reg_ref_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;reg : tregister; const ref: treference; l : tasmlabel); override;
  79. procedure a_jmp_name(list : taasmoutput;const s : string);override;
  80. procedure a_jmp_always(list : taasmoutput;l: tasmlabel); override;
  81. procedure a_jmp_flags(list : taasmoutput;const f : TResFlags;l: tasmlabel); override;
  82. procedure g_flags2reg(list: taasmoutput; size: TCgSize; const f: tresflags; reg: TRegister); override;
  83. procedure g_flags2ref(list: taasmoutput; size: TCgSize; const f: tresflags; const ref: TReference); override;
  84. procedure g_concatcopy(list : taasmoutput;const source,dest : treference;len : aint);override;
  85. { entry/exit code helpers }
  86. procedure g_releasevaluepara_openarray(list : taasmoutput;const ref:treference);override;
  87. procedure g_profilecode(list : taasmoutput);override;
  88. procedure g_stackpointer_alloc(list : taasmoutput;localsize : longint);override;
  89. procedure g_proc_entry(list : taasmoutput;localsize : longint;nostackframe:boolean);override;
  90. procedure g_overflowcheck(list: taasmoutput; const l:tlocation;def:tdef);override;
  91. protected
  92. procedure a_jmp_cond(list : taasmoutput;cond : TOpCmp;l: tasmlabel);
  93. procedure check_register_size(size:tcgsize;reg:tregister);
  94. procedure opmm_loc_reg(list: taasmoutput; Op: TOpCG; size : tcgsize;loc : tlocation;dst: tregister; shuffle : pmmshuffle);
  95. private
  96. procedure sizes2load(s1,s2 : tcgsize;var op: tasmop; var s3: topsize);
  97. procedure floatload(list: taasmoutput; t : tcgsize;const ref : treference);
  98. procedure floatstore(list: taasmoutput; t : tcgsize;const ref : treference);
  99. procedure floatloadops(t : tcgsize;var op : tasmop;var s : topsize);
  100. procedure floatstoreops(t : tcgsize;var op : tasmop;var s : topsize);
  101. end;
  102. function use_sse(def : tdef) : boolean;
  103. const
  104. {$ifdef x86_64}
  105. TCGSize2OpSize: Array[tcgsize] of topsize =
  106. (S_NO,S_B,S_W,S_L,S_Q,S_Q,S_B,S_W,S_L,S_Q,S_Q,
  107. S_FS,S_FL,S_FX,S_IQ,S_FXX,
  108. S_NO,S_NO,S_NO,S_MD,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO);
  109. {$else x86_64}
  110. TCGSize2OpSize: Array[tcgsize] of topsize =
  111. (S_NO,S_B,S_W,S_L,S_L,S_L,S_B,S_W,S_L,S_L,S_L,
  112. S_FS,S_FL,S_FX,S_IQ,S_FXX,
  113. S_NO,S_NO,S_NO,S_MD,S_NO,S_NO,S_NO,S_NO,S_NO,S_NO);
  114. {$endif x86_64}
  115. {$ifndef NOTARGETWIN32}
  116. winstackpagesize = 4096;
  117. {$endif NOTARGETWIN32}
  118. implementation
  119. uses
  120. globals,verbose,systems,cutils,
  121. dwarf,
  122. symdef,defutil,paramgr,tgobj,procinfo;
  123. const
  124. TOpCG2AsmOp: Array[topcg] of TAsmOp = (A_NONE,A_ADD,A_AND,A_DIV,
  125. A_IDIV,A_MUL, A_IMUL, A_NEG,A_NOT,A_OR,
  126. A_SAR,A_SHL,A_SHR,A_SUB,A_XOR);
  127. TOpCmp2AsmCond: Array[topcmp] of TAsmCond = (C_NONE,
  128. C_E,C_G,C_L,C_GE,C_LE,C_NE,C_BE,C_B,C_AE,C_A);
  129. function use_sse(def : tdef) : boolean;
  130. begin
  131. use_sse:=(is_single(def) and (aktfputype in sse_singlescalar)) or
  132. (is_double(def) and (aktfputype in sse_doublescalar));
  133. end;
  134. procedure Tcgx86.done_register_allocators;
  135. begin
  136. rg[R_INTREGISTER].free;
  137. rg[R_MMREGISTER].free;
  138. rg[R_MMXREGISTER].free;
  139. rgfpu.free;
  140. inherited done_register_allocators;
  141. end;
  142. function Tcgx86.getfpuregister(list:Taasmoutput;size:Tcgsize):Tregister;
  143. begin
  144. result:=rgfpu.getregisterfpu(list);
  145. end;
  146. function Tcgx86.getmmxregister(list:Taasmoutput):Tregister;
  147. begin
  148. if not assigned(rg[R_MMXREGISTER]) then
  149. internalerror(200312124);
  150. result:=rg[R_MMXREGISTER].getregister(list,R_SUBNONE);
  151. end;
  152. procedure Tcgx86.getcpuregister(list:Taasmoutput;r:Tregister);
  153. begin
  154. if getregtype(r)=R_FPUREGISTER then
  155. internalerror(2003121210)
  156. else
  157. inherited getcpuregister(list,r);
  158. end;
  159. procedure tcgx86.ungetcpuregister(list:Taasmoutput;r:Tregister);
  160. begin
  161. if getregtype(r)=R_FPUREGISTER then
  162. rgfpu.ungetregisterfpu(list,r)
  163. else
  164. inherited ungetcpuregister(list,r);
  165. end;
  166. procedure Tcgx86.alloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);
  167. begin
  168. if rt<>R_FPUREGISTER then
  169. inherited alloccpuregisters(list,rt,r);
  170. end;
  171. procedure Tcgx86.dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);
  172. begin
  173. if rt<>R_FPUREGISTER then
  174. inherited dealloccpuregisters(list,rt,r);
  175. end;
  176. function Tcgx86.uses_registers(rt:Tregistertype):boolean;
  177. begin
  178. if rt=R_FPUREGISTER then
  179. result:=false
  180. else
  181. result:=inherited uses_registers(rt);
  182. end;
  183. procedure tcgx86.add_reg_instruction(instr:Tai;r:tregister);
  184. begin
  185. if getregtype(r)<>R_FPUREGISTER then
  186. inherited add_reg_instruction(instr,r);
  187. end;
  188. procedure tcgx86.dec_fpu_stack;
  189. begin
  190. dec(rgfpu.fpuvaroffset);
  191. end;
  192. procedure tcgx86.inc_fpu_stack;
  193. begin
  194. inc(rgfpu.fpuvaroffset);
  195. end;
  196. {****************************************************************************
  197. This is private property, keep out! :)
  198. ****************************************************************************}
  199. procedure tcgx86.sizes2load(s1,s2 : tcgsize; var op: tasmop; var s3: topsize);
  200. begin
  201. case s2 of
  202. OS_8,OS_S8 :
  203. if S1 in [OS_8,OS_S8] then
  204. s3 := S_B
  205. else
  206. internalerror(200109221);
  207. OS_16,OS_S16:
  208. case s1 of
  209. OS_8,OS_S8:
  210. s3 := S_BW;
  211. OS_16,OS_S16:
  212. s3 := S_W;
  213. else
  214. internalerror(200109222);
  215. end;
  216. OS_32,OS_S32:
  217. case s1 of
  218. OS_8,OS_S8:
  219. s3 := S_BL;
  220. OS_16,OS_S16:
  221. s3 := S_WL;
  222. OS_32,OS_S32:
  223. s3 := S_L;
  224. else
  225. internalerror(200109223);
  226. end;
  227. {$ifdef x86_64}
  228. OS_64,OS_S64:
  229. case s1 of
  230. OS_8:
  231. s3 := S_BL;
  232. OS_S8:
  233. s3 := S_BQ;
  234. OS_16:
  235. s3 := S_WL;
  236. OS_S16:
  237. s3 := S_WQ;
  238. OS_32:
  239. s3 := S_L;
  240. OS_S32:
  241. s3 := S_LQ;
  242. OS_64,OS_S64:
  243. s3 := S_Q;
  244. else
  245. internalerror(200304302);
  246. end;
  247. {$endif x86_64}
  248. else
  249. internalerror(200109227);
  250. end;
  251. if s3 in [S_B,S_W,S_L,S_Q] then
  252. op := A_MOV
  253. else if s1 in [OS_8,OS_16,OS_32,OS_64] then
  254. op := A_MOVZX
  255. else
  256. {$ifdef x86_64}
  257. if s3 in [S_LQ] then
  258. op := A_MOVSXD
  259. else
  260. {$endif x86_64}
  261. op := A_MOVSX;
  262. end;
  263. procedure tcgx86.floatloadops(t : tcgsize;var op : tasmop;var s : topsize);
  264. begin
  265. case t of
  266. OS_F32 :
  267. begin
  268. op:=A_FLD;
  269. s:=S_FS;
  270. end;
  271. OS_F64 :
  272. begin
  273. op:=A_FLD;
  274. s:=S_FL;
  275. end;
  276. OS_F80 :
  277. begin
  278. op:=A_FLD;
  279. s:=S_FX;
  280. end;
  281. OS_C64 :
  282. begin
  283. op:=A_FILD;
  284. s:=S_IQ;
  285. end;
  286. else
  287. internalerror(200204041);
  288. end;
  289. end;
  290. procedure tcgx86.floatload(list: taasmoutput; t : tcgsize;const ref : treference);
  291. var
  292. op : tasmop;
  293. s : topsize;
  294. begin
  295. floatloadops(t,op,s);
  296. list.concat(Taicpu.Op_ref(op,s,ref));
  297. inc_fpu_stack;
  298. end;
  299. procedure tcgx86.floatstoreops(t : tcgsize;var op : tasmop;var s : topsize);
  300. begin
  301. case t of
  302. OS_F32 :
  303. begin
  304. op:=A_FSTP;
  305. s:=S_FS;
  306. end;
  307. OS_F64 :
  308. begin
  309. op:=A_FSTP;
  310. s:=S_FL;
  311. end;
  312. OS_F80 :
  313. begin
  314. op:=A_FSTP;
  315. s:=S_FX;
  316. end;
  317. OS_C64 :
  318. begin
  319. op:=A_FISTP;
  320. s:=S_IQ;
  321. end;
  322. else
  323. internalerror(200204042);
  324. end;
  325. end;
  326. procedure tcgx86.floatstore(list: taasmoutput; t : tcgsize;const ref : treference);
  327. var
  328. op : tasmop;
  329. s : topsize;
  330. begin
  331. floatstoreops(t,op,s);
  332. list.concat(Taicpu.Op_ref(op,s,ref));
  333. dec_fpu_stack;
  334. end;
  335. procedure tcgx86.check_register_size(size:tcgsize;reg:tregister);
  336. begin
  337. if TCGSize2OpSize[size]<>TCGSize2OpSize[reg_cgsize(reg)] then
  338. internalerror(200306031);
  339. end;
  340. {****************************************************************************
  341. Assembler code
  342. ****************************************************************************}
  343. procedure tcgx86.a_jmp_name(list : taasmoutput;const s : string);
  344. begin
  345. list.concat(taicpu.op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(s,AB_EXTERNAL,AT_FUNCTION)));
  346. end;
  347. procedure tcgx86.a_jmp_always(list : taasmoutput;l: tasmlabel);
  348. begin
  349. a_jmp_cond(list, OC_NONE, l);
  350. end;
  351. procedure tcgx86.a_call_name(list : taasmoutput;const s : string);
  352. begin
  353. list.concat(taicpu.op_sym(A_CALL,S_NO,objectlibrary.newasmsymbol(s,AB_EXTERNAL,AT_FUNCTION)));
  354. end;
  355. procedure tcgx86.a_call_reg(list : taasmoutput;reg : tregister);
  356. begin
  357. list.concat(taicpu.op_reg(A_CALL,S_NO,reg));
  358. end;
  359. {********************** load instructions ********************}
  360. procedure tcgx86.a_load_const_reg(list : taasmoutput; tosize: TCGSize; a : aint; reg : TRegister);
  361. begin
  362. check_register_size(tosize,reg);
  363. { the optimizer will change it to "xor reg,reg" when loading zero, }
  364. { no need to do it here too (JM) }
  365. list.concat(taicpu.op_const_reg(A_MOV,TCGSize2OpSize[tosize],a,reg))
  366. end;
  367. procedure tcgx86.a_load_const_ref(list : taasmoutput; tosize: tcgsize; a : aint;const ref : treference);
  368. {$ifdef x86_64}
  369. var
  370. href : treference;
  371. {$endif x86_64}
  372. begin
  373. {$ifdef x86_64}
  374. { x86_64 only supports signed 32 bits constants directly }
  375. if (tosize in [OS_S64,OS_64]) and
  376. ((a<low(longint)) or (a>high(longint))) then
  377. begin
  378. href:=ref;
  379. a_load_const_ref(list,OS_32,longint(a and $ffffffff),href);
  380. inc(href.offset,4);
  381. a_load_const_ref(list,OS_32,longint(a shr 32),href);
  382. end
  383. else
  384. {$endif x86_64}
  385. list.concat(taicpu.op_const_ref(A_MOV,TCGSize2OpSize[tosize],a,ref));
  386. end;
  387. procedure tcgx86.a_load_reg_ref(list : taasmoutput; fromsize,tosize: TCGSize; reg : tregister;const ref : treference);
  388. var
  389. op: tasmop;
  390. s: topsize;
  391. tmpsize : tcgsize;
  392. tmpreg : tregister;
  393. begin
  394. check_register_size(fromsize,reg);
  395. sizes2load(fromsize,tosize,op,s);
  396. case s of
  397. {$ifdef x86_64}
  398. S_BQ,S_WQ,S_LQ,
  399. {$endif x86_64}
  400. S_BW,S_BL,S_WL :
  401. begin
  402. tmpreg:=getintregister(list,tosize);
  403. {$ifdef x86_64}
  404. { zero extensions to 64 bit on the x86_64 are simply done by writting to the lower 32 bit
  405. which clears the upper 64 bit too, so it could be that s is S_L while the reg is
  406. 64 bit (FK) }
  407. if s in [S_BL,S_WL,S_L] then
  408. begin
  409. tmpreg:=makeregsize(list,tmpreg,OS_32);
  410. tmpsize:=OS_32;
  411. end
  412. else
  413. tmpsize:=tosize;
  414. {$endif x86_64}
  415. list.concat(taicpu.op_reg_reg(op,s,reg,tmpreg));
  416. a_load_reg_ref(list,tmpsize,tosize,tmpreg,ref);
  417. end;
  418. else
  419. list.concat(taicpu.op_reg_ref(op,s,reg,ref));
  420. end;
  421. end;
  422. procedure tcgx86.a_load_ref_reg(list : taasmoutput;fromsize,tosize : tcgsize;const ref: treference;reg : tregister);
  423. var
  424. op: tasmop;
  425. s: topsize;
  426. begin
  427. check_register_size(tosize,reg);
  428. sizes2load(fromsize,tosize,op,s);
  429. {$ifdef x86_64}
  430. { zero extensions to 64 bit on the x86_64 are simply done by writting to the lower 32 bit
  431. which clears the upper 64 bit too, so it could be that s is S_L while the reg is
  432. 64 bit (FK) }
  433. if s in [S_BL,S_WL,S_L] then
  434. reg:=makeregsize(list,reg,OS_32);
  435. {$endif x86_64}
  436. list.concat(taicpu.op_ref_reg(op,s,ref,reg));
  437. end;
  438. procedure tcgx86.a_load_reg_reg(list : taasmoutput;fromsize,tosize : tcgsize;reg1,reg2 : tregister);
  439. var
  440. op: tasmop;
  441. s: topsize;
  442. instr:Taicpu;
  443. begin
  444. check_register_size(fromsize,reg1);
  445. check_register_size(tosize,reg2);
  446. if tcgsize2size[fromsize]>tcgsize2size[tosize] then
  447. begin
  448. reg1:=makeregsize(list,reg1,tosize);
  449. s:=tcgsize2opsize[tosize];
  450. op:=A_MOV;
  451. end
  452. else
  453. sizes2load(fromsize,tosize,op,s);
  454. {$ifdef x86_64}
  455. { zero extensions to 64 bit on the x86_64 are simply done by writting to the lower 32 bit
  456. which clears the upper 64 bit too, so it could be that s is S_L while the reg is
  457. 64 bit (FK) }
  458. if s in [S_BL,S_WL,S_L] then
  459. reg2:=makeregsize(list,reg2,OS_32);
  460. {$endif x86_64}
  461. if (reg1<>reg2) then
  462. begin
  463. instr:=taicpu.op_reg_reg(op,s,reg1,reg2);
  464. { Notify the register allocator that we have written a move instruction so
  465. it can try to eliminate it. }
  466. add_move_instruction(instr);
  467. list.concat(instr);
  468. end;
  469. end;
  470. procedure tcgx86.a_loadaddr_ref_reg(list : taasmoutput;const ref : treference;r : tregister);
  471. begin
  472. with ref do
  473. if (base=NR_NO) and (index=NR_NO) then
  474. begin
  475. if assigned(ref.symbol) then
  476. list.concat(Taicpu.op_sym_ofs_reg(A_MOV,tcgsize2opsize[OS_ADDR],symbol,offset,r))
  477. else
  478. a_load_const_reg(list,OS_ADDR,offset,r);
  479. end
  480. else if (base=NR_NO) and (index<>NR_NO) and
  481. (offset=0) and (scalefactor=0) and (symbol=nil) then
  482. a_load_reg_reg(list,OS_ADDR,OS_ADDR,index,r)
  483. else if (base<>NR_NO) and (index=NR_NO) and
  484. (offset=0) and (symbol=nil) then
  485. a_load_reg_reg(list,OS_ADDR,OS_ADDR,base,r)
  486. else
  487. list.concat(taicpu.op_ref_reg(A_LEA,tcgsize2opsize[OS_ADDR],ref,r));
  488. end;
  489. { all fpu load routines expect that R_ST[0-7] means an fpu regvar and }
  490. { R_ST means "the current value at the top of the fpu stack" (JM) }
  491. procedure tcgx86.a_loadfpu_reg_reg(list: taasmoutput; size: tcgsize; reg1, reg2: tregister);
  492. begin
  493. if (reg1<>NR_ST) then
  494. begin
  495. list.concat(taicpu.op_reg(A_FLD,S_NO,rgfpu.correct_fpuregister(reg1,rgfpu.fpuvaroffset)));
  496. inc_fpu_stack;
  497. end;
  498. if (reg2<>NR_ST) then
  499. begin
  500. list.concat(taicpu.op_reg(A_FSTP,S_NO,rgfpu.correct_fpuregister(reg2,rgfpu.fpuvaroffset)));
  501. dec_fpu_stack;
  502. end;
  503. end;
  504. procedure tcgx86.a_loadfpu_ref_reg(list: taasmoutput; size: tcgsize; const ref: treference; reg: tregister);
  505. begin
  506. floatload(list,size,ref);
  507. if (reg<>NR_ST) then
  508. a_loadfpu_reg_reg(list,size,NR_ST,reg);
  509. end;
  510. procedure tcgx86.a_loadfpu_reg_ref(list: taasmoutput; size: tcgsize; reg: tregister; const ref: treference);
  511. begin
  512. if reg<>NR_ST then
  513. a_loadfpu_reg_reg(list,size,reg,NR_ST);
  514. floatstore(list,size,ref);
  515. end;
  516. function get_scalar_mm_op(fromsize,tosize : tcgsize) : tasmop;
  517. const
  518. convertop : array[OS_F32..OS_F128,OS_F32..OS_F128] of tasmop = (
  519. (A_MOVSS,A_CVTSS2SD,A_NONE,A_NONE,A_NONE),
  520. (A_CVTSD2SS,A_MOVSD,A_NONE,A_NONE,A_NONE),
  521. (A_NONE,A_NONE,A_NONE,A_NONE,A_NONE),
  522. (A_NONE,A_NONE,A_NONE,A_MOVQ,A_NONE),
  523. (A_NONE,A_NONE,A_NONE,A_NONE,A_NONE));
  524. begin
  525. result:=convertop[fromsize,tosize];
  526. if result=A_NONE then
  527. internalerror(200312205);
  528. end;
  529. procedure tcgx86.a_loadmm_reg_reg(list: taasmoutput; fromsize, tosize : tcgsize;reg1, reg2: tregister;shuffle : pmmshuffle);
  530. begin
  531. if shuffle=nil then
  532. begin
  533. if fromsize=tosize then
  534. list.concat(taicpu.op_reg_reg(A_MOVAPS,S_NO,reg1,reg2))
  535. else
  536. internalerror(200312202);
  537. end
  538. else if shufflescalar(shuffle) then
  539. list.concat(taicpu.op_reg_reg(get_scalar_mm_op(fromsize,tosize),S_NO,reg1,reg2))
  540. else
  541. internalerror(200312201);
  542. end;
  543. procedure tcgx86.a_loadmm_ref_reg(list: taasmoutput; fromsize, tosize : tcgsize;const ref: treference; reg: tregister;shuffle : pmmshuffle);
  544. begin
  545. if shuffle=nil then
  546. begin
  547. list.concat(taicpu.op_ref_reg(A_MOVQ,S_NO,ref,reg));
  548. end
  549. else if shufflescalar(shuffle) then
  550. list.concat(taicpu.op_ref_reg(get_scalar_mm_op(fromsize,tosize),S_NO,ref,reg))
  551. else
  552. internalerror(200312252);
  553. end;
  554. procedure tcgx86.a_loadmm_reg_ref(list: taasmoutput; fromsize, tosize : tcgsize;reg: tregister; const ref: treference;shuffle : pmmshuffle);
  555. begin
  556. if shuffle=nil then
  557. begin
  558. list.concat(taicpu.op_reg_ref(A_MOVQ,S_NO,reg,ref));
  559. end
  560. else if shufflescalar(shuffle) then
  561. list.concat(taicpu.op_reg_ref(get_scalar_mm_op(fromsize,tosize),S_NO,reg,ref))
  562. else
  563. internalerror(200312252);
  564. end;
  565. procedure tcgx86.a_opmm_ref_reg(list: taasmoutput; Op: TOpCG; size : tcgsize;const ref: treference; reg: tregister;shuffle : pmmshuffle);
  566. var
  567. l : tlocation;
  568. begin
  569. l.loc:=LOC_REFERENCE;
  570. l.reference:=ref;
  571. l.size:=size;
  572. opmm_loc_reg(list,op,size,l,reg,shuffle);
  573. end;
  574. procedure tcgx86.a_opmm_reg_reg(list: taasmoutput; Op: TOpCG; size : tcgsize;src,dst: tregister;shuffle : pmmshuffle);
  575. var
  576. l : tlocation;
  577. begin
  578. l.loc:=LOC_MMREGISTER;
  579. l.register:=src;
  580. l.size:=size;
  581. opmm_loc_reg(list,op,size,l,dst,shuffle);
  582. end;
  583. procedure tcgx86.opmm_loc_reg(list: taasmoutput; Op: TOpCG; size : tcgsize;loc : tlocation;dst: tregister; shuffle : pmmshuffle);
  584. const
  585. opmm2asmop : array[0..1,OS_F32..OS_F64,topcg] of tasmop = (
  586. ( { scalar }
  587. ( { OS_F32 }
  588. A_NOP,A_ADDSS,A_NOP,A_DIVSS,A_NOP,A_NOP,A_MULSS,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_SUBSS,A_NOP
  589. ),
  590. ( { OS_F64 }
  591. A_NOP,A_ADDSD,A_NOP,A_DIVSD,A_NOP,A_NOP,A_MULSD,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_SUBSD,A_NOP
  592. )
  593. ),
  594. ( { vectorized/packed }
  595. { because the logical packed single instructions have shorter op codes, we use always
  596. these
  597. }
  598. ( { OS_F32 }
  599. A_NOP,A_ADDPS,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_XORPS
  600. ),
  601. ( { OS_F64 }
  602. A_NOP,A_ADDPD,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_NOP,A_XORPS
  603. )
  604. )
  605. );
  606. var
  607. resultreg : tregister;
  608. asmop : tasmop;
  609. begin
  610. { this is an internally used procedure so the parameters have
  611. some constrains
  612. }
  613. if loc.size<>size then
  614. internalerror(200312213);
  615. resultreg:=dst;
  616. { deshuffle }
  617. //!!!
  618. if (shuffle<>nil) and not(shufflescalar(shuffle)) then
  619. begin
  620. end
  621. else if (shuffle=nil) then
  622. asmop:=opmm2asmop[1,size,op]
  623. else if shufflescalar(shuffle) then
  624. begin
  625. asmop:=opmm2asmop[0,size,op];
  626. { no scalar operation available? }
  627. if asmop=A_NOP then
  628. begin
  629. { do vectorized and shuffle finally }
  630. //!!!
  631. end;
  632. end
  633. else
  634. internalerror(200312211);
  635. if asmop=A_NOP then
  636. internalerror(200312215);
  637. case loc.loc of
  638. LOC_CREFERENCE,LOC_REFERENCE:
  639. list.concat(taicpu.op_ref_reg(asmop,S_NO,loc.reference,resultreg));
  640. LOC_CMMREGISTER,LOC_MMREGISTER:
  641. list.concat(taicpu.op_reg_reg(asmop,S_NO,loc.register,resultreg));
  642. else
  643. internalerror(200312214);
  644. end;
  645. { shuffle }
  646. if resultreg<>dst then
  647. begin
  648. internalerror(200312212);
  649. end;
  650. end;
  651. procedure tcgx86.a_op_const_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; a: aint; reg: TRegister);
  652. var
  653. opcode : tasmop;
  654. power : longint;
  655. {$ifdef x86_64}
  656. tmpreg : tregister;
  657. {$endif x86_64}
  658. begin
  659. {$ifdef x86_64}
  660. { x86_64 only supports signed 32 bits constants directly }
  661. if (size in [OS_S64,OS_64]) and
  662. ((a<low(longint)) or (a>high(longint))) then
  663. begin
  664. tmpreg:=getintregister(list,size);
  665. a_load_const_reg(list,size,a,tmpreg);
  666. a_op_reg_reg(list,op,size,tmpreg,reg);
  667. exit;
  668. end;
  669. {$endif x86_64}
  670. check_register_size(size,reg);
  671. case op of
  672. OP_DIV, OP_IDIV:
  673. begin
  674. if ispowerof2(int64(a),power) then
  675. begin
  676. case op of
  677. OP_DIV:
  678. opcode := A_SHR;
  679. OP_IDIV:
  680. opcode := A_SAR;
  681. end;
  682. list.concat(taicpu.op_const_reg(opcode,TCgSize2OpSize[size],power,reg));
  683. exit;
  684. end;
  685. { the rest should be handled specifically in the code }
  686. { generator because of the silly register usage restraints }
  687. internalerror(200109224);
  688. end;
  689. OP_MUL,OP_IMUL:
  690. begin
  691. if not(cs_check_overflow in aktlocalswitches) and
  692. ispowerof2(int64(a),power) then
  693. begin
  694. list.concat(taicpu.op_const_reg(A_SHL,TCgSize2OpSize[size],power,reg));
  695. exit;
  696. end;
  697. if op = OP_IMUL then
  698. list.concat(taicpu.op_const_reg(A_IMUL,TCgSize2OpSize[size],a,reg))
  699. else
  700. { OP_MUL should be handled specifically in the code }
  701. { generator because of the silly register usage restraints }
  702. internalerror(200109225);
  703. end;
  704. OP_ADD, OP_AND, OP_OR, OP_SUB, OP_XOR:
  705. if not(cs_check_overflow in aktlocalswitches) and
  706. (a = 1) and
  707. (op in [OP_ADD,OP_SUB]) then
  708. if op = OP_ADD then
  709. list.concat(taicpu.op_reg(A_INC,TCgSize2OpSize[size],reg))
  710. else
  711. list.concat(taicpu.op_reg(A_DEC,TCgSize2OpSize[size],reg))
  712. else if (a = 0) then
  713. if (op <> OP_AND) then
  714. exit
  715. else
  716. list.concat(taicpu.op_const_reg(A_MOV,TCgSize2OpSize[size],0,reg))
  717. else if (aword(a) = high(aword)) and
  718. (op in [OP_AND,OP_OR,OP_XOR]) then
  719. begin
  720. case op of
  721. OP_AND:
  722. exit;
  723. OP_OR:
  724. list.concat(taicpu.op_const_reg(A_MOV,TCgSize2OpSize[size],aint(high(aword)),reg));
  725. OP_XOR:
  726. list.concat(taicpu.op_reg(A_NOT,TCgSize2OpSize[size],reg));
  727. end
  728. end
  729. else
  730. list.concat(taicpu.op_const_reg(TOpCG2AsmOp[op],TCgSize2OpSize[size],a,reg));
  731. OP_SHL,OP_SHR,OP_SAR:
  732. begin
  733. if (a and 31) <> 0 Then
  734. list.concat(taicpu.op_const_reg(TOpCG2AsmOp[op],TCgSize2OpSize[size],a and 31,reg));
  735. if (a shr 5) <> 0 Then
  736. internalerror(68991);
  737. end
  738. else internalerror(68992);
  739. end;
  740. end;
  741. procedure tcgx86.a_op_const_ref(list : taasmoutput; Op: TOpCG; size: TCGSize; a: aint; const ref: TReference);
  742. var
  743. opcode: tasmop;
  744. power: longint;
  745. {$ifdef x86_64}
  746. tmpreg : tregister;
  747. {$endif x86_64}
  748. begin
  749. {$ifdef x86_64}
  750. { x86_64 only supports signed 32 bits constants directly }
  751. if (size in [OS_S64,OS_64]) and
  752. ((a<low(longint)) or (a>high(longint))) then
  753. begin
  754. tmpreg:=getintregister(list,size);
  755. a_load_const_reg(list,size,a,tmpreg);
  756. a_op_reg_ref(list,op,size,tmpreg,ref);
  757. exit;
  758. end;
  759. {$endif x86_64}
  760. Case Op of
  761. OP_DIV, OP_IDIV:
  762. Begin
  763. if ispowerof2(int64(a),power) then
  764. begin
  765. case op of
  766. OP_DIV:
  767. opcode := A_SHR;
  768. OP_IDIV:
  769. opcode := A_SAR;
  770. end;
  771. list.concat(taicpu.op_const_ref(opcode,
  772. TCgSize2OpSize[size],power,ref));
  773. exit;
  774. end;
  775. { the rest should be handled specifically in the code }
  776. { generator because of the silly register usage restraints }
  777. internalerror(200109231);
  778. End;
  779. OP_MUL,OP_IMUL:
  780. begin
  781. if not(cs_check_overflow in aktlocalswitches) and
  782. ispowerof2(int64(a),power) then
  783. begin
  784. list.concat(taicpu.op_const_ref(A_SHL,TCgSize2OpSize[size],
  785. power,ref));
  786. exit;
  787. end;
  788. { can't multiply a memory location directly with a constant }
  789. if op = OP_IMUL then
  790. inherited a_op_const_ref(list,op,size,a,ref)
  791. else
  792. { OP_MUL should be handled specifically in the code }
  793. { generator because of the silly register usage restraints }
  794. internalerror(200109232);
  795. end;
  796. OP_ADD, OP_AND, OP_OR, OP_SUB, OP_XOR:
  797. if not(cs_check_overflow in aktlocalswitches) and
  798. (a = 1) and
  799. (op in [OP_ADD,OP_SUB]) then
  800. if op = OP_ADD then
  801. list.concat(taicpu.op_ref(A_INC,TCgSize2OpSize[size],ref))
  802. else
  803. list.concat(taicpu.op_ref(A_DEC,TCgSize2OpSize[size],ref))
  804. else if (a = 0) then
  805. if (op <> OP_AND) then
  806. exit
  807. else
  808. a_load_const_ref(list,size,0,ref)
  809. else if (aword(a) = high(aword)) and
  810. (op in [OP_AND,OP_OR,OP_XOR]) then
  811. begin
  812. case op of
  813. OP_AND:
  814. exit;
  815. OP_OR:
  816. list.concat(taicpu.op_const_ref(A_MOV,TCgSize2OpSize[size],aint(high(aword)),ref));
  817. OP_XOR:
  818. list.concat(taicpu.op_ref(A_NOT,TCgSize2OpSize[size],ref));
  819. end
  820. end
  821. else
  822. list.concat(taicpu.op_const_ref(TOpCG2AsmOp[op],
  823. TCgSize2OpSize[size],a,ref));
  824. OP_SHL,OP_SHR,OP_SAR:
  825. begin
  826. if (a and 31) <> 0 then
  827. list.concat(taicpu.op_const_ref(
  828. TOpCG2AsmOp[op],TCgSize2OpSize[size],a and 31,ref));
  829. if (a shr 5) <> 0 Then
  830. internalerror(68991);
  831. end
  832. else internalerror(68992);
  833. end;
  834. end;
  835. procedure tcgx86.a_op_reg_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; src, dst: TRegister);
  836. var
  837. dstsize: topsize;
  838. instr:Taicpu;
  839. begin
  840. check_register_size(size,src);
  841. check_register_size(size,dst);
  842. dstsize := tcgsize2opsize[size];
  843. case op of
  844. OP_NEG,OP_NOT:
  845. begin
  846. if src<>dst then
  847. a_load_reg_reg(list,size,size,src,dst);
  848. list.concat(taicpu.op_reg(TOpCG2AsmOp[op],dstsize,dst));
  849. end;
  850. OP_MUL,OP_DIV,OP_IDIV:
  851. { special stuff, needs separate handling inside code }
  852. { generator }
  853. internalerror(200109233);
  854. OP_SHR,OP_SHL,OP_SAR:
  855. begin
  856. getcpuregister(list,NR_CL);
  857. a_load_reg_reg(list,OS_8,OS_8,makeregsize(list,src,OS_8),NR_CL);
  858. list.concat(taicpu.op_reg_reg(Topcg2asmop[op],tcgsize2opsize[size],NR_CL,src));
  859. ungetcpuregister(list,NR_CL);
  860. end;
  861. else
  862. begin
  863. if reg2opsize(src) <> dstsize then
  864. internalerror(200109226);
  865. instr:=taicpu.op_reg_reg(TOpCG2AsmOp[op],dstsize,src,dst);
  866. list.concat(instr);
  867. end;
  868. end;
  869. end;
  870. procedure tcgx86.a_op_ref_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; const ref: TReference; reg: TRegister);
  871. begin
  872. check_register_size(size,reg);
  873. case op of
  874. OP_NEG,OP_NOT,OP_IMUL:
  875. begin
  876. inherited a_op_ref_reg(list,op,size,ref,reg);
  877. end;
  878. OP_MUL,OP_DIV,OP_IDIV:
  879. { special stuff, needs separate handling inside code }
  880. { generator }
  881. internalerror(200109239);
  882. else
  883. begin
  884. reg := makeregsize(list,reg,size);
  885. list.concat(taicpu.op_ref_reg(TOpCG2AsmOp[op],tcgsize2opsize[size],ref,reg));
  886. end;
  887. end;
  888. end;
  889. procedure tcgx86.a_op_reg_ref(list : taasmoutput; Op: TOpCG; size: TCGSize;reg: TRegister; const ref: TReference);
  890. begin
  891. check_register_size(size,reg);
  892. case op of
  893. OP_NEG,OP_NOT:
  894. begin
  895. if reg<>NR_NO then
  896. internalerror(200109237);
  897. list.concat(taicpu.op_ref(TOpCG2AsmOp[op],tcgsize2opsize[size],ref));
  898. end;
  899. OP_IMUL:
  900. begin
  901. { this one needs a load/imul/store, which is the default }
  902. inherited a_op_ref_reg(list,op,size,ref,reg);
  903. end;
  904. OP_MUL,OP_DIV,OP_IDIV:
  905. { special stuff, needs separate handling inside code }
  906. { generator }
  907. internalerror(200109238);
  908. else
  909. begin
  910. list.concat(taicpu.op_reg_ref(TOpCG2AsmOp[op],tcgsize2opsize[size],reg,ref));
  911. end;
  912. end;
  913. end;
  914. procedure tcgx86.a_op_const_reg_reg(list: taasmoutput; op: TOpCg; size: tcgsize; a: aint; src, dst: tregister);
  915. var
  916. tmpref: treference;
  917. power: longint;
  918. {$ifdef x86_64}
  919. tmpreg : tregister;
  920. {$endif x86_64}
  921. begin
  922. {$ifdef x86_64}
  923. { x86_64 only supports signed 32 bits constants directly }
  924. if (size in [OS_S64,OS_64]) and
  925. ((a<low(longint)) or (a>high(longint))) then
  926. begin
  927. tmpreg:=getintregister(list,size);
  928. a_load_const_reg(list,size,a,tmpreg);
  929. a_op_reg_reg_reg(list,op,size,tmpreg,src,dst);
  930. exit;
  931. end;
  932. {$endif x86_64}
  933. check_register_size(size,src);
  934. check_register_size(size,dst);
  935. if tcgsize2size[size]<>tcgsize2size[OS_INT] then
  936. begin
  937. inherited a_op_const_reg_reg(list,op,size,a,src,dst);
  938. exit;
  939. end;
  940. { if we get here, we have to do a 32 bit calculation, guaranteed }
  941. case op of
  942. OP_DIV, OP_IDIV, OP_MUL, OP_AND, OP_OR, OP_XOR, OP_SHL, OP_SHR,
  943. OP_SAR:
  944. { can't do anything special for these }
  945. inherited a_op_const_reg_reg(list,op,size,a,src,dst);
  946. OP_IMUL:
  947. begin
  948. if not(cs_check_overflow in aktlocalswitches) and
  949. ispowerof2(int64(a),power) then
  950. { can be done with a shift }
  951. begin
  952. inherited a_op_const_reg_reg(list,op,size,a,src,dst);
  953. exit;
  954. end;
  955. list.concat(taicpu.op_const_reg_reg(A_IMUL,tcgsize2opsize[size],a,src,dst));
  956. end;
  957. OP_ADD, OP_SUB:
  958. if (a = 0) then
  959. a_load_reg_reg(list,size,size,src,dst)
  960. else
  961. begin
  962. reference_reset(tmpref);
  963. tmpref.base := src;
  964. tmpref.offset := longint(a);
  965. if op = OP_SUB then
  966. tmpref.offset := -tmpref.offset;
  967. list.concat(taicpu.op_ref_reg(A_LEA,tcgsize2opsize[size],tmpref,dst));
  968. end
  969. else internalerror(200112302);
  970. end;
  971. end;
  972. procedure tcgx86.a_op_reg_reg_reg(list: taasmoutput; op: TOpCg;size: tcgsize; src1, src2, dst: tregister);
  973. var
  974. tmpref: treference;
  975. begin
  976. check_register_size(size,src1);
  977. check_register_size(size,src2);
  978. check_register_size(size,dst);
  979. if tcgsize2size[size]<>tcgsize2size[OS_INT] then
  980. begin
  981. inherited a_op_reg_reg_reg(list,op,size,src1,src2,dst);
  982. exit;
  983. end;
  984. { if we get here, we have to do a 32 bit calculation, guaranteed }
  985. Case Op of
  986. OP_DIV, OP_IDIV, OP_MUL, OP_AND, OP_OR, OP_XOR, OP_SHL, OP_SHR,
  987. OP_SAR,OP_SUB,OP_NOT,OP_NEG:
  988. { can't do anything special for these }
  989. inherited a_op_reg_reg_reg(list,op,size,src1,src2,dst);
  990. OP_IMUL:
  991. list.concat(taicpu.op_reg_reg_reg(A_IMUL,tcgsize2opsize[size],src1,src2,dst));
  992. OP_ADD:
  993. begin
  994. reference_reset(tmpref);
  995. tmpref.base := src1;
  996. tmpref.index := src2;
  997. tmpref.scalefactor := 1;
  998. list.concat(taicpu.op_ref_reg(A_LEA,tcgsize2opsize[size],tmpref,dst));
  999. end
  1000. else internalerror(200112303);
  1001. end;
  1002. end;
  1003. {*************** compare instructructions ****************}
  1004. procedure tcgx86.a_cmp_const_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;a : aint;reg : tregister;
  1005. l : tasmlabel);
  1006. {$ifdef x86_64}
  1007. var
  1008. tmpreg : tregister;
  1009. {$endif x86_64}
  1010. begin
  1011. {$ifdef x86_64}
  1012. { x86_64 only supports signed 32 bits constants directly }
  1013. if (size in [OS_S64,OS_64]) and
  1014. ((a<low(longint)) or (a>high(longint))) then
  1015. begin
  1016. tmpreg:=getintregister(list,size);
  1017. a_load_const_reg(list,size,a,tmpreg);
  1018. a_cmp_reg_reg_label(list,size,cmp_op,tmpreg,reg,l);
  1019. exit;
  1020. end;
  1021. {$endif x86_64}
  1022. if (a = 0) then
  1023. list.concat(taicpu.op_reg_reg(A_TEST,tcgsize2opsize[size],reg,reg))
  1024. else
  1025. list.concat(taicpu.op_const_reg(A_CMP,tcgsize2opsize[size],a,reg));
  1026. a_jmp_cond(list,cmp_op,l);
  1027. end;
  1028. procedure tcgx86.a_cmp_const_ref_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;a : aint;const ref : treference;
  1029. l : tasmlabel);
  1030. {$ifdef x86_64}
  1031. var
  1032. tmpreg : tregister;
  1033. {$endif x86_64}
  1034. begin
  1035. {$ifdef x86_64}
  1036. { x86_64 only supports signed 32 bits constants directly }
  1037. if (size in [OS_S64,OS_64]) and
  1038. ((a<low(longint)) or (a>high(longint))) then
  1039. begin
  1040. tmpreg:=getintregister(list,size);
  1041. a_load_const_reg(list,size,a,tmpreg);
  1042. a_cmp_reg_ref_label(list,size,cmp_op,tmpreg,ref,l);
  1043. exit;
  1044. end;
  1045. {$endif x86_64}
  1046. list.concat(taicpu.op_const_ref(A_CMP,TCgSize2OpSize[size],a,ref));
  1047. a_jmp_cond(list,cmp_op,l);
  1048. end;
  1049. procedure tcgx86.a_cmp_reg_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;
  1050. reg1,reg2 : tregister;l : tasmlabel);
  1051. begin
  1052. check_register_size(size,reg1);
  1053. check_register_size(size,reg2);
  1054. list.concat(taicpu.op_reg_reg(A_CMP,TCgSize2OpSize[size],reg1,reg2));
  1055. a_jmp_cond(list,cmp_op,l);
  1056. end;
  1057. procedure tcgx86.a_cmp_ref_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;const ref: treference; reg : tregister;l : tasmlabel);
  1058. begin
  1059. check_register_size(size,reg);
  1060. list.concat(taicpu.op_ref_reg(A_CMP,TCgSize2OpSize[size],ref,reg));
  1061. a_jmp_cond(list,cmp_op,l);
  1062. end;
  1063. procedure tcgx86.a_cmp_reg_ref_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;reg : tregister;const ref: treference; l : tasmlabel);
  1064. begin
  1065. check_register_size(size,reg);
  1066. list.concat(taicpu.op_reg_ref(A_CMP,TCgSize2OpSize[size],reg,ref));
  1067. a_jmp_cond(list,cmp_op,l);
  1068. end;
  1069. procedure tcgx86.a_jmp_cond(list : taasmoutput;cond : TOpCmp;l: tasmlabel);
  1070. var
  1071. ai : taicpu;
  1072. begin
  1073. if cond=OC_None then
  1074. ai := Taicpu.Op_sym(A_JMP,S_NO,l)
  1075. else
  1076. begin
  1077. ai:=Taicpu.Op_sym(A_Jcc,S_NO,l);
  1078. ai.SetCondition(TOpCmp2AsmCond[cond]);
  1079. end;
  1080. ai.is_jmp:=true;
  1081. list.concat(ai);
  1082. end;
  1083. procedure tcgx86.a_jmp_flags(list : taasmoutput;const f : TResFlags;l: tasmlabel);
  1084. var
  1085. ai : taicpu;
  1086. begin
  1087. ai := Taicpu.op_sym(A_Jcc,S_NO,l);
  1088. ai.SetCondition(flags_to_cond(f));
  1089. ai.is_jmp := true;
  1090. list.concat(ai);
  1091. end;
  1092. procedure tcgx86.g_flags2reg(list: taasmoutput; size: TCgSize; const f: tresflags; reg: TRegister);
  1093. var
  1094. ai : taicpu;
  1095. hreg : tregister;
  1096. begin
  1097. hreg:=makeregsize(list,reg,OS_8);
  1098. ai:=Taicpu.op_reg(A_SETcc,S_B,hreg);
  1099. ai.setcondition(flags_to_cond(f));
  1100. list.concat(ai);
  1101. if (reg<>hreg) then
  1102. a_load_reg_reg(list,OS_8,size,hreg,reg);
  1103. end;
  1104. procedure tcgx86.g_flags2ref(list: taasmoutput; size: TCgSize; const f: tresflags; const ref: TReference);
  1105. var
  1106. ai : taicpu;
  1107. begin
  1108. if not(size in [OS_8,OS_S8]) then
  1109. a_load_const_ref(list,size,0,ref);
  1110. ai:=Taicpu.op_ref(A_SETcc,S_B,ref);
  1111. ai.setcondition(flags_to_cond(f));
  1112. list.concat(ai);
  1113. end;
  1114. { ************* concatcopy ************ }
  1115. procedure Tcgx86.g_concatcopy(list:Taasmoutput;const source,dest:Treference;len:aint);
  1116. const
  1117. {$ifdef cpu64bit}
  1118. REGCX=NR_RCX;
  1119. REGSI=NR_RSI;
  1120. REGDI=NR_RDI;
  1121. {$else cpu64bit}
  1122. REGCX=NR_ECX;
  1123. REGSI=NR_ESI;
  1124. REGDI=NR_EDI;
  1125. {$endif cpu64bit}
  1126. type copymode=(copy_move,copy_mmx,copy_string);
  1127. var srcref,dstref:Treference;
  1128. r,r0,r1,r2,r3:Tregister;
  1129. helpsize:aint;
  1130. copysize:byte;
  1131. cgsize:Tcgsize;
  1132. cm:copymode;
  1133. begin
  1134. cm:=copy_move;
  1135. helpsize:=12;
  1136. if cs_littlesize in aktglobalswitches then
  1137. helpsize:=8;
  1138. if (cs_mmx in aktlocalswitches) and
  1139. not(pi_uses_fpu in current_procinfo.flags) and
  1140. ((len=8) or (len=16) or (len=24) or (len=32)) then
  1141. cm:=copy_mmx;
  1142. if (len>helpsize) then
  1143. cm:=copy_string;
  1144. if (cs_littlesize in aktglobalswitches) and
  1145. not((len<=16) and (cm=copy_mmx)) then
  1146. cm:=copy_string;
  1147. case cm of
  1148. copy_move:
  1149. begin
  1150. dstref:=dest;
  1151. srcref:=source;
  1152. copysize:=sizeof(aint);
  1153. cgsize:=int_cgsize(copysize);
  1154. while len<>0 do
  1155. begin
  1156. if len<2 then
  1157. begin
  1158. copysize:=1;
  1159. cgsize:=OS_8;
  1160. end
  1161. else if len<4 then
  1162. begin
  1163. copysize:=2;
  1164. cgsize:=OS_16;
  1165. end
  1166. else if len<8 then
  1167. begin
  1168. copysize:=4;
  1169. cgsize:=OS_32;
  1170. end;
  1171. dec(len,copysize);
  1172. r:=getintregister(list,cgsize);
  1173. a_load_ref_reg(list,cgsize,cgsize,srcref,r);
  1174. a_load_reg_ref(list,cgsize,cgsize,r,dstref);
  1175. inc(srcref.offset,copysize);
  1176. inc(dstref.offset,copysize);
  1177. end;
  1178. end;
  1179. copy_mmx:
  1180. begin
  1181. dstref:=dest;
  1182. srcref:=source;
  1183. r0:=getmmxregister(list);
  1184. a_loadmm_ref_reg(list,OS_M64,OS_M64,srcref,r0,nil);
  1185. if len>=16 then
  1186. begin
  1187. inc(srcref.offset,8);
  1188. r1:=getmmxregister(list);
  1189. a_loadmm_ref_reg(list,OS_M64,OS_M64,srcref,r1,nil);
  1190. end;
  1191. if len>=24 then
  1192. begin
  1193. inc(srcref.offset,8);
  1194. r2:=getmmxregister(list);
  1195. a_loadmm_ref_reg(list,OS_M64,OS_M64,srcref,r2,nil);
  1196. end;
  1197. if len>=32 then
  1198. begin
  1199. inc(srcref.offset,8);
  1200. r3:=getmmxregister(list);
  1201. a_loadmm_ref_reg(list,OS_M64,OS_M64,srcref,r3,nil);
  1202. end;
  1203. a_loadmm_reg_ref(list,OS_M64,OS_M64,r0,dstref,nil);
  1204. if len>=16 then
  1205. begin
  1206. inc(dstref.offset,8);
  1207. a_loadmm_reg_ref(list,OS_M64,OS_M64,r1,dstref,nil);
  1208. end;
  1209. if len>=24 then
  1210. begin
  1211. inc(dstref.offset,8);
  1212. a_loadmm_reg_ref(list,OS_M64,OS_M64,r2,dstref,nil);
  1213. end;
  1214. if len>=32 then
  1215. begin
  1216. inc(dstref.offset,8);
  1217. a_loadmm_reg_ref(list,OS_M64,OS_M64,r3,dstref,nil);
  1218. end;
  1219. end
  1220. else {copy_string, should be a good fallback in case of unhandled}
  1221. begin
  1222. getcpuregister(list,REGDI);
  1223. a_loadaddr_ref_reg(list,dest,REGDI);
  1224. getcpuregister(list,REGSI);
  1225. a_loadaddr_ref_reg(list,source,REGSI);
  1226. getcpuregister(list,REGCX);
  1227. list.concat(Taicpu.op_none(A_CLD,S_NO));
  1228. if cs_littlesize in aktglobalswitches then
  1229. begin
  1230. a_load_const_reg(list,OS_INT,len,REGCX);
  1231. list.concat(Taicpu.op_none(A_REP,S_NO));
  1232. list.concat(Taicpu.op_none(A_MOVSB,S_NO));
  1233. end
  1234. else
  1235. begin
  1236. helpsize:=len div sizeof(aint);
  1237. len:=len mod sizeof(aint);
  1238. if helpsize>1 then
  1239. begin
  1240. a_load_const_reg(list,OS_INT,helpsize,REGCX);
  1241. list.concat(Taicpu.op_none(A_REP,S_NO));
  1242. end;
  1243. if helpsize>0 then
  1244. begin
  1245. {$ifdef cpu64bit}
  1246. if sizeof(aint)=8 then
  1247. list.concat(Taicpu.op_none(A_MOVSQ,S_NO))
  1248. else
  1249. {$endif cpu64bit}
  1250. list.concat(Taicpu.op_none(A_MOVSD,S_NO));
  1251. end;
  1252. if len>=4 then
  1253. begin
  1254. dec(len,4);
  1255. list.concat(Taicpu.op_none(A_MOVSD,S_NO));
  1256. end;
  1257. if len>=2 then
  1258. begin
  1259. dec(len,2);
  1260. list.concat(Taicpu.op_none(A_MOVSW,S_NO));
  1261. end;
  1262. if len=1 then
  1263. list.concat(Taicpu.op_none(A_MOVSB,S_NO));
  1264. end;
  1265. ungetcpuregister(list,REGCX);
  1266. ungetcpuregister(list,REGSI);
  1267. ungetcpuregister(list,REGDI);
  1268. end;
  1269. end;
  1270. end;
  1271. {****************************************************************************
  1272. Entry/Exit Code Helpers
  1273. ****************************************************************************}
  1274. procedure tcgx86.g_releasevaluepara_openarray(list : taasmoutput;const ref:treference);
  1275. begin
  1276. { Nothing to release }
  1277. end;
  1278. procedure tcgx86.g_profilecode(list : taasmoutput);
  1279. var
  1280. pl : tasmlabel;
  1281. mcountprefix : String[4];
  1282. begin
  1283. case target_info.system of
  1284. {$ifndef NOTARGETWIN32}
  1285. system_i386_win32,
  1286. {$endif}
  1287. system_i386_freebsd,
  1288. system_i386_netbsd,
  1289. // system_i386_openbsd,
  1290. system_i386_wdosx :
  1291. begin
  1292. Case target_info.system Of
  1293. system_i386_freebsd : mcountprefix:='.';
  1294. system_i386_netbsd : mcountprefix:='__';
  1295. // system_i386_openbsd : mcountprefix:='.';
  1296. else
  1297. mcountPrefix:='';
  1298. end;
  1299. objectlibrary.getaddrlabel(pl);
  1300. new_section(list,sec_data,lower(current_procinfo.procdef.mangledname),sizeof(aint));
  1301. list.concat(Tai_label.Create(pl));
  1302. list.concat(Tai_const.Create_32bit(0));
  1303. new_section(list,sec_code,lower(current_procinfo.procdef.mangledname),0);
  1304. list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EDX));
  1305. list.concat(Taicpu.Op_sym_ofs_reg(A_MOV,S_L,pl,0,NR_EDX));
  1306. a_call_name(list,target_info.Cprefix+mcountprefix+'mcount');
  1307. list.concat(Taicpu.Op_reg(A_POP,S_L,NR_EDX));
  1308. end;
  1309. system_i386_linux:
  1310. a_call_name(list,target_info.Cprefix+'mcount');
  1311. system_i386_go32v2,system_i386_watcom:
  1312. begin
  1313. a_call_name(list,'MCOUNT');
  1314. end;
  1315. end;
  1316. end;
  1317. procedure tcgx86.g_stackpointer_alloc(list : taasmoutput;localsize : longint);
  1318. {$ifdef i386}
  1319. {$ifndef NOTARGETWIN32}
  1320. var
  1321. href : treference;
  1322. i : integer;
  1323. again : tasmlabel;
  1324. {$endif NOTARGETWIN32}
  1325. {$endif i386}
  1326. begin
  1327. if localsize>0 then
  1328. begin
  1329. {$ifdef i386}
  1330. {$ifndef NOTARGETWIN32}
  1331. { windows guards only a few pages for stack growing, }
  1332. { so we have to access every page first }
  1333. if (target_info.system=system_i386_win32) and
  1334. (localsize>=winstackpagesize) then
  1335. begin
  1336. if localsize div winstackpagesize<=5 then
  1337. begin
  1338. list.concat(Taicpu.Op_const_reg(A_SUB,S_L,localsize-4,NR_ESP));
  1339. for i:=1 to localsize div winstackpagesize do
  1340. begin
  1341. reference_reset_base(href,NR_ESP,localsize-i*winstackpagesize);
  1342. list.concat(Taicpu.op_const_ref(A_MOV,S_L,0,href));
  1343. end;
  1344. list.concat(Taicpu.op_reg(A_PUSH,S_L,NR_EAX));
  1345. end
  1346. else
  1347. begin
  1348. objectlibrary.getlabel(again);
  1349. getcpuregister(list,NR_EDI);
  1350. list.concat(Taicpu.op_const_reg(A_MOV,S_L,localsize div winstackpagesize,NR_EDI));
  1351. a_label(list,again);
  1352. list.concat(Taicpu.op_const_reg(A_SUB,S_L,winstackpagesize-4,NR_ESP));
  1353. list.concat(Taicpu.op_reg(A_PUSH,S_L,NR_EAX));
  1354. list.concat(Taicpu.op_reg(A_DEC,S_L,NR_EDI));
  1355. a_jmp_cond(list,OC_NE,again);
  1356. ungetcpuregister(list,NR_EDI);
  1357. list.concat(Taicpu.op_const_reg(A_SUB,S_L,localsize mod winstackpagesize,NR_ESP));
  1358. end
  1359. end
  1360. else
  1361. {$endif NOTARGETWIN32}
  1362. {$endif i386}
  1363. list.concat(Taicpu.Op_const_reg(A_SUB,tcgsize2opsize[OS_ADDR],localsize,NR_STACK_POINTER_REG));
  1364. end;
  1365. end;
  1366. procedure tcgx86.g_proc_entry(list : taasmoutput;localsize : longint;nostackframe:boolean);
  1367. begin
  1368. {$ifdef i386}
  1369. { interrupt support for i386 }
  1370. if (po_interrupt in current_procinfo.procdef.procoptions) then
  1371. begin
  1372. { .... also the segment registers }
  1373. list.concat(Taicpu.Op_reg(A_PUSH,S_W,NR_GS));
  1374. list.concat(Taicpu.Op_reg(A_PUSH,S_W,NR_FS));
  1375. list.concat(Taicpu.Op_reg(A_PUSH,S_W,NR_ES));
  1376. list.concat(Taicpu.Op_reg(A_PUSH,S_W,NR_DS));
  1377. { save the registers of an interrupt procedure }
  1378. list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EDI));
  1379. list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_ESI));
  1380. list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EDX));
  1381. list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_ECX));
  1382. list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EBX));
  1383. list.concat(Taicpu.Op_reg(A_PUSH,S_L,NR_EAX));
  1384. end;
  1385. {$endif i386}
  1386. { save old framepointer }
  1387. if not nostackframe then
  1388. begin
  1389. if (current_procinfo.framepointer=NR_STACK_POINTER_REG) then
  1390. CGmessage(cg_d_stackframe_omited)
  1391. else
  1392. begin
  1393. list.concat(tai_regalloc.alloc(NR_FRAME_POINTER_REG,nil));
  1394. include(rg[R_INTREGISTER].preserved_by_proc,RS_FRAME_POINTER_REG);
  1395. list.concat(Taicpu.op_reg(A_PUSH,tcgsize2opsize[OS_ADDR],NR_FRAME_POINTER_REG));
  1396. { Return address and FP are both on stack }
  1397. dwarfcfi.cfa_def_cfa_offset(list,2*sizeof(aint));
  1398. dwarfcfi.cfa_offset(list,NR_FRAME_POINTER_REG,-(2*sizeof(aint)));
  1399. list.concat(Taicpu.op_reg_reg(A_MOV,tcgsize2opsize[OS_ADDR],NR_STACK_POINTER_REG,NR_FRAME_POINTER_REG));
  1400. dwarfcfi.cfa_def_cfa_register(list,NR_FRAME_POINTER_REG);
  1401. end;
  1402. { allocate stackframe space }
  1403. if localsize<>0 then
  1404. begin
  1405. cg.g_stackpointer_alloc(list,localsize);
  1406. end;
  1407. end;
  1408. { allocate PIC register }
  1409. if cs_create_pic in aktmoduleswitches then
  1410. begin
  1411. a_call_name(list,'FPC_GETEIPINEBX');
  1412. list.concat(taicpu.op_sym_ofs_reg(A_ADD,tcgsize2opsize[OS_ADDR],objectlibrary.newasmsymbol('_GLOBAL_OFFSET_TABLE_',AB_EXTERNAL,AT_DATA),0,NR_PIC_OFFSET_REG));
  1413. list.concat(tai_regalloc.alloc(NR_PIC_OFFSET_REG,nil));
  1414. end;
  1415. end;
  1416. { produces if necessary overflowcode }
  1417. procedure tcgx86.g_overflowcheck(list: taasmoutput; const l:tlocation;def:tdef);
  1418. var
  1419. hl : tasmlabel;
  1420. ai : taicpu;
  1421. cond : TAsmCond;
  1422. begin
  1423. if not(cs_check_overflow in aktlocalswitches) then
  1424. exit;
  1425. objectlibrary.getlabel(hl);
  1426. if not ((def.deftype=pointerdef) or
  1427. ((def.deftype=orddef) and
  1428. (torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,
  1429. bool8bit,bool16bit,bool32bit]))) then
  1430. cond:=C_NO
  1431. else
  1432. cond:=C_NB;
  1433. ai:=Taicpu.Op_Sym(A_Jcc,S_NO,hl);
  1434. ai.SetCondition(cond);
  1435. ai.is_jmp:=true;
  1436. list.concat(ai);
  1437. a_call_name(list,'FPC_OVERFLOW');
  1438. a_label(list,hl);
  1439. end;
  1440. end.
  1441. {
  1442. $Log$
  1443. Revision 1.133 2004-10-31 21:45:04 peter
  1444. * generic tlocation
  1445. * move tlocation to cgutils
  1446. Revision 1.132 2004/10/25 15:36:47 peter
  1447. * save standard registers moved to tcgobj
  1448. Revision 1.131 2004/10/24 20:10:08 peter
  1449. * -Or fixes
  1450. Revision 1.130 2004/10/24 11:44:28 peter
  1451. * small regvar fixes
  1452. * loadref parameter removed from concatcopy,incrrefcount,etc
  1453. Revision 1.129 2004/10/06 19:27:35 jonas
  1454. * regvar fixes from Peter
  1455. Revision 1.128 2004/10/05 20:41:02 peter
  1456. * more spilling rewrites
  1457. Revision 1.127 2004/10/04 20:46:22 peter
  1458. * spilling code rewritten for x86. It now used the generic
  1459. spilling routines. Special x86 optimization still needs
  1460. to be added.
  1461. * Spilling fixed when both operands needed to be spilled
  1462. * Cleanup of spilling routine, do_spill_readwritten removed
  1463. Revision 1.126 2004/10/03 12:42:22 florian
  1464. * made sqrt, sqr and abs internal for the sparc
  1465. Revision 1.125 2004/09/25 14:23:55 peter
  1466. * ungetregister is now only used for cpuregisters, renamed to
  1467. ungetcpuregister
  1468. * renamed (get|unget)explicitregister(s) to ..cpuregister
  1469. * removed location-release/reference_release
  1470. Revision 1.124 2004/06/20 08:55:32 florian
  1471. * logs truncated
  1472. Revision 1.123 2004/06/16 20:07:11 florian
  1473. * dwarf branch merged
  1474. Revision 1.122 2004/05/22 23:34:28 peter
  1475. tai_regalloc.allocation changed to ratype to notify rgobj of register size changes
  1476. Revision 1.121 2004/04/28 15:19:03 florian
  1477. + syscall directive support for MorphOS added
  1478. Revision 1.120 2004/04/09 14:36:05 peter
  1479. * A_MOVSL renamed to A_MOVSD
  1480. Revision 1.119.2.22 2004/05/28 20:29:50 florian
  1481. * fixed currency trouble on x86-64
  1482. }