aasmcpu.pas 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Implements the assembler classes specific for the Alpha
  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. {
  19. Implements the assembler classes specific for the Alpha.
  20. }
  21. unit aasmcpu;
  22. {$i fpcdefs.inc}
  23. interface
  24. uses
  25. aasmbase,globals,verbose,
  26. cpubase,aasmtai;
  27. type
  28. tai_frame = class(tai)
  29. G,R : TRegister;
  30. LS,LU : longint;
  31. Constructor Create (GP : Tregister; Localsize : Longint; RA : TRegister; L : longint);
  32. end;
  33. tai_ent = class(tai)
  34. Name : string;
  35. Constructor Create (const ProcName : String);
  36. end;
  37. taicpu = class(taicpu_abstract)
  38. constructor op_none(op : tasmop);
  39. constructor op_reg(op : tasmop;_op1 : tregister);
  40. constructor op_const(op : tasmop;_op1 : longint);
  41. constructor op_ref(op : tasmop;_op1 : preference);
  42. constructor op_reg_reg(op : tasmop;_op1,_op2 : tregister);
  43. constructor op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
  44. constructor op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
  45. constructor op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
  46. constructor op_const_const(op : tasmop;_op1,_op2 : longint);
  47. constructor op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
  48. constructor op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
  49. { this is only allowed if _op1 is an int value (_op1^.isintvalue=true) }
  50. constructor op_ref_ref(op : tasmop;_op1,_op2 : preference);
  51. constructor op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
  52. constructor op_reg_const_reg(op : tasmop;_op1 : tregister;_op2 : longint;_op3 : tregister);
  53. constructor op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
  54. constructor op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister; _op3 : preference);
  55. constructor op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
  56. constructor op_reg_ref_const(op : tasmop;_op1 : tregister;_op2 : preference;_op3 : longint);
  57. { this is for Jmp instructions }
  58. constructor op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : tasmsymbol);
  59. constructor op_sym(op : tasmop;_op1 : tasmsymbol);
  60. constructor op_sym_ofs(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint);
  61. constructor op_sym_ofs_reg(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
  62. constructor op_sym_ofs_ref(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : preference);
  63. end;
  64. tai_align = class(tai_align_abstract)
  65. { nothing to add }
  66. end;
  67. procedure InitAsm;
  68. procedure DoneAsm;
  69. implementation
  70. {*****************************************************************************
  71. taicpu Constructors
  72. *****************************************************************************}
  73. constructor taicpu.op_none(op : tasmop);
  74. begin
  75. inherited create(op);
  76. end;
  77. constructor taicpu.op_reg(op : tasmop;_op1 : tregister);
  78. begin
  79. inherited create(op);
  80. ops:=1;
  81. end;
  82. constructor taicpu.op_const(op : tasmop;_op1 : longint);
  83. begin
  84. inherited create(op);
  85. ops:=1;
  86. end;
  87. constructor taicpu.op_ref(op : tasmop;_op1 : preference);
  88. begin
  89. inherited create(op);
  90. ops:=1;
  91. end;
  92. constructor taicpu.op_reg_reg(op : tasmop;_op1,_op2 : tregister);
  93. begin
  94. inherited create(op);
  95. ops:=2;
  96. end;
  97. constructor taicpu.op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
  98. begin
  99. inherited create(op);
  100. ops:=2;
  101. end;
  102. constructor taicpu.op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
  103. begin
  104. inherited create(op);
  105. ops:=2;
  106. end;
  107. constructor taicpu.op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
  108. begin
  109. inherited create(op);
  110. ops:=2;
  111. end;
  112. constructor taicpu.op_const_const(op : tasmop;_op1,_op2 : longint);
  113. begin
  114. inherited create(op);
  115. ops:=2;
  116. end;
  117. constructor taicpu.op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
  118. begin
  119. inherited create(op);
  120. ops:=2;
  121. end;
  122. constructor taicpu.op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
  123. begin
  124. inherited create(op);
  125. ops:=2;
  126. end;
  127. constructor taicpu.op_ref_ref(op : tasmop;_op1,_op2 : preference);
  128. begin
  129. inherited create(op);
  130. ops:=2;
  131. end;
  132. constructor taicpu.op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
  133. begin
  134. inherited create(op);
  135. ops:=3;
  136. end;
  137. constructor taicpu.op_reg_const_reg(op : tasmop;_op1 : tregister;_op2 : longint;_op3 : tregister);
  138. begin
  139. inherited create(op);
  140. ops:=3;
  141. end;
  142. constructor taicpu.op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister;_op3 : preference);
  143. begin
  144. inherited create(op);
  145. ops:=3;
  146. end;
  147. constructor taicpu.op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
  148. begin
  149. inherited create(op);
  150. ops:=3;
  151. end;
  152. constructor taicpu.op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
  153. begin
  154. inherited create(op);
  155. ops:=3;
  156. end;
  157. constructor taicpu.op_reg_ref_const(op : tasmop;_op1 : tregister;_op2 : preference;_op3 : longint);
  158. begin
  159. inherited create(op);
  160. ops:=3;
  161. end;
  162. constructor taicpu.op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : tasmsymbol);
  163. begin
  164. inherited create(op);
  165. condition:=cond;
  166. ops:=1;
  167. end;
  168. constructor taicpu.op_sym(op : tasmop;_op1 : tasmsymbol);
  169. begin
  170. inherited create(op);
  171. ops:=1;
  172. end;
  173. constructor taicpu.op_sym_ofs(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint);
  174. begin
  175. inherited create(op);
  176. ops:=1;
  177. end;
  178. constructor taicpu.op_sym_ofs_reg(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
  179. begin
  180. inherited create(op);
  181. ops:=2;
  182. end;
  183. constructor taicpu.op_sym_ofs_ref(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : preference);
  184. begin
  185. inherited create(op);
  186. ops:=2;
  187. end;
  188. Constructor tai_frame.create (GP : Tregister; Localsize : Longint; RA : TRegister; L : longint);
  189. begin
  190. Inherited Create;
  191. typ:=ait_frame;
  192. G:=GP;
  193. R:=RA;
  194. LS:=LocalSize;
  195. LU:=L;
  196. end;
  197. Constructor tai_ent.Create (const ProcName : String);
  198. begin
  199. Inherited Create;
  200. typ:=ait_ent;
  201. Name:=ProcName;
  202. end;
  203. procedure InitAsm;
  204. begin
  205. end;
  206. procedure DoneAsm;
  207. begin
  208. end;
  209. end.
  210. {
  211. $Log$
  212. Revision 1.3 2002-09-29 23:54:12 florian
  213. * alpha compiles again, changes to common code not yet commited
  214. Revision 1.2 2002/09/29 23:42:45 florian
  215. * several fixes to get forward with alpha compilation
  216. Revision 1.1 2002/09/29 22:34:17 florian
  217. * cpuasm renamed to aasmcpu
  218. Revision 1.2 2002/09/07 15:25:10 peter
  219. * old logs removed and tabs fixed
  220. Revision 1.1 2002/08/18 09:06:54 florian
  221. * alpha files moved compiler/alpha
  222. }