opts386.pas 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
  4. interprets the commandline options which are i386 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. unit opts386;
  19. interface
  20. uses
  21. options;
  22. type
  23. poption386=^toption386;
  24. toption386=object(toption)
  25. procedure interpret_proc_specific_options(const opt:string);virtual;
  26. end;
  27. implementation
  28. uses
  29. cutils,globtype,systems,globals;
  30. procedure toption386.interpret_proc_specific_options(const opt:string);
  31. var
  32. j : longint;
  33. More : string;
  34. begin
  35. More:=Upper(copy(opt,3,length(opt)-2));
  36. case opt[2] of
  37. 'O' : Begin
  38. j := 3;
  39. While (j <= Length(Opt)) Do
  40. Begin
  41. case opt[j] of
  42. '-' : initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
  43. cs_regalloc,cs_uncertainopts,cs_align];
  44. 'a' : initglobalswitches:=initglobalswitches+[cs_align];
  45. 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
  46. 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
  47. 'r' : initglobalswitches:=initglobalswitches+[cs_regalloc];
  48. 'u' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_uncertainopts];
  49. '1' : initglobalswitches:=initglobalswitches-[cs_slowoptimize,cs_uncertainopts]+[cs_optimize,cs_fastoptimize];
  50. '2' : initglobalswitches:=initglobalswitches-[cs_uncertainopts]+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
  51. '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_uncertainopts];
  52. 'p' :
  53. Begin
  54. If j < Length(Opt) Then
  55. Begin
  56. Case opt[j+1] Of
  57. '1': initoptprocessor := Class386;
  58. '2': initoptprocessor := ClassP5;
  59. '3': initoptprocessor := ClassP6
  60. Else IllegalPara(Opt)
  61. End;
  62. Inc(j);
  63. End
  64. Else IllegalPara(opt)
  65. End;
  66. {$ifdef USECMOV}
  67. 's' :
  68. Begin
  69. If j < Length(Opt) Then
  70. Begin
  71. Case opt[j+1] Of
  72. '3': initspecificoptprocessor:=ClassP6
  73. Else IllegalPara(Opt)
  74. End;
  75. Inc(j);
  76. End
  77. Else IllegalPara(opt)
  78. End
  79. {$endif USECMOV}
  80. else IllegalPara(opt);
  81. End;
  82. Inc(j)
  83. end;
  84. end;
  85. 'R' : begin
  86. if More='ATT' then
  87. initasmmode:=asmmode_i386_att
  88. else
  89. if More='INTEL' then
  90. initasmmode:=asmmode_i386_intel
  91. else
  92. if More='DIRECT' then
  93. initasmmode:=asmmode_i386_direct
  94. else
  95. IllegalPara(opt);
  96. end;
  97. else
  98. IllegalPara(opt);
  99. end;
  100. end;
  101. end.
  102. {
  103. $Log$
  104. Revision 1.4 2000-08-27 16:11:51 peter
  105. * moved some util functions from globals,cobjects to cutils
  106. * splitted files into finput,fmodule
  107. Revision 1.3 2000/07/27 13:03:36 jonas
  108. * release alignopts
  109. Revision 1.2 2000/07/13 11:32:44 michael
  110. + removed logs
  111. }