cg64f64.pas 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. {
  2. $Id$
  3. Copyright (c) 2002 by Florian Klaempfl
  4. Member of the Free Pascal development team
  5. This unit implements the code generation for 64 bit int
  6. arithmethics on 64 bit processors
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************
  19. }
  20. {# This unit implements the code generation for 64 bit int arithmethics on
  21. 64 bit processors.
  22. }
  23. unit cg64f64;
  24. {$i fpcdefs.inc}
  25. interface
  26. uses
  27. aasm,
  28. cpuinfo, cpubase,
  29. cginfo, cgobj,
  30. node,symtype;
  31. type
  32. {# Defines all the methods required on 32-bit processors
  33. to handle 64-bit integers.
  34. }
  35. tcg64f32 = class(tcg64)
  36. procedure a_load64_const_ref(list : taasmoutput;valuelo, valuehi : AWord;const ref : treference);override;
  37. procedure a_load64_reg_ref(list : taasmoutput;reglo, reghi : tregister;const ref : treference);override;
  38. procedure a_load64_ref_reg(list : taasmoutput;const ref : treference;reglo,reghi : tregister);override;
  39. procedure a_load64_reg_reg(list : taasmoutput;reglosrc,reghisrc,reglodst,reghidst : tregister);override;
  40. procedure a_load64_const_reg(list : taasmoutput;valuelosrc,valuehisrc:AWord;reglodst,reghidst : tregister);override;
  41. procedure a_load64_loc_reg(list : taasmoutput;const l : tlocation;reglo,reghi : tregister);override;
  42. procedure a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);override;
  43. procedure a_load64_const_loc(list : taasmoutput;valuelo, valuehi : AWord;const l : tlocation);override;
  44. procedure a_load64_reg_loc(list : taasmoutput;reglo, reghi : tregister;const l : tlocation);override;
  45. procedure a_load64high_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);override;
  46. procedure a_load64low_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);override;
  47. procedure a_load64high_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);override;
  48. procedure a_load64low_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);override;
  49. procedure a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
  50. procedure a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
  51. procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;valuelosrc,valuehisrc:aword;const l: tlocation);override;
  52. procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reglo,reghi : tregister;const l : tlocation);override;
  53. procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reglo,reghi : tregister);override;
  54. procedure a_param64_reg(list : taasmoutput;reglo,reghi : tregister;nr : longint);override;
  55. procedure a_param64_const(list : taasmoutput;valuelo,valuehi : aword;nr : longint);override;
  56. procedure a_param64_ref(list : taasmoutput;const r : treference;nr : longint);override;
  57. procedure a_param64_loc(list : taasmoutput;const l : tlocation;nr : longint);override;
  58. { override to catch 64bit rangechecks }
  59. procedure g_rangecheck(list: taasmoutput; const p: tnode;
  60. const todef: tdef); override;
  61. end;
  62. implementation
  63. procedure tcg64f64.a_load64_const_ref(list : taasmoutput;value : qword;const ref : treference);
  64. begin
  65. cg.a_load_const_ref(list,OS_64,value,ref);
  66. end;
  67. procedure tcg64f64.a_load64_reg_ref(list : taasmoutput;reg : tregister64;const ref : treference);
  68. begin
  69. cg.a_load_const_ref(list,OS_64,reg,ref);
  70. end;
  71. procedure tcg64f64.a_load64_ref_reg(list : taasmoutput;const ref : treference;reg : tregister64);
  72. begin
  73. cg.a_load_ref_ref(list,OS_64,ref,reg);
  74. end;
  75. procedure tcg64f64.a_load64_reg_reg(list : taasmoutput;regsrc,regdst : tregister64);
  76. begin
  77. cg.a_load_reg_reg(list,OS_64,regsrc,regdst);
  78. end;
  79. procedure tcg64f64.a_load64_const_reg(list : taasmoutput;value : qword;reg : tregister64);
  80. begin
  81. cg.a_load_const_reg(list,OS_64,value,reg);
  82. end;
  83. procedure tcg64f64.a_load64_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister64);
  84. begin
  85. cg.a_load_loc_reg(list,l,reg);
  86. end;
  87. procedure tcg64f64.a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);
  88. begin
  89. cg.a_load_loc_ref(list,OS_64,l,ref);
  90. end;
  91. procedure tcg64f64.a_load64_const_loc(list : taasmoutput;value : qword;const l : tlocation);
  92. begin
  93. cg.a_load_const_loc(list,value,l);
  94. end;
  95. procedure tcg64f64.a_load64_reg_loc(list : taasmoutput;reg : tregister64;const l : tlocation);
  96. begin
  97. cg.a_load_reg_loc(list,reg,l);
  98. end;
  99. procedure a_op64_ref_reg(list : taasmoutput;op:TOpCG;const ref : treference;reglo,reg : tregister64);
  100. begin
  101. cg.a_op_ref_reg(list,
  102. end;
  103. procedure a_op64_reg_reg(list : taasmoutput;op:TOpCG;regsrc,regdst : tregister64);
  104. begin
  105. end;
  106. procedure a_op64_reg_ref(list : taasmoutput;op:TOpCG;regsrc : tregister64;const ref : treference);
  107. begin
  108. end;
  109. procedure a_op64_const_reg(list : taasmoutput;op:TOpCG;value : qword;regdst : tregister64);
  110. begin
  111. end;
  112. procedure a_op64_const_ref(list : taasmoutput;op:TOpCG;value : qword;const ref : treference);
  113. begin
  114. end;
  115. procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;value : qword;const l: tlocation);
  116. begin
  117. end;
  118. procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reg : tregister64;const l : tlocation);
  119. begin
  120. end;
  121. procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reg64 : tregister64);
  122. begin
  123. end;
  124. procedure a_param64_reg(list : taasmoutput;reg64 : tregister;nr : longint);
  125. begin
  126. end;
  127. procedure a_param64_const(list : taasmoutput;value : qword;nr : longint);
  128. begin
  129. end;
  130. procedure a_param64_ref(list : taasmoutput;const r : treference;nr : longint);
  131. begin
  132. end;
  133. procedure a_param64_loc(list : taasmoutput;const l : tlocation;nr : longint);
  134. begin
  135. end;
  136. procedure g_rangecheck64(list: taasmoutput; const p: tnode;
  137. const todef: tdef);
  138. begin
  139. end;
  140. end.
  141. {
  142. $Log$
  143. Revision 1.2 2002-07-01 16:23:52 peter
  144. * cg64 patch
  145. * basics for currency
  146. * asnode updates for class and interface (not finished)
  147. Revision 1.1 2002/06/08 19:36:54 florian
  148. * initial release
  149. }