cgcpu.pas 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. This unit implements the code generator for the DEC 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. unit cgcpu;
  19. interface
  20. uses
  21. cgobj,aasm,cpuasm,cpubase;
  22. type
  23. pcgalpha = ^tcgalpha;
  24. tcgalpha = object(tcg)
  25. procedure a_push_reg(list : paasmoutput;r : tregister);virtual;
  26. procedure a_call_name(list : paasmoutput;const s : string;
  27. offset : longint);virtual;
  28. procedure a_load_const8_ref(list : paasmoutput;b : byte;const ref : treference);virtual;
  29. procedure a_load_const16_ref(list : paasmoutput;w : word;const ref : treference);virtual;
  30. procedure a_load_const32_ref(list : paasmoutput;l : longint;const ref : treference);virtual;
  31. procedure a_load_const64_ref(list : paasmoutput;q : qword;const ref : treference);virtual;
  32. procedure g_stackframe_entry(list : paasmoutput;localsize : longint);virtual;
  33. constructor init;
  34. end;
  35. implementation
  36. uses
  37. globtype,globals;
  38. constructor tcgalpha.init;
  39. begin
  40. inherited init;
  41. end;
  42. procedure tcgalpha.g_stackframe_entry(list : paasmoutput;localsize : longint);
  43. begin
  44. {
  45. if localsize<>0 then
  46. begin
  47. if (cs_littlesize in aktglobalswitches) and (localsize<=65535) then
  48. list^.insert(new(pai386,op_const_const(A_ENTER,S_NO,localsize,0)))
  49. else
  50. begin
  51. list^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBP)));
  52. list^.concat(new(pai386,op_reg_reg(A_MOV,S_L,R_ESP,R_EBP)));
  53. list^.concat(new(pai386,op_const_reg(A_SUB,S_L,localsize,R_ESP)));
  54. end;
  55. end
  56. else
  57. begin
  58. list^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBP)));
  59. list^.concat(new(pai386,op_reg_reg(A_MOV,S_L,R_ESP,R_EBP)));
  60. end;
  61. }
  62. abstract;
  63. end;
  64. procedure tcgalpha.a_call_name(list : paasmoutput;const s : string;
  65. offset : longint);
  66. begin
  67. { list^.concat(new(pai386,op_sym(A_CALL,S_NO,newasmsymbol(s)))); }
  68. {!!!!!!!!!1 offset is ignored }
  69. abstract;
  70. end;
  71. procedure tcgalpha.a_push_reg(list : paasmoutput;r : tregister);
  72. begin
  73. { list^.concat(new(pai386,op_reg(A_PUSH,regsize(r),r))); }
  74. abstract;
  75. end;
  76. procedure tcgalpha.a_load_const8_ref(list : paasmoutput;b : byte;const ref : treference);
  77. begin
  78. abstract;
  79. end;
  80. procedure tcgalpha.a_load_const16_ref(list : paasmoutput;w : word;const ref : treference);
  81. begin
  82. abstract;
  83. end;
  84. procedure tcgalpha.a_load_const32_ref(list : paasmoutput;l : longint;const ref : treference);
  85. begin
  86. abstract;
  87. end;
  88. procedure tcgalpha.a_load_const64_ref(list : paasmoutput;q : qword;const ref : treference);
  89. begin
  90. abstract;
  91. end;
  92. end.
  93. {
  94. $Log$
  95. Revision 1.2 1999-08-04 00:24:00 florian
  96. * renamed i386asm and i386base to cpuasm and cpubase
  97. Revision 1.1 1999/08/03 22:39:46 florian
  98. * initial revision
  99. Revision 1.2 1999/08/01 23:19:59 florian
  100. + make a new makefile using the old compiler makefile
  101. Revision 1.1 1999/08/01 23:11:24 florian
  102. + renamed ot tp cgcpu.pas
  103. Revision 1.1 1999/08/01 22:08:26 florian
  104. * reorganisation of directory structure
  105. Revision 1.3 1999/08/01 18:22:31 florian
  106. * made it again compilable
  107. Revision 1.2 1999/01/23 23:29:43 florian
  108. * first running version of the new code generator
  109. * when compiling exceptions under Linux fixed
  110. Revision 1.1 1998/12/15 22:17:02 florian
  111. * first version
  112. }