opts386.pas 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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. 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. 'A' : begin
  38. if set_string_asm(More) then
  39. initoutputformat:=target_asm.id
  40. else
  41. IllegalPara(opt);
  42. end;
  43. 'O' : Begin
  44. j := 3;
  45. While (j <= Length(Opt)) Do
  46. Begin
  47. case opt[j] of
  48. '-' : initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
  49. cs_regalloc,cs_uncertainopts];
  50. 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
  51. 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
  52. 'r' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_regalloc];
  53. 'u' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_uncertainopts];
  54. '1' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize];
  55. '2' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
  56. '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_uncertainopts];
  57. 'p' :
  58. Begin
  59. Case opt[j+1] Of
  60. '1': initoptprocessor := Class386;
  61. '2': initoptprocessor := ClassP5;
  62. '3': initoptprocessor := ClassP6
  63. Else IllegalPara(Opt)
  64. End;
  65. Inc(j);
  66. End
  67. else IllegalPara(opt);
  68. End;
  69. Inc(j)
  70. end;
  71. end;
  72. 'R' : begin
  73. if More='ATT' then
  74. initasmmode:=I386_ATT
  75. else
  76. if More='INTEL' then
  77. initasmmode:=I386_INTEL
  78. else
  79. if More='DIRECT' then
  80. initasmmode:=I386_DIRECT
  81. else
  82. IllegalPara(opt);
  83. end;
  84. else
  85. IllegalPara(opt);
  86. end;
  87. end;
  88. end.
  89. {
  90. $Log$
  91. Revision 1.10 1998-08-19 16:07:49 jonas
  92. * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
  93. Revision 1.9 1998/08/10 14:50:04 peter
  94. + localswitches, moduleswitches, globalswitches splitting
  95. Revision 1.8 1998/06/16 08:56:22 peter
  96. + targetcpu
  97. * cleaner pmodules for newppu
  98. Revision 1.7 1998/05/30 14:31:05 peter
  99. + $ASMMODE
  100. Revision 1.6 1998/05/28 17:26:48 peter
  101. * fixed -R switch, it didn't work after my previous akt/init patch
  102. * fixed bugs 110,130,136
  103. Revision 1.5 1998/05/23 01:21:14 peter
  104. + aktasmmode, aktoptprocessor, aktoutputformat
  105. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  106. + $LIBNAME to set the library name where the unit will be put in
  107. * splitted cgi386 a bit (codeseg to large for bp7)
  108. * nasm, tasm works again. nasm moved to ag386nsm.pas
  109. Revision 1.4 1998/05/10 12:07:15 jonas
  110. + switches for 6x86 and k6 optimizations
  111. Revision 1.3 1998/04/29 10:33:55 pierre
  112. + added some code for ansistring (not complete nor working yet)
  113. * corrected operator overloading
  114. * corrected nasm output
  115. + started inline procedures
  116. + added starstarn : use ** for exponentiation (^ gave problems)
  117. + started UseTokenInfo cond to get accurate positions
  118. Revision 1.1.1.1 1998/03/25 11:18:14 root
  119. * Restored version
  120. Revision 1.17 1998/03/10 01:17:21 peter
  121. * all files have the same header
  122. * messages are fully implemented, EXTDEBUG uses Comment()
  123. + AG... files for the Assembler generation
  124. Revision 1.16 1998/03/06 01:09:00 peter
  125. * removed the conflicts that had occured
  126. Revision 1.15 1998/03/06 00:52:30 peter
  127. * replaced all old messages from errore.msg, only ExtDebug and some
  128. Comment() calls are left
  129. * fixed options.pas
  130. Revision 1.14 1998/03/05 22:41:52 florian
  131. + missing constructor to options object added
  132. Revision 1.13 1998/03/05 02:44:14 peter
  133. * options cleanup and use of .msg file
  134. Revision 1.12 1998/03/04 17:33:47 michael
  135. + Changed ifdef FPK to ifdef FPC
  136. Revision 1.11 1998/03/02 21:21:39 jonas
  137. + added support for uncertain optimizations
  138. Revision 1.10 1998/03/02 01:48:47 peter
  139. * renamed target_DOS to target_GO32V1
  140. + new verbose system, merged old errors and verbose units into one new
  141. verbose.pas, so errors.pas is obsolete
  142. Revision 1.9 1998/02/22 23:03:20 peter
  143. * renamed msource->mainsource and name->unitname
  144. * optimized filename handling, filename is not seperate anymore with
  145. path+name+ext, this saves stackspace and a lot of fsplit()'s
  146. * recompiling of some units in libraries fixed
  147. * shared libraries are working again
  148. + $LINKLIB <lib> to support automatic linking to libraries
  149. + libraries are saved/read from the ppufile, also allows more libraries
  150. per ppufile
  151. Revision 1.8 1998/02/13 10:35:12 daniel
  152. * Made Motorola version compilable.
  153. * Fixed optimizer
  154. Revision 1.7 1998/02/12 11:50:15 daniel
  155. Yes! Finally! After three retries, my patch!
  156. Changes:
  157. Complete rewrite of psub.pas.
  158. Added support for DLL's.
  159. Compiler requires less memory.
  160. Platform units for each platform.
  161. Revision 1.6 1998/02/08 23:56:55 peter
  162. + -O- to turn off optimizes
  163. Revision 1.5 1998/01/23 17:12:14 pierre
  164. * added some improvements for as and ld :
  165. - doserror and dosexitcode treated separately
  166. - PATH searched if doserror=2
  167. + start of long and ansi string (far from complete)
  168. in conditionnal UseLongString and UseAnsiString
  169. * options.pas cleaned (some variables shifted to globals)gl
  170. Revision 1.4 1998/01/07 00:16:54 michael
  171. Restored released version (plus fixes) as current
  172. Revision 1.2 1997/12/15 09:11:29 florian
  173. + again opts386.pas commited (there was an error)
  174. Revision 1.1.1.1 1997/11/27 08:32:57 michael
  175. FPC Compiler CVS start
  176. Pre-CVS log:
  177. CEC Carl-Eric Codere
  178. FK Florian Klaempfl
  179. PM Pierre Muller
  180. + feature added
  181. - removed
  182. * bug fixed or changed
  183. History:
  184. 8th october 1997:
  185. * started from options.pas (FK)
  186. 23th november 1997:
  187. + added -R option for different assembler reading style (PM)
  188. }