cpuswtch.pas 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. interprets the commandline options which are 680x0 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. toptionm68k=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 toptionm68k.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. '2': initoptprocessor := MC68020;
  69. Else IllegalPara(Opt)
  70. End;
  71. Inc(j);
  72. End
  73. Else IllegalPara(opt)
  74. End;
  75. else IllegalPara(opt);
  76. End;
  77. Inc(j)
  78. end;
  79. end;
  80. 'R' : begin
  81. if More='GAS' then
  82. initasmmode:=asmmode_standard
  83. else
  84. IllegalPara(opt);
  85. end;
  86. else
  87. IllegalPara(opt);
  88. end;
  89. end;
  90. initialization
  91. coption:=toptionm68k;
  92. end.