mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 21:09:38 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			139 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			139 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| {
 | |
|     $Id$
 | |
|     Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
 | |
| 
 | |
|     interprets the commandline options which are iSPARC specific
 | |
| 
 | |
|     This program is free software; you can redistribute it and/or modify
 | |
|     it under the terms of the GNU General Public License as published by
 | |
|     the Free Software Foundation; either version 2 of the License, or
 | |
|     (at your option) any later version.
 | |
| 
 | |
|     This program is distributed in the hope that it will be useful,
 | |
|     but WITHOUT ANY WARRANTY; without even the implied warranty of
 | |
|     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | |
|     GNU General Public License for more details.
 | |
| 
 | |
|     You should have received a copy of the GNU General Public License
 | |
|     along with this program; if not, write to the Free Software
 | |
|     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 | |
| 
 | |
|  ****************************************************************************
 | |
| }
 | |
| unit cpuswtch;
 | |
| 
 | |
| {$INCLUDE fpcdefs.inc}
 | |
| 
 | |
| interface
 | |
| 
 | |
| uses
 | |
|   options;
 | |
| 
 | |
| type
 | |
|   toptionSPARC=class(toption)
 | |
|     procedure interpret_proc_specific_options(const opt:string);override;
 | |
|   end;
 | |
| 
 | |
| implementation
 | |
| 
 | |
| uses
 | |
|   cutils,globtype,systems,globals,cpuinfo;
 | |
| 
 | |
| procedure toptionSPARC.interpret_proc_specific_options(const opt:string);
 | |
| var
 | |
|   j     : longint;
 | |
|   More  : string;
 | |
| begin
 | |
|   More:=Upper(copy(opt,3,length(opt)-2));
 | |
|   case opt[2] of
 | |
|    'O' : Begin
 | |
|            j := 3;
 | |
|            While (j <= Length(Opt)) Do
 | |
|              Begin
 | |
|                case opt[j] of
 | |
|                  '-' :
 | |
|                    begin
 | |
|                      initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize,
 | |
|                        cs_regvars,cs_uncertainopts];
 | |
|                      FillChar(ParaAlignment,sizeof(ParaAlignment),0);
 | |
|                    end;
 | |
|                  'a' :
 | |
|                    begin
 | |
|                      UpdateAlignmentStr(Copy(Opt,j+1,255),ParaAlignment);
 | |
|                      j:=length(Opt);
 | |
|                    end;
 | |
|                  'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
 | |
|                  'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
 | |
|                  'r' :
 | |
|                    begin
 | |
|                      initglobalswitches:=initglobalswitches+[cs_regvars];
 | |
|                      Simplify_ppu:=false;
 | |
|                    end;
 | |
|                  'u' : initglobalswitches:=initglobalswitches+[cs_uncertainopts];
 | |
|                  '1' : initglobalswitches:=initglobalswitches-[cs_fastoptimize,cs_slowoptimize]+[cs_optimize];
 | |
|                  '2' : initglobalswitches:=initglobalswitches-[cs_slowoptimize]+[cs_optimize,cs_fastoptimize];
 | |
|                  '3' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
 | |
|                  'p' :
 | |
|                    Begin
 | |
|                      If j < Length(Opt) Then
 | |
|                        Begin
 | |
|                          Case opt[j+1] Of
 | |
|                            '1': initoptprocessor := SPARC_V8;
 | |
|                            '2': initoptprocessor := SPARC_V9;
 | |
|                            '3': initoptprocessor := SPARC_V9;
 | |
|                            Else IllegalPara(Opt)
 | |
|                          End;
 | |
|                          Inc(j);
 | |
|                        End
 | |
|                      Else IllegalPara(opt)
 | |
|                    End;
 | |
| {$ifdef USECMOV}
 | |
|                  's' :
 | |
|                    Begin
 | |
|                      If j < Length(Opt) Then
 | |
|                        Begin
 | |
|                          Case opt[j+1] Of
 | |
|                            '3': initspecificoptprocessor:=ClassP6
 | |
|                            Else IllegalPara(Opt)
 | |
|                          End;
 | |
|                          Inc(j);
 | |
|                        End
 | |
|                      Else IllegalPara(opt)
 | |
|                    End
 | |
| {$endif USECMOV}
 | |
|                  else IllegalPara(opt);
 | |
|                End;
 | |
|                Inc(j)
 | |
|              end;
 | |
|          end;
 | |
|    'R' : begin
 | |
|            if More='GAS' then
 | |
|             initasmmode:=asmmode_i386_att
 | |
|            else
 | |
|             if More='STANDARD' then
 | |
|              initasmmode:=asmmode_i386_intel
 | |
|            else
 | |
|             IllegalPara(opt);
 | |
|          end;
 | |
|   else
 | |
|    IllegalPara(opt);
 | |
|   end;
 | |
| end;
 | |
| 
 | |
| 
 | |
| initialization
 | |
|   coption:=toptionSPARC;
 | |
| end.
 | |
| {
 | |
|   $Log$
 | |
|   Revision 1.7  2004-06-20 08:55:32  florian
 | |
|     * logs truncated
 | |
| 
 | |
|   Revision 1.6  2004/01/26 14:41:24  mazen
 | |
|   * Supported assembler modes are GAS and STANDARD
 | |
| 
 | |
|   Revision 1.5  2004/01/12 16:39:41  peter
 | |
|     * sparc updates, mostly float related
 | |
| 
 | |
| }
 | 
