cpuswtch.pas 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
  4. interprets the commandline options which are powerpc specific
  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 cpuswtch;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. options;
  23. type
  24. toptionpowerpc=class(toption)
  25. procedure interpret_proc_specific_options(const opt:string);override;
  26. end;
  27. implementation
  28. uses
  29. cutils,globtype,systems,globals;
  30. procedure toptionpowerpc.interpret_proc_specific_options(const opt:string);
  31. begin
  32. {$ifdef dummy}
  33. More:=Upper(copy(opt,3,length(opt)-2));
  34. case opt[2] of
  35. 'O' : Begin
  36. j := 3;
  37. While (j <= Length(Opt)) Do
  38. Begin
  39. case opt[j] of
  40. '-' :
  41. begin
  42. initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
  43. cs_regalloc,cs_uncertainopts];
  44. FillChar(ParaAlignment,sizeof(ParaAlignment),0);
  45. end;
  46. 'a' :
  47. begin
  48. UpdateAlignmentStr(Copy(Opt,j+1,255),ParaAlignment);
  49. j:=length(Opt);
  50. end;
  51. 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
  52. 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
  53. 'r' :
  54. begin
  55. initglobalswitches:=initglobalswitches+[cs_regalloc];
  56. Simplify_ppu:=false;
  57. end;
  58. 'u' : initglobalswitches:=initglobalswitches+[cs_uncertainopts];
  59. '1' : initglobalswitches:=initglobalswitches-[cs_fastoptimize,cs_slowoptimize]+[cs_optimize];
  60. '2' : initglobalswitches:=initglobalswitches-[cs_slowoptimize]+[cs_optimize,cs_fastoptimize];
  61. '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
  62. 'p' :
  63. Begin
  64. If j < Length(Opt) Then
  65. Begin
  66. Case opt[j+1] Of
  67. '1': initoptprocessor := Class386;
  68. '2': initoptprocessor := ClassP5;
  69. '3': initoptprocessor := ClassP6
  70. Else IllegalPara(Opt)
  71. End;
  72. Inc(j);
  73. End
  74. Else IllegalPara(opt)
  75. End;
  76. {$ifdef USECMOV}
  77. 's' :
  78. Begin
  79. If j < Length(Opt) Then
  80. Begin
  81. Case opt[j+1] Of
  82. '3': initspecificoptprocessor:=ClassP6
  83. Else IllegalPara(Opt)
  84. End;
  85. Inc(j);
  86. End
  87. Else IllegalPara(opt)
  88. End
  89. {$endif USECMOV}
  90. else IllegalPara(opt);
  91. End;
  92. Inc(j)
  93. end;
  94. end;
  95. 'R' : begin
  96. if More='ATT' then
  97. initasmmode:=asmmode_i386_att
  98. else
  99. if More='INTEL' then
  100. initasmmode:=asmmode_i386_intel
  101. else
  102. if More='DIRECT' then
  103. initasmmode:=asmmode_i386_direct
  104. else
  105. IllegalPara(opt);
  106. end;
  107. else
  108. IllegalPara(opt);
  109. end;
  110. {$endif dummy}
  111. end;
  112. initialization
  113. coption:=toptionpowerpc;
  114. end.
  115. {
  116. $Log$
  117. Revision 1.3 2002-05-16 19:46:53 carl
  118. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  119. + try to fix temp allocation (still in ifdef)
  120. + generic constructor calls
  121. + start of tassembler / tmodulebase class cleanup
  122. Revision 1.1 2002/05/13 19:52:46 peter
  123. * a ppcppc can be build again
  124. Revision 1.4 2001/07/01 20:16:20 peter
  125. * alignmentinfo record added
  126. * -Oa argument supports more alignment settings that can be specified
  127. per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
  128. RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
  129. required alignment and the maximum usefull alignment. The final
  130. alignment will be choosen per variable size dependent on these
  131. settings
  132. Revision 1.3 2001/05/12 12:11:31 peter
  133. * simplify_ppu is now the default, a recompile of the compiler now
  134. only compiles pp.pas
  135. Revision 1.2 2000/12/23 19:46:49 peter
  136. * object to class conversion
  137. * more verbosity for -vt and -vd
  138. * -i options can be put after eachother so the Makefiles only need
  139. to call fpc once for all info (will be twice as the first one will
  140. be to check the version if fpc supports multiple info)
  141. Revision 1.1 2000/11/30 22:42:50 florian
  142. * renamed
  143. Revision 1.1 2000/11/30 22:21:56 florian
  144. * moved to i386
  145. Revision 1.6 2000/10/24 10:40:53 jonas
  146. + register renaming ("fixes" bug1088)
  147. * changed command line options meanings for optimizer:
  148. O2 now means peepholopts, CSE and register renaming in 1 pass
  149. O3 is the same, but repeated until no further optimizations are
  150. possible or until 5 passes have been done (to avoid endless loops)
  151. * changed aopt386 so it does this looping
  152. * added some procedures from csopt386 to the interface because they're
  153. used by rropt386 as well
  154. * some changes to csopt386 and daopt386 so that newly added instructions
  155. by the CSE get optimizer info (they were simply skipped previously),
  156. this fixes some bugs
  157. Revision 1.5 2000/09/24 15:06:20 peter
  158. * use defines.inc
  159. Revision 1.4 2000/08/27 16:11:51 peter
  160. * moved some util functions from globals,cobjects to cutils
  161. * splitted files into finput,fmodule
  162. Revision 1.3 2000/07/27 13:03:36 jonas
  163. * release alignopts
  164. Revision 1.2 2000/07/13 11:32:44 michael
  165. + removed logs
  166. }