mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-26 16:33:45 +01:00 
			
		
		
		
	* moved to i386
This commit is contained in:
		
							parent
							
								
									d93a445b58
								
							
						
					
					
						commit
						00a98196cc
					
				| @ -24,12 +24,6 @@ unit hcodegen; | ||||
| 
 | ||||
| {$i defines.inc} | ||||
| 
 | ||||
| {$ifdef newcg} | ||||
| interface | ||||
| 
 | ||||
| implementation | ||||
| {$else newcg} | ||||
| 
 | ||||
|   interface | ||||
| 
 | ||||
|     uses | ||||
| @ -439,7 +433,6 @@ implementation | ||||
|          address:=a; | ||||
|          typ:=p; | ||||
|       end; | ||||
| {$endif newcg} | ||||
| 
 | ||||
| {$ifdef fixLeaksOnError} | ||||
| procedure hcodegen_do_stop; | ||||
| @ -464,7 +457,10 @@ begin | ||||
| end. | ||||
| { | ||||
|   $Log$ | ||||
|   Revision 1.7  2000-10-31 22:02:47  peter | ||||
|   Revision 1.8  2000-11-30 22:16:49  florian | ||||
|     * moved to i386 | ||||
| 
 | ||||
|   Revision 1.7  2000/10/31 22:02:47  peter | ||||
|     * symtable splitted, no real code changes | ||||
| 
 | ||||
|   Revision 1.6  2000/09/24 15:06:17  peter | ||||
| @ -490,4 +486,4 @@ end. | ||||
|   Revision 1.2  2000/07/13 11:32:41  michael | ||||
|   + removed logs | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -889,7 +889,10 @@ interface | ||||
| end. | ||||
| { | ||||
|   $Log$ | ||||
|   Revision 1.6  2000-09-24 15:06:10  peter | ||||
|   Revision 1.1  2000-11-30 22:18:48  florian | ||||
|     * moved to i386 | ||||
| 
 | ||||
|   Revision 1.6  2000/09/24 15:06:10  peter | ||||
|     * use defines.inc | ||||
| 
 | ||||
|   Revision 1.5  2000/08/27 16:11:49  peter | ||||
| @ -1003,7 +1003,10 @@ interface | ||||
| end. | ||||
| { | ||||
|   $Log$ | ||||
|   Revision 1.9  2000-11-12 22:20:37  peter | ||||
|   Revision 1.1  2000-11-30 22:18:48  florian | ||||
|     * moved to i386 | ||||
| 
 | ||||
|   Revision 1.9  2000/11/12 22:20:37  peter | ||||
|     * create generic toutputsection for binary writers | ||||
| 
 | ||||
|   Revision 1.8  2000/09/24 15:06:10  peter | ||||
							
								
								
									
										147
									
								
								compiler/i386/opts386.pas
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										147
									
								
								compiler/i386/opts386.pas
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,147 @@ | ||||
| { | ||||
|     $Id$ | ||||
|     Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller | ||||
| 
 | ||||
|     interprets the commandline options which are i386 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 opts386; | ||||
| 
 | ||||
| {$i defines.inc} | ||||
| 
 | ||||
| interface | ||||
| 
 | ||||
| uses | ||||
|   options; | ||||
| 
 | ||||
| type | ||||
|   poption386=^toption386; | ||||
|   toption386=object(toption) | ||||
|     procedure interpret_proc_specific_options(const opt:string);virtual; | ||||
|   end; | ||||
| 
 | ||||
| implementation | ||||
| 
 | ||||
| uses | ||||
|   cutils,globtype,systems,globals; | ||||
| 
 | ||||
| procedure toption386.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 | ||||
|                  '-' : initglobalswitches:=initglobalswitches-[cs_optimize,cs_fastoptimize,cs_slowoptimize,cs_littlesize, | ||||
|                            cs_regalloc,cs_uncertainopts,cs_align]; | ||||
|                  'a' : initglobalswitches:=initglobalswitches+[cs_align]; | ||||
|                  'g' : initglobalswitches:=initglobalswitches+[cs_littlesize]; | ||||
|                  'G' : initglobalswitches:=initglobalswitches-[cs_littlesize]; | ||||
|                  'r' : initglobalswitches:=initglobalswitches+[cs_regalloc]; | ||||
|                  '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 := Class386; | ||||
|                            '2': initoptprocessor := ClassP5; | ||||
|                            '3': initoptprocessor := ClassP6 | ||||
|                            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='ATT' then | ||||
|             initasmmode:=asmmode_i386_att | ||||
|            else | ||||
|             if More='INTEL' then | ||||
|              initasmmode:=asmmode_i386_intel | ||||
|            else | ||||
|             if More='DIRECT' then | ||||
|              initasmmode:=asmmode_i386_direct | ||||
|            else | ||||
|             IllegalPara(opt); | ||||
|          end; | ||||
|   else | ||||
|    IllegalPara(opt); | ||||
|   end; | ||||
| end; | ||||
| 
 | ||||
| end. | ||||
| { | ||||
|   $Log$ | ||||
|   Revision 1.1  2000-11-30 22:21:56  florian | ||||
|     * moved to i386 | ||||
| 
 | ||||
|   Revision 1.6  2000/10/24 10:40:53  jonas | ||||
|     + register renaming ("fixes" bug1088) | ||||
|     * changed command line options meanings for optimizer: | ||||
|         O2 now means peepholopts, CSE and register renaming in 1 pass | ||||
|         O3 is the same, but repeated until no further optimizations are | ||||
|           possible or until 5 passes have been done (to avoid endless loops) | ||||
|     * changed aopt386 so it does this looping | ||||
|     * added some procedures from csopt386 to the interface because they're | ||||
|       used by rropt386 as well | ||||
|     * some changes to csopt386 and daopt386 so that newly added instructions | ||||
|       by the CSE get optimizer info (they were simply skipped previously), | ||||
|       this fixes some bugs | ||||
| 
 | ||||
|   Revision 1.5  2000/09/24 15:06:20  peter | ||||
|     * use defines.inc | ||||
| 
 | ||||
|   Revision 1.4  2000/08/27 16:11:51  peter | ||||
|     * moved some util functions from globals,cobjects to cutils | ||||
|     * splitted files into finput,fmodule | ||||
| 
 | ||||
|   Revision 1.3  2000/07/27 13:03:36  jonas | ||||
|     * release alignopts | ||||
| 
 | ||||
|   Revision 1.2  2000/07/13 11:32:44  michael | ||||
|   + removed logs | ||||
| 
 | ||||
| } | ||||
| @ -6,6 +6,8 @@ Module CPUBASE | ||||
|    CONSTANTS used throughout the code generator | ||||
|    -------------------------------------------- | ||||
| 
 | ||||
| Must of this is subject to be moved to cpuinfo | ||||
| 
 | ||||
| frame_pointer              equals the register used as frame pointer | ||||
| stack_pointer              equals the register used as stack pointer | ||||
| self_pointer               equals the register used as self pointer | ||||
| @ -318,7 +320,10 @@ CVS Log | ||||
| ------- | ||||
| 
 | ||||
| $Log$ | ||||
| Revision 1.1  2000-07-13 06:30:07  michael | ||||
| Revision 1.2  2000-11-30 22:16:51  florian | ||||
|   * moved to i386 | ||||
| 
 | ||||
| Revision 1.1  2000/07/13 06:30:07  michael | ||||
| + Initial import | ||||
| 
 | ||||
| Revision 1.6  2000/03/02 03:22:16  carl | ||||
|  | ||||
| @ -218,7 +218,7 @@ implementation | ||||
|       { scanner } | ||||
|       scanner, | ||||
|       { codegen } | ||||
|       hcodegen  { remove !!! } | ||||
|       hcodegen | ||||
|       ; | ||||
| 
 | ||||
| 
 | ||||
| @ -2364,7 +2364,10 @@ implementation | ||||
| end. | ||||
| { | ||||
|   $Log$ | ||||
|   Revision 1.18  2000-11-29 00:30:42  florian | ||||
|   Revision 1.19  2000-11-30 22:16:49  florian | ||||
|     * moved to i386 | ||||
| 
 | ||||
|   Revision 1.18  2000/11/29 00:30:42  florian | ||||
|     * unused units removed from uses clause | ||||
|     * some changes for widestrings | ||||
| 
 | ||||
|  | ||||
| @ -30,6 +30,13 @@ interface | ||||
|       cpubase,cpuinfo,cobjects,globals, | ||||
|       hcodegen,verbose,fmodule,aasm; | ||||
| 
 | ||||
| {$ifdef newcg} | ||||
|     const | ||||
|        countusableregint : byte = c_countusableregsint; | ||||
|        countusableregfpu : byte = c_countusableregsfpu; | ||||
|        countusableregmm  : byte = c_countusableregsmm; | ||||
| {$endif newcg} | ||||
| 
 | ||||
|     type | ||||
|       ttemptype = (tt_none,tt_free,tt_normal,tt_persistant, | ||||
|                    tt_ansistring,tt_freeansistring,tt_widestring,tt_freewidestring, | ||||
| @ -387,7 +394,7 @@ const | ||||
|            led to problems with local arrays | ||||
|            with lower bound > 0 (PM) } | ||||
|          istemp:=((ref.base=procinfo^.framepointer) and | ||||
| {$ifndef alpha} | ||||
| {$ifdef i386} | ||||
|                   (ref.index=R_NO) and | ||||
| {$endif} | ||||
|                   (ref.offset<firsttemp)); | ||||
| @ -549,7 +556,10 @@ begin | ||||
| end. | ||||
| { | ||||
|   $Log$ | ||||
|   Revision 1.7  2000-11-29 00:30:42  florian | ||||
|   Revision 1.8  2000-11-30 22:16:50  florian | ||||
|     * moved to i386 | ||||
| 
 | ||||
|   Revision 1.7  2000/11/29 00:30:42  florian | ||||
|     * unused units removed from uses clause | ||||
|     * some changes for widestrings | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 florian
						florian