cpuswtch.pas 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {
  2. Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
  3. interprets the commandline options which are iSPARC 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. {$INCLUDE fpcdefs.inc}
  19. interface
  20. uses
  21. options;
  22. type
  23. toptionSPARC=class(toption)
  24. procedure interpret_proc_specific_options(const opt:string);override;
  25. end;
  26. implementation
  27. uses
  28. cutils,globtype,systems,globals,cpuinfo;
  29. procedure toptionSPARC.interpret_proc_specific_options(const opt:string);
  30. var
  31. j : longint;
  32. More : string;
  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. 'p' :
  64. Begin
  65. If j < Length(Opt) Then
  66. Begin
  67. Case opt[j+1] Of
  68. '1': initoptprocessor := SPARC_V8;
  69. '2': initoptprocessor := SPARC_V9;
  70. '3': initoptprocessor := SPARC_V9;
  71. Else IllegalPara(Opt)
  72. End;
  73. Inc(j);
  74. End
  75. Else IllegalPara(opt)
  76. End;
  77. {$ifdef USECMOV}
  78. 's' :
  79. Begin
  80. If j < Length(Opt) Then
  81. Begin
  82. Case opt[j+1] Of
  83. '3': initspecificoptprocessor:=ClassP6
  84. Else IllegalPara(Opt)
  85. End;
  86. Inc(j);
  87. End
  88. Else IllegalPara(opt)
  89. End
  90. {$endif USECMOV}
  91. else IllegalPara(opt);
  92. End;
  93. Inc(j)
  94. end;
  95. end;
  96. 'R' : begin
  97. if More='GAS' then
  98. initasmmode:=asmmode_i386_att
  99. else
  100. if More='STANDARD' then
  101. initasmmode:=asmmode_i386_intel
  102. else
  103. IllegalPara(opt);
  104. end;
  105. else
  106. IllegalPara(opt);
  107. end;
  108. end;
  109. initialization
  110. coption:=toptionSPARC;
  111. end.