cpuswtch.pas 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. This units interprets the commandline options which are Alpha 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. {
  18. This units interprets the commandline options which are Alpha specific.
  19. }
  20. unit cpuswtch;
  21. {$i fpcdefs.inc}
  22. interface
  23. uses
  24. options;
  25. type
  26. toptionalpha = class(toption)
  27. procedure interpret_proc_specific_options(const opt:string);override;
  28. end;
  29. implementation
  30. uses
  31. cutils,globtype,systems,globals;
  32. procedure toptionalpha.interpret_proc_specific_options(const opt:string);
  33. var
  34. more: string;
  35. j: longint;
  36. begin
  37. More:=Upper(copy(opt,3,length(opt)-2));
  38. case opt[2] of
  39. 'O' : Begin
  40. j := 3;
  41. While (j <= Length(Opt)) Do
  42. Begin
  43. case opt[j] of
  44. '-' :
  45. begin
  46. initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
  47. cs_regalloc,cs_uncertainopts];
  48. FillChar(ParaAlignment,sizeof(ParaAlignment),0);
  49. end;
  50. 'a' :
  51. begin
  52. UpdateAlignmentStr(Copy(Opt,j+1,255),ParaAlignment);
  53. j:=length(Opt);
  54. end;
  55. 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
  56. 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
  57. 'r' :
  58. begin
  59. initglobalswitches:=initglobalswitches+[cs_regalloc];
  60. Simplify_ppu:=false;
  61. end;
  62. 'u' : initglobalswitches:=initglobalswitches+[cs_uncertainopts];
  63. '1' : initglobalswitches:=initglobalswitches-[cs_fastoptimize,cs_slowoptimize]+[cs_optimize];
  64. '2' : initglobalswitches:=initglobalswitches-[cs_slowoptimize]+[cs_optimize,cs_fastoptimize];
  65. '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
  66. {$ifdef dummy}
  67. 'p' :
  68. Begin
  69. If j < Length(Opt) Then
  70. Begin
  71. Case opt[j+1] Of
  72. '1': initoptprocessor := Class386;
  73. '2': initoptprocessor := ClassP5;
  74. '3': initoptprocessor := ClassP6
  75. Else IllegalPara(Opt)
  76. End;
  77. Inc(j);
  78. End
  79. Else IllegalPara(opt)
  80. End;
  81. {$endif dummy}
  82. else IllegalPara(opt);
  83. End;
  84. Inc(j)
  85. end;
  86. end;
  87. {$ifdef dummy}
  88. 'R' : begin
  89. if More='GAS' then
  90. initasmmode:=asmmode_ppc_gas
  91. else
  92. if More='MOTOROLA' then
  93. initasmmode:=asmmode_ppc_motorola
  94. else
  95. if More='DIRECT' then
  96. initasmmode:=asmmode_direct
  97. else
  98. IllegalPara(opt);
  99. end;
  100. {$endif dummy}
  101. else
  102. IllegalPara(opt);
  103. end;
  104. end;
  105. initialization
  106. coption:=toptionalpha;
  107. end.