opts386.pas 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. globals;
  30. procedure toption386.interpret_proc_specific_options(const opt:string);
  31. var
  32. j : longint;
  33. begin
  34. case opt[2] of
  35. 'A' : begin
  36. if copy(opt,3,length(opt)-2)='o' then
  37. begin
  38. output_format:=of_o;
  39. assem_need_external_list:=false;
  40. end
  41. else
  42. if copy(opt,3,length(opt)-2)='masm' then
  43. begin
  44. output_format:=of_masm;
  45. assem_need_external_list:=true;
  46. end
  47. else
  48. if copy(opt,3,length(opt)-2)='att' then
  49. begin
  50. output_format:=of_att;
  51. assem_need_external_list:=false;
  52. end
  53. else
  54. if copy(opt,3,length(opt)-2)='win32' then
  55. begin
  56. output_format:=of_win32;
  57. assem_need_external_list:=false;
  58. end
  59. else
  60. if copy(opt,3,length(opt)-2)='obj' then
  61. begin
  62. output_format:=of_obj;
  63. assem_need_external_list:=true;
  64. end
  65. else
  66. if copy(opt,3,length(opt)-2)='nasm' then
  67. begin
  68. output_format:=of_nasm;
  69. assem_need_external_list:=true;
  70. end
  71. else
  72. IllegalPara(opt);
  73. end;
  74. 'O' : begin
  75. for j:=3 to length(opt) do
  76. case opt[j] of
  77. '-' : initswitches:=initswitches-[cs_optimize,cs_maxoptimieren,cs_littlesize];
  78. 'a' : initswitches:=initswitches+[cs_optimize];
  79. 'g' : initswitches:=initswitches+[cs_littlesize];
  80. 'G' : initswitches:=initswitches-[cs_littlesize];
  81. 'x' : initswitches:=initswitches+[cs_optimize,cs_maxoptimieren];
  82. 'z' : initswitches:=initswitches+[cs_optimize,cs_uncertainopts];
  83. '2' : opt_processors:=pentium2;
  84. '3' : opt_processors:=globals.i386;
  85. '4' : opt_processors:=i486;
  86. '5' : opt_processors:=pentium;
  87. '6' : opt_processors:=pentiumpro;
  88. '7' : opt_processors:=cx6x86;
  89. '8' : opt_processors:=amdk6;
  90. else IllegalPara(opt);
  91. end;
  92. end;
  93. 'R' : begin
  94. if copy(opt,3,length(opt)-2)='att' then
  95. aktasmmode:=I386_ATT
  96. else
  97. if copy(opt,3,length(opt)-2)='intel' then
  98. aktasmmode:=I386_INTEL
  99. else
  100. if copy(opt,3,length(opt)-2)='direct' then
  101. aktasmmode:=I386_DIRECT
  102. else
  103. IllegalPara(opt);
  104. end;
  105. else IllegalPara(opt);
  106. end;
  107. end;
  108. end.
  109. {
  110. $Log$
  111. Revision 1.2 1998-04-09 14:28:09 jonas
  112. + basic k6 and 6x86 optimizing support (-O7 and -O8)
  113. Revision 1.1.1.1 1998/03/25 11:18:14 root
  114. * Restored version
  115. Revision 1.17 1998/03/10 01:17:21 peter
  116. * all files have the same header
  117. * messages are fully implemented, EXTDEBUG uses Comment()
  118. + AG... files for the Assembler generation
  119. Revision 1.16 1998/03/06 01:09:00 peter
  120. * removed the conflicts that had occured
  121. Revision 1.15 1998/03/06 00:52:30 peter
  122. * replaced all old messages from errore.msg, only ExtDebug and some
  123. Comment() calls are left
  124. * fixed options.pas
  125. Revision 1.14 1998/03/05 22:41:52 florian
  126. + missing constructor to options object added
  127. Revision 1.13 1998/03/05 02:44:14 peter
  128. * options cleanup and use of .msg file
  129. Revision 1.12 1998/03/04 17:33:47 michael
  130. + Changed ifdef FPK to ifdef FPC
  131. Revision 1.11 1998/03/02 21:21:39 jonas
  132. + added support for uncertain optimizations
  133. Revision 1.10 1998/03/02 01:48:47 peter
  134. * renamed target_DOS to target_GO32V1
  135. + new verbose system, merged old errors and verbose units into one new
  136. verbose.pas, so errors.pas is obsolete
  137. Revision 1.9 1998/02/22 23:03:20 peter
  138. * renamed msource->mainsource and name->unitname
  139. * optimized filename handling, filename is not seperate anymore with
  140. path+name+ext, this saves stackspace and a lot of fsplit()'s
  141. * recompiling of some units in libraries fixed
  142. * shared libraries are working again
  143. + $LINKLIB <lib> to support automatic linking to libraries
  144. + libraries are saved/read from the ppufile, also allows more libraries
  145. per ppufile
  146. Revision 1.8 1998/02/13 10:35:12 daniel
  147. * Made Motorola version compilable.
  148. * Fixed optimizer
  149. Revision 1.7 1998/02/12 11:50:15 daniel
  150. Yes! Finally! After three retries, my patch!
  151. Changes:
  152. Complete rewrite of psub.pas.
  153. Added support for DLL's.
  154. Compiler requires less memory.
  155. Platform units for each platform.
  156. Revision 1.6 1998/02/08 23:56:55 peter
  157. + -O- to turn off optimizes
  158. Revision 1.5 1998/01/23 17:12:14 pierre
  159. * added some improvements for as and ld :
  160. - doserror and dosexitcode treated separately
  161. - PATH searched if doserror=2
  162. + start of long and ansi string (far from complete)
  163. in conditionnal UseLongString and UseAnsiString
  164. * options.pas cleaned (some variables shifted to globals)gl
  165. Revision 1.4 1998/01/07 00:16:54 michael
  166. Restored released version (plus fixes) as current
  167. Revision 1.2 1997/12/15 09:11:29 florian
  168. + again opts386.pas commited (there was an error)
  169. Revision 1.1.1.1 1997/11/27 08:32:57 michael
  170. FPC Compiler CVS start
  171. Pre-CVS log:
  172. CEC Carl-Eric Codere
  173. FK Florian Klaempfl
  174. PM Pierre Muller
  175. + feature added
  176. - removed
  177. * bug fixed or changed
  178. History:
  179. 8th october 1997:
  180. * started from options.pas (FK)
  181. 23th november 1997:
  182. + added -R option for different assembler reading style (PM)
  183. }