cpuswtch.pas 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. interprets the commandline options which are PowerPC64 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. toptionpowerpc = 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 toptionpowerpc.interpret_proc_specific_options(const opt: string);
  30. var
  31. more: string;
  32. j: longint;
  33. begin
  34. More := Upper(copy(opt, 3, length(opt) - 2));
  35. case opt[2] of
  36. 'O':
  37. 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,
  45. cs_fastoptimize, cs_slowoptimize, cs_littlesize,
  46. cs_regvars, cs_uncertainopts];
  47. FillChar(ParaAlignment, sizeof(ParaAlignment), 0);
  48. end;
  49. 'a':
  50. begin
  51. UpdateAlignmentStr(Copy(Opt, j + 1, 255), ParaAlignment);
  52. j := length(Opt);
  53. end;
  54. 'g': initglobalswitches := initglobalswitches + [cs_littlesize];
  55. 'G': initglobalswitches := initglobalswitches - [cs_littlesize];
  56. 'r':
  57. begin
  58. initglobalswitches := initglobalswitches + [cs_regvars];
  59. Simplify_ppu := false;
  60. end;
  61. 'u': initglobalswitches := initglobalswitches + [cs_uncertainopts];
  62. '1': initglobalswitches := initglobalswitches - [cs_fastoptimize,
  63. cs_slowoptimize] + [cs_optimize];
  64. '2': initglobalswitches := initglobalswitches - [cs_slowoptimize] +
  65. [cs_optimize, cs_fastoptimize];
  66. '3': initglobalswitches := initglobalswitches + [cs_optimize,
  67. cs_fastoptimize, cs_slowoptimize];
  68. {$IFDEF dummy}
  69. 'p':
  70. begin
  71. if j < Length(Opt) then
  72. begin
  73. case opt[j + 1] of
  74. '1': initoptprocessor := Class386;
  75. '2': initoptprocessor := ClassP5;
  76. '3': initoptprocessor := ClassP6
  77. else
  78. IllegalPara(Opt)
  79. end;
  80. Inc(j);
  81. end
  82. else
  83. IllegalPara(opt)
  84. end;
  85. {$ENDIF dummy}
  86. else
  87. IllegalPara(opt);
  88. end;
  89. Inc(j)
  90. end;
  91. end;
  92. {$IFDEF dummy}
  93. 'R':
  94. begin
  95. if More = 'GAS' then
  96. initasmmode := asmmode_ppc_gas
  97. else if More = 'MOTOROLA' then
  98. initasmmode := asmmode_ppc_motorola
  99. else if More = 'DIRECT' then
  100. initasmmode := asmmode_direct
  101. else
  102. IllegalPara(opt);
  103. end;
  104. {$ENDIF dummy}
  105. else
  106. IllegalPara(opt);
  107. end;
  108. end;
  109. initialization
  110. coption := toptionpowerpc;
  111. end.