Initial revision
[AROS-Contrib.git] / development / compilers / freepascal / compiler / opts386.pas
bloba49e7e886f1d401b90ae0393acde5052cb5fcd9f
2 $Id$
3 Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
5 interprets the commandline options which are i386 specific
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 ****************************************************************************
23 unit opts386;
24 interface
26 uses
27 options;
29 type
30 poption386=^toption386;
31 toption386=object(toption)
32 procedure interpret_proc_specific_options(const opt:string);virtual;
33 end;
35 implementation
37 uses
38 globtype,systems,globals;
40 procedure toption386.interpret_proc_specific_options(const opt:string);
41 var
42 j : longint;
43 More : string;
44 begin
45 More:=Upper(copy(opt,3,length(opt)-2));
46 case opt[2] of
47 'O' : Begin
48 j := 3;
49 While (j <= Length(Opt)) Do
50 Begin
51 case opt[j] of
52 '-' : initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
53 cs_regalloc,cs_uncertainopts,cs_align];
54 {$ifdef OPTALIGN}
55 'a' : initglobalswitches:=initglobalswitches+[cs_align];
56 {$endif OPTALIGN}
57 'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
58 'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
59 'r' : initglobalswitches:=initglobalswitches+[cs_regalloc];
60 'u' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_uncertainopts];
61 '1' : initglobalswitches:=initglobalswitches-[cs_slowoptimize,cs_uncertainopts]+[cs_optimize,cs_fastoptimize];
62 '2' : initglobalswitches:=initglobalswitches-[cs_uncertainopts]+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
63 '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_uncertainopts];
64 'p' :
65 Begin
66 If j < Length(Opt) Then
67 Begin
68 Case opt[j+1] Of
69 '1': initoptprocessor := Class386;
70 '2': initoptprocessor := ClassP5;
71 '3': initoptprocessor := ClassP6
72 Else IllegalPara(Opt)
73 End;
74 Inc(j);
75 End
76 Else IllegalPara(opt)
77 End;
78 {$ifdef USECMOV}
79 's' :
80 Begin
81 If j < Length(Opt) Then
82 Begin
83 Case opt[j+1] Of
84 '3': initspecificoptprocessor:=ClassP6
85 Else IllegalPara(Opt)
86 End;
87 Inc(j);
88 End
89 Else IllegalPara(opt)
90 End
91 {$endif USECMOV}
92 else IllegalPara(opt);
93 End;
94 Inc(j)
95 end;
96 end;
97 'R' : begin
98 if More='ATT' then
99 initasmmode:=asmmode_i386_att
100 else
101 if More='INTEL' then
102 initasmmode:=asmmode_i386_intel
103 else
104 if More='DIRECT' then
105 initasmmode:=asmmode_i386_direct
106 else
107 IllegalPara(opt);
108 end;
109 else
110 IllegalPara(opt);
111 end;
112 end;
114 end.
116 $Log$
117 Revision 1.1 2002/02/19 08:22:38 sasu
118 Initial revision
120 Revision 1.1 2000/07/13 06:29:52 michael
121 + Initial import
123 Revision 1.20 2000/05/31 06:58:50 florian
124 * first implementation of -Oa switch
126 Revision 1.19 2000/02/09 13:22:55 peter
127 * log truncated
129 Revision 1.18 2000/01/23 21:29:17 florian
130 * CMOV support in optimizer (in define USECMOV)
131 + start of support of exceptions in constructors
133 Revision 1.17 2000/01/07 01:14:28 peter
134 * updated copyright to 2000
136 Revision 1.16 1999/08/04 13:02:47 jonas
137 * all tokens now start with an underscore
138 * PowerPC compiles!!