cpuswtch.pas 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. interprets the commandline options which are i386 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. toptionx86_64=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 toptionx86_64.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. else IllegalPara(opt);
  64. End;
  65. Inc(j)
  66. end;
  67. end;
  68. 'R' : begin
  69. if More='ATT' then
  70. initasmmode:=asmmode_i386_att
  71. else
  72. if More='INTEL' then
  73. initasmmode:=asmmode_i386_intel
  74. else
  75. IllegalPara(opt);
  76. end;
  77. else
  78. IllegalPara(opt);
  79. end;
  80. end;
  81. initialization
  82. coption:=toptionx86_64;
  83. end.