cpuswtch.pas 4.0 KB

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