1 { 2 Copyright (c) 1998-2002 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 80x86 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 29 { enable the following define if memory references can have a scaled index } 30 { define RefsHaveScale} 31 32 { enable the following define if memory references can have a segment } 33 { override } 34 { define RefsHaveSegment} 35 36 Interface 37 38 Uses 39 aasmcpu,AOptBase, cpubase; 40 41 Type 42 43 { type of a normal instruction } 44 TInstr = Taicpu; 45 PInstr = ^TInstr; 46 47 { ************************************************************************* } 48 { **************************** TCondRegs ********************************** } 49 { ************************************************************************* } 50 { Info about the conditional registers } 51 TCondRegs = Object 52 Constructor Init; 53 Destructor Done; 54 End; 55 56 { ************************************************************************* } 57 { **************************** TAoptBaseCpu ******************************* } 58 { ************************************************************************* } 59 60 TAoptBaseCpu = class(TAoptBase) 61 End; 62 63 64 { ************************************************************************* } 65 { ******************************* Constants ******************************* } 66 { ************************************************************************* } 67 Const 68 69 { the maximum number of things (registers, memory, ...) a single instruction } 70 { changes } 71 72 MaxCh = 3; 73 74 { the maximum number of operands an instruction has } 75 76 MaxOps = 5; 77 78 {Oper index of operand that contains the source (reference) with a load } 79 {instruction } 80 81 LoadSrc = 1; 82 83 {Oper index of operand that contains the destination (register) with a load } 84 {instruction } 85 86 LoadDst = 0; 87 88 {Oper index of operand that contains the source (register) with a store } 89 {instruction } 90 91 StoreSrc = 0; 92 93 {Oper index of operand that contains the destination (reference) with a load } 94 {instruction } 95 96 StoreDst = 1; 97 98 99 aopt_uncondjmp = A_B; 100 aopt_condjmp = A_BC; 101 102 Implementation 103 104 { ************************************************************************* } 105 { **************************** TCondRegs ********************************** } 106 { ************************************************************************* } 107 Constructor TCondRegs.init; 108 Begin 109 End; 110 111 Destructor TCondRegs.Done; {$ifdef inl} inline; {$endif inl} 112 Begin 113 End; 114 115 End. 116