opts386.pas 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 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. 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];
  44. 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
  45. 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
  46. 'r' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_regalloc];
  47. 'u' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_uncertainopts];
  48. '1' : initglobalswitches:=initglobalswitches-[cs_slowoptimize,cs_uncertainopts]+[cs_optimize,cs_fastoptimize];
  49. '2' : initglobalswitches:=initglobalswitches-[cs_uncertainopts]+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
  50. '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_uncertainopts];
  51. 'p' :
  52. Begin
  53. If j < Length(Opt) Then
  54. Begin
  55. Case opt[j+1] Of
  56. '1': initoptprocessor := Class386;
  57. '2': initoptprocessor := ClassP5;
  58. '3': initoptprocessor := ClassP6
  59. Else IllegalPara(Opt)
  60. End;
  61. Inc(j);
  62. End
  63. Else IllegalPara(opt)
  64. End
  65. else IllegalPara(opt);
  66. End;
  67. Inc(j)
  68. end;
  69. end;
  70. 'R' : begin
  71. if More='ATT' then
  72. initasmmode:=asmmode_i386_att
  73. else
  74. if More='INTEL' then
  75. initasmmode:=asmmode_i386_intel
  76. else
  77. if More='DIRECT' then
  78. initasmmode:=asmmode_i386_direct
  79. else
  80. IllegalPara(opt);
  81. end;
  82. else
  83. IllegalPara(opt);
  84. end;
  85. end;
  86. end.
  87. {
  88. $Log$
  89. Revision 1.15 1998-12-11 00:03:22 peter
  90. + globtype,tokens,version unit splitted from globals
  91. Revision 1.14 1998/11/12 09:00:26 michael
  92. * Fixed syntax error
  93. Revision 1.13 1998/11/11 20:11:39 jonas
  94. * lower optimization levels disable higher optimization level features
  95. * check if there actually is a character after -Op before comparing it with a number
  96. Revision 1.12 1998/10/13 13:10:20 peter
  97. * new style for m68k/i386 infos and enums
  98. Revision 1.11 1998/09/25 09:57:08 peter
  99. * moved -A to options.pas, becuase the code is the same
  100. }