1  {
2     Copyright (c) 1998-2004 by Jonas Maebe, member of the Free Pascal
3     Development Team
4 
5     This unit contains several types and constants necessary for the
6     optimizer to work on the sparc architecture
7 
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12 
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17 
18     You should have received a copy of the GNU General Public License
19     along with this program; if not, write to the Free Software
20     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 
22  ****************************************************************************
23 }
24 Unit aoptcpub; { Assembler OPTimizer CPU specific Base }
25 
26 {$i fpcdefs.inc}
27 
28 { enable the following define if memory references can have a scaled index }
29 { define RefsHaveScale}
30 
31 { enable the following define if memory references can have a segment }
32 { override                                                            }
33 { define RefsHaveSegment}
34 
35 Interface
36 
37 Uses
38   cpubase,aasmcpu,AOptBase;
39 
40 Type
41 
42 { type of a normal instruction }
43   TInstr = Taicpu;
44   PInstr = ^TInstr;
45 
46 { ************************************************************************* }
47 { **************************** TCondRegs ********************************** }
48 { ************************************************************************* }
49 { Info about the conditional registers                                      }
50   TCondRegs = Object
51     Constructor Init;
52     Destructor Done;
53   End;
54 
55 { ************************************************************************* }
56 { **************************** TAoptBaseCpu ******************************* }
57 { ************************************************************************* }
58 
59   TAoptBaseCpu = class(TAoptBase)
60   End;
61 
62 
63 { ************************************************************************* }
64 { ******************************* Constants ******************************* }
65 { ************************************************************************* }
66 Const
67 
68 { the maximum number of things (registers, memory, ...) a single instruction }
69 { changes                                                                    }
70 
71   MaxCh = 3;
72 
73 { the maximum number of operands an instruction has }
74 
75   MaxOps = 3;
76 
77 {Oper index of operand that contains the source (reference) with a load }
78 {instruction                                                            }
79 
80   LoadSrc = 0;
81 
82 {Oper index of operand that contains the destination (register) with a load }
83 {instruction                                                                }
84 
85   LoadDst = 1;
86 
87 {Oper index of operand that contains the source (register) with a store }
88 {instruction                                                            }
89 
90   StoreSrc = 0;
91 
92 {Oper index of operand that contains the destination (reference) with a load }
93 {instruction                                                                 }
94 
95   StoreDst = 1;
96 
97   aopt_uncondjmp = A_JMP;
98   aopt_condjmp = A_Jcc;
99 
100 Implementation
101 
102 { ************************************************************************* }
103 { **************************** TCondRegs ********************************** }
104 { ************************************************************************* }
105 Constructor TCondRegs.init;
106 Begin
107 End;
108 
109 Destructor TCondRegs.Done; {$ifdef inl} inline; {$endif inl}
110 Begin
111 End;
112 
113 End.
114