cpuswtch.pas 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 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='GAS' then
  97. initasmmode:=asmmode_ppc_gas
  98. else
  99. if More='MOTOROLA' then
  100. initasmmode:=asmmode_ppc_motorola
  101. else
  102. if More='DIRECT' then
  103. initasmmode:=asmmode_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.6 2002-08-10 14:52:52 carl
  118. + moved target_cpu_string to cpuinfo
  119. * renamed asmmode enum.
  120. * assembler reader has now less ifdef's
  121. * move from nppcmem.pas -> ncgmem.pas vec. node.
  122. Revision 1.5 2002/07/28 20:45:23 florian
  123. + added direct assembler reader for PowerPC
  124. Revision 1.4 2002/05/18 13:34:26 peter
  125. * readded missing revisions
  126. Revision 1.3 2002/05/16 19:46:53 carl
  127. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  128. + try to fix temp allocation (still in ifdef)
  129. + generic constructor calls
  130. + start of tassembler / tmodulebase class cleanup
  131. Revision 1.1 2002/05/13 19:52:46 peter
  132. * a ppcppc can be build again
  133. }