2
0

cpuswtch.pas 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 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 cpuswtch;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. options;
  23. type
  24. toptionx86_64=class(toption)
  25. procedure interpret_proc_specific_options(const opt:string);override;
  26. end;
  27. implementation
  28. uses
  29. cutils,globtype,systems,globals;
  30. procedure toptionx86_64.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. '-' :
  43. begin
  44. initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
  45. cs_regvars,cs_uncertainopts];
  46. FillChar(ParaAlignment,sizeof(ParaAlignment),0);
  47. end;
  48. 'a' :
  49. begin
  50. UpdateAlignmentStr(Copy(Opt,j+1,255),ParaAlignment);
  51. j:=length(Opt);
  52. end;
  53. 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
  54. 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
  55. 'r' :
  56. begin
  57. initglobalswitches:=initglobalswitches+[cs_regvars];
  58. Simplify_ppu:=false;
  59. end;
  60. 'u' : initglobalswitches:=initglobalswitches+[cs_uncertainopts];
  61. '1' : initglobalswitches:=initglobalswitches-[cs_fastoptimize,cs_slowoptimize]+[cs_optimize];
  62. '2' : initglobalswitches:=initglobalswitches-[cs_slowoptimize]+[cs_optimize,cs_fastoptimize];
  63. '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
  64. else IllegalPara(opt);
  65. End;
  66. Inc(j)
  67. end;
  68. end;
  69. 'R' : begin
  70. if More='ATT' then
  71. initasmmode:=asmmode_i386_att
  72. else
  73. if More='INTEL' then
  74. initasmmode:=asmmode_i386_intel
  75. else
  76. if More='DIRECT' then
  77. initasmmode:=asmmode_direct
  78. else
  79. IllegalPara(opt);
  80. end;
  81. else
  82. IllegalPara(opt);
  83. end;
  84. end;
  85. initialization
  86. coption:=toptionx86_64;
  87. end.
  88. {
  89. $Log$
  90. Revision 1.3 2003-09-25 13:13:32 florian
  91. * more x86-64 fixes
  92. Revision 1.2 2002/08/10 14:53:38 carl
  93. + moved target_cpu_string to cpuinfo
  94. * renamed asmmode enum.
  95. * assembler reader has now less ifdef's
  96. * move from nppcmem.pas -> ncgmem.pas vec. node.
  97. Revision 1.1 2002/07/24 22:38:15 florian
  98. + initial release of x86-64 target code
  99. Revision 1.7 2002/05/18 13:34:22 peter
  100. * readded missing revisions
  101. Revision 1.6 2002/05/16 19:46:50 carl
  102. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  103. + try to fix temp allocation (still in ifdef)
  104. + generic constructor calls
  105. + start of tassembler / tmodulebase class cleanup
  106. }