cpuswtch.pas 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. interprets the commandline options which are powerpc specific
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit cpuswtch;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. options;
  22. type
  23. toptionpowerpc=class(toption)
  24. procedure interpret_proc_specific_options(const opt:string);override;
  25. end;
  26. implementation
  27. uses
  28. cutils,globtype,systems,globals;
  29. procedure toptionpowerpc.interpret_proc_specific_options(const opt:string);
  30. var
  31. more: string;
  32. j: longint;
  33. begin
  34. More:=Upper(copy(opt,3,length(opt)-2));
  35. case opt[2] of
  36. 'O' : Begin
  37. j := 3;
  38. While (j <= Length(Opt)) Do
  39. Begin
  40. case opt[j] of
  41. '-' :
  42. begin
  43. initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
  44. cs_regvars,cs_uncertainopts];
  45. FillChar(ParaAlignment,sizeof(ParaAlignment),0);
  46. end;
  47. 'a' :
  48. begin
  49. UpdateAlignmentStr(Copy(Opt,j+1,255),ParaAlignment);
  50. j:=length(Opt);
  51. end;
  52. 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
  53. 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
  54. 'r' :
  55. begin
  56. initglobalswitches:=initglobalswitches+[cs_regvars];
  57. Simplify_ppu:=false;
  58. end;
  59. 'u' : initglobalswitches:=initglobalswitches+[cs_uncertainopts];
  60. '1' : initglobalswitches:=initglobalswitches-[cs_fastoptimize,cs_slowoptimize]+[cs_optimize];
  61. '2' : initglobalswitches:=initglobalswitches-[cs_slowoptimize]+[cs_optimize,cs_fastoptimize];
  62. '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
  63. {$ifdef dummy}
  64. 'p' :
  65. Begin
  66. If j < Length(Opt) Then
  67. Begin
  68. Case opt[j+1] Of
  69. '1': initoptprocessor := Class386;
  70. '2': initoptprocessor := ClassP5;
  71. '3': initoptprocessor := ClassP6
  72. Else IllegalPara(Opt)
  73. End;
  74. Inc(j);
  75. End
  76. Else IllegalPara(opt)
  77. End;
  78. {$endif dummy}
  79. else IllegalPara(opt);
  80. End;
  81. Inc(j)
  82. end;
  83. end;
  84. {$ifdef dummy}
  85. 'R' : begin
  86. if More='GAS' then
  87. initasmmode:=asmmode_ppc_gas
  88. else
  89. if More='MOTOROLA' then
  90. initasmmode:=asmmode_ppc_motorola
  91. else
  92. if More='DIRECT' then
  93. initasmmode:=asmmode_direct
  94. else
  95. IllegalPara(opt);
  96. end;
  97. {$endif dummy}
  98. else
  99. IllegalPara(opt);
  100. end;
  101. end;
  102. initialization
  103. coption:=toptionpowerpc;
  104. end.