


/* EPC Imp to C Translation Release 4 Version Apr 95 */


#include "imptoc.h"

/**                                                                 cgc45.2.inc*/
/** 26-06-95 Added STKSWOPPED additional bits                                */
/**                                                                 cgc45.1.inc*/
/** 16-02-95  Added exnamemax value for PSAL                                 */
/**                                                                 cgc45.inc*/
/** 19-12-94  Change intval to intvalue in stkfmt to aid translation to C    */
/**                                                                cgc44.1.inc*/
/** 19-08-94  Added nextireg to paramfmt. (pds)                              */
/**                                                                cgc44.inc */
/** 21-04-94  Added new STKPART and STKFRAME flags to indicate partial       */
/**           data accesses and frame accesses. (rt)                         */
/**                                                                cgc43.inc */
/** 21-03-94  Added new register tracking type CONST AT. (rt)                */
/**                                                                cgc42.inc */
/** 24-02-94  Put Regaddr back into SimpleRegForm.                           */
/**                                                                cgc41.inc */
/** 10-01-94  Added new fields to SwTabFmt for switch id and PIC label. Also */
/**           added new IsNonMemForm array for E-stack forms. (rt)           */
/**                                                                          */
/** 09-10-92  Added Volatile support consts and paramtype Floatval           */
/**                                                                cgc40.inc */
/** 12-10-93  Merge of F77 and USL C M88K code generators and MIPS           */
/**           code generator prior to M88K GIS development. Made AdId        */
/**           field in StkFmt 32 bits again. (rt)                            */
/**                                                                cgc39.inc */
/** 22-06-93  Modified StkFmt so that Adid field is made into a short rather */
/**           than size (which may need to be bigger than 32K). (rt)         */
/**                                                                cgc38.inc */
/** 11-06-93  Merge of MIPS and SPARC code generators for GIS port. Added    */
/**           enumeration for switch table types from boconsts.inc. Also added*/
/**           Domain field to StkFmt. Added line prefix records. (rt)        */
/**                                                                cgc37.inc */
/** 03-06-93  Increased fields in Exdatafmt for C++ virtual functions. (pds) */
/**                                                                cgc36.1.inc*/
/** 28-10-93  Bitcompare for eop(TMASK). (md)                                */
/**                                                                cgc36.inc */
/** 07-03-93  Used for M88K. (pds)                                           */
/**                                                                cgc35.inc */
/** 03-12-92  Add rounding to the calculation of ExDataSize to allow         */
/**           ExNameSize to be any size, not just mult of 4. (tkr)           */
/**                                                                cgc34.inc */
/** 09-10-92  Added Volatile support consts and paramtype Floatval           */
/**           to distinguish C Float params where these need special         */
/**           handling(pds)                                                  */
/**                                                          cgc33.inc       */
/** 25-09-91  Constants and record formats relating to the back-end          */
/**           optimiser have been removed from this file and placed in       */
/**           boconsts (backend optimiser constants). The backend optimiser  */
/**           is designed to be generic across all architectures (including  */
/**           non-Emachine 4 such as VME). (rt)                              */
/**                                                          cgc32.inc       */
/** 27-08-91  Merge of M88110 FORTRAN changes with generic code generator. (rt)*/
/**                                                                          */
/*-------------------- START OF M88110 FORTRAN CHANGES --------------------------*/
/**                                                          cgc31.2.inc     */
/** 25-07-91  Renamed the array RegAddrForm to IsAddrForm and                */
/**           added the entries AddrDir and DirModAddr to it                 */
/**           (copied from Richard's cgc30.4.1).                             */
/**                                                          cgc31.1.inc     */
/** 23-07-91  In the array EFormMemKeys, associated DirAddr                  */
/**           and TempAddr with a DATAAT (should at least                    */
/**           improve register memory of base addresses for                  */
/**           Fortran COMPLEX's).                                            */
/**                                                          cgc31.inc       */
/** 18-06-91  M88K: added the field Entryfregs to Procfmt                    */
/**           for M88110 and increased the field rsave from                  */
/**           32 entries to 64.                                              */
/**                                                                          */
/**           M88K: added the fields xref and xdef to Instrfmt               */
/**           to hold a bit vector of referenced and defined                 */
/**           floating point (x0-x31) registers                              */
/**                                                                          */
/**           Defined Target-Dependent values for maxinstrrecsize            */
/**                                                                          */
/**           required by cprocs42 and xprocs6                               */
/**                                                                          */
/*--------------------- END OF M88110 FORTRAN CHANGES ---------------------------*/
/**                                                          cgc30.4.2.inc   */
/** 28-05-91  Merge of PASCAL and MODULA changes to generic code generator. (rt)*/
/** 04-07-91  Changed description of tracking memory to handle support       */
/**           of up to 64K of common areas. (rt)                             */
/**                                                          cgc30.4.1.inc   */
/** 03-07-91  Increased ExNameMax to 224 characters for ANSI C and           */
/**           C++. This change is primarily to handle C++ encoded            */
/**           names. (sl+rt)                                                 */
/**                                                          cgc30.4.inc     */
/** 20-06-91  Added DirModAddr form to the IsAddrForm array. (rt)            */
/** 18-06-91  Renamed the array RegAddrForm to IsAddrForm and added the      */
/**           entry AddrDir. (rt)                                            */
/** 14-06-91  Added SLOT COPIED constant. (rt)                               */
/**                                                          cgc30.3.inc     */
/** 13-06-91  Extended the INDREGDT tracking memory type to work with        */
/**           IndRegModVal which have a literal modifier. (rt)               */
/**                                                          cgc30.2.inc     */
/** 12-06-91  Added an INDREGDT tracking memory type. This holds             */
/**           tracking information about a IndRegVal when the address is     */
/**           a register variable. (rt)                                      */
/**                                                          cgc30.1.inc     */
/** 06-06-91  Added an INDMODDT tracking memory type. This holds             */
/**           tracking information about a IndDirModVal (with a literal      */
/**           modifier). (rt)                                                */
/**                                                          cgc30.inc       */
/** 28-05-91  Merge of PASCAL and MODULA changes to generic code generator. (rt)*/
/**                                                                          */
/*-------------------- START OF PASCAL/MODULA CHANGES ---------------------------*/
/**                                                          cgconsts22.1.inc*/
/** 03-07-90  Add MODULA, and why wasn't it in already!?!.                   */
/** 23-07-90  Alter ExdataFmt to allow external names up to ExnameMax        */
/**           characters long.                                               */
/**                                                             (tkr)        */
/**                                                                          */
/*--------------------- END OF PASCAL/MODULA CHANGES ----------------------------*/
/**                                                          cgc29.inc       */
/** 18-05-91  Removed ADDR AT from the enumeration of register tracking      */
/**           types. (rt)                                                    */
/** 17-05-91  Removed IndRegVal from the array RegAddrForm. (rt)             */
/** 14-05-91  Merge of M88K FORTRAN and M88K ANSI C code generators. (rt)    */
/**                                                                          */
/**--------------------- START OF M88K FORTRAN CHANGES --------------------------*/
/**                                                          cgconst27.inc   */
/** 03-04-91  Increased Stklimit from 63 to 127 (for the FORTRAN melcor package)*/
/**                                                                          */
/**           Change Stkfmt to expand the fields Base and ModBase from one to*/
/**           two bytes (otherwise code generator stands nop chance of handling*/
/**           more than 255 common areas)                                    */
/**                                                                          */
/**---------------------- END OF M88K FORTRAN CHANGES ---------------------------*/
/**                                                                          */
/**                                                          cgc28.inc       */
/** 18-02-91  Moved constants for register tracking memory from              */
/**           machine specific include file to this file. (rt)               */
/**                                                          cgc27.inc       */
/** 08-02-91  Added enumeration for the types of register extension. (rt)    */
/** 30-01-91  Added the arrays SimpleRegForm, DirAddrForm and                */
/**           RegAddrForm. (rt)                                              */
/** 28-01-91  Merged in changes from m88k version to make a common           */
/**           M88K and SPARC version. (rt)                                   */
/**                                                                          */
/************************** M88K CHANGE HISTORY **********************************/
/**                                                          cgconsts26.inc  */
/** 31 Jan 91  Increased string NAME in exdatafmt to 32                      */
/**            Increased Exdatasize to 36 for name                           */
/**                                                          cgconsts25.inc  */
/** 28 Nov 90  add flags field to exdatafmt as SPARC                         */
/** 13 Nov 90  following changes for m88k C:                                 */
/**                                                                          */
/**            Add IsIndRegForm array.                                       */
/**            Follow fortran and introduce EXdatasize and field             */
/**                   _flags to exdatafmt.                                   */
/**            Added Struct type for struct val fn result.                   */
/**            Altered SwTabFmt to allow for sparse switches.  Also added    */
/**            new constants to indicate the Mode of a Switch Table and      */
/**            a new bit to indicate a fragment holds a switch (sparse) table.*/
/**                                                                          */
/**            (compatible with a sparc.inc which recognises                 */
/**             the new value (13) for OVERFLOW)                             */
/**                                                                          */
/**                                                          cgconsts24.inc  */
/** 28 Aug 90  add chain field to instrfmt record for 88k                    */
/**                                                          cgconsts23.inc  */
/** 22 Aug 90  additions to support 'compiling contexts'                     */
/**                                                          cgconsts22.inc  */
/** 11 May 90  add LOAD INSTR and STORE INSTR property names                 */
/**                                                                          */
/**                                                          cgconsts21.inc  */
/** 11 Apr 90  add NEVER to the list of condition names, also                */
/**            renumber OVERFLOW                                             */
/**                                                                          */
/*******************************************************************************/
/**                                                          cgconsts20.3.inc*/
/** 14-10-90  Add Dataref for areaprops and Xname.                           */
/** 18-10-90  Add IsIndRegForm array.                                        */
/** 13-10-90  Follow fortran and introduce EXdatasize and field              */
/**           _flags to exdatafmt.                                           */
/**                                                          cgconsts20.2.inc*/
/** 08 Aug 90  Added Struct type for struct val fn result.                   */
/** 25 Jul 90  Altered SwTabFmt to allow for sparse switches.  Also added    */
/**            new constants to indicate the Mode of a Switch Table and      */
/**            a new bit to indicate a fragment holds a switch (sparse) table.*/
/**                                                                          */
/**                                                          cgconsts20.1.inc*/
/** 10 May 90  Add array ismodform to flag address forms                     */
/**            which imply a modifier                                        */
/**                                                                          */
/**             !*  SPARC Release 2.4.1 and earlier  *!                      */
/**                                                          cgconsts20.inc  */
/**  7 Apr 90  merge to produce an (almost) common version                   */
/**                                                          cgconsts19.inc  */
/** 28 Mar 90  Add new data type MisRealType (misaligned long real)          */
/**            Add new pseudo instruction PROCEND                            */
/**            Add constant Unassigned Pattern                               */
/**                                                                          */
/**                                                          cgconsts18.inc  */
/**  5 Mar 90  Add alias field Imagreg to Stkfmt to keep in step with Sparc  */
/**                                                                          */
/**                                                          cgconsts17.inc  */
/** 26 Feb 90  Fragment reorganisation and instruction scheduling            */
/**             .Add new field (uses) to fragfmt and alias address to final  */
/**             .Rename spare1 in instrfmt to props                          */
/**             .Define some constants for instrfmt and fragfmt props fields */
/**                                                                          */
/**                                                          cgconsts16.inc  */
/** 30 Jan 90  Add new param info type values CHARval, CHARlenval,           */
/**            ResAddrval and ResLenval                                      */
/**                                                                          */
/**            Add regsave array to Procfmt record format                    */
/**                                                                          */
/**            Add constants ExtractII..InsertUI and                         */
/**            BitWordShift..BitFieldRotate for Pascal                       */
/**                                                                          */
/**                                                          cgconsts15.inc  */
/** 21 Jan 90  Alias the Modbase field of Stkfmt to BitSize and add          */
/**            addressing form DirBitModAddr                                 */
/**            Add OVERFLOW to list of conditions GT..LE, OVERFLOW, ALWAYS   */
/**                                                                          */
/**                                                          cgconsts14.inc  */
/**  8 Jan 90  add SetType constant                                          */
/**                                                                          */
/**                                                          cgconsts13.inc  */
/** 20 Dec 89  alter value of Icompare, Rcompare and UIcompare.              */
/**                                                                          */
/**                                                          cgconsts12.inc  */
/**  6 Dec 89  add field entrypairs to Procfmt record format                 */
/**            add register use constants from m88kregs                      */
/**                                                                          */
/**                                                          cgconsts11.inc  */
/**  6 Dec 89  add FIX... constants for use with Pfix2                       */
/**                                                                          */
/**                                                          cgconsts10.inc  */
/** 29 Nov 89  add TKR's constants for unsigned types and other things       */
/**                                                                          */
/**                                                          cgconsts9.inc   */
/** 24 Oct 89  add field markerad to Procfmt record format                   */
/**                                                                          */
/**                                                          cgconsts8.inc   */
/** 10 Oct 89  reassign some fields of instrfmt format for m88k              */
/**  9 Oct 89  added some m88k-specific fields to paramfmt record format     */
/**                                                                          */
/**                                                          cgconsts7.inc   */
/**  8 Oct 89  added auxstack lab field to procfmt record format             */
/**                                                                          */
/**                                                          cgconsts6.inc   */
/**  6 Oct 89  added paramfmt record format for recording                    */
/**            parameter type and size info in Mprecall                      */
/**            added %CONSTS for remaining parameter types                   */
/**                                                                          */
/**                                                          cgconsts5.inc   */
/**  2 Oct 89  added instruction group type SWITCHTAB                        */
/**            altered Swtabfmt                                              */
/**                                                                          */
/**                                                          cgconsts4.inc   */
/**  1 Oct 89  corrected entries in isregform array                          */
/**                                                                          */
/**                                                          cgconsts3.inc   */
/** 28 Sep 89  added instruction group type PROCRETN                         */
/**            added const maxfragrecsize                                    */
/**                                                                          */
/**                                                          cgconsts2.inc   */
/** 14 Sep 89  added proc fmt record format                                  */
/**                                                                          */
/**                                                          cgconsts1.inc   */
/**  8 Sep 89  base version (adapted from sparc version)                     */
/**                                                                          */
/*************************************************************************   */
/*                                                                       *   */
/*  Constant definitions common to code generation modules               *   */
/*                                                                       *   */
/*************************************************************************   */
/**                                                                          */
#define Ptrval 0	/* These are to be used as parameter types */
#define Intval 1
#define Realval 2
#define Cmplxval 3
#define Structval 4
#define Stringval 5
#define Uintval 6
#define CHARval 7
#define CHARlenval 8
#define Floatval 9	/* C float if different from realval */
			/* specials may be needed           */
#define ResAddrval 14
#define ResLenval 15

#define IntType 1	/* These are to be used as types in Estack */
#define RealType 2	/* entries                                 */
#define UintType 3
#define SetType 4
#define MisRealType 5
#define StructType 6
#define MisIntType 7
#define MisUintType 8
#define MinType IntType
#define MaxType MisUintType

#define Icompare (IntType<<8)
#define Rcompare (RealType<<8)
#define UIcompare (UintType<<8)
#define Bitcompare (4<<8)

#define LoadIntVal IntType
#define LoadRealVal RealType
#define LoadUintVal UintType
#define LoadMisRealVal MisRealType
#define LoadMisIntVal MisIntType
#define LoadMisUintVal MisUintType
#define StoreIntVal (LoadIntVal+8)	/* WARNING: do not change the   */
#define StoreRealVal (LoadRealVal+8)	/* value 8 unless making changes*/
#define StoreUintVal (LoadUintVal+8)	/* to the code module           */
#define StoreMisRealVal (LoadMisRealVal+8)
#define StoreMisIntVal (LoadMisIntVal+8)
#define StoreMisUintVal (LoadMisUintVal+8)

/**     Constants for switch table type (Tab_Mode)                           */

#define NOINDEXJUMP 1
#define INDEXJUMP 2
#define SPARSESWITCH 4

/** Enumerated type of possible register extensions                          */

#define REGUNEXTENDED 0
#define REGSIGNEDEXT 1
#define REGUNSIGNEDEXT 2
#define REGUNKNOWNEXT 3

#define BitWordShift 0
#define BitFieldExtract 1
#define BitSet 2
#define BitTest 3
#define BitClear 4
#define BitFieldRotate 5

#define ExtractII 0
#define ExtractUU 1
#define ExtractIU 2
#define ExtractUI 3
#define InsertII 4
#define InsertUU 5
#define InsertIU 6
#define InsertUI 7

#define GT 0
#define LT 1
#define EQ 2
#define NE 3
#define GE 4
#define LE 5
#define BCTZ 6
#define BCTNZ 7
#define OVERFLOWcc 13
#define NEVER 14
#define ALWAYS 15

#define BLANKCOMMON 1
#define NAMEDCOMMON 2
#define DATAREF 4
#define INITIALISED (0x400)

#define UnassignedPattern (0x81818181)


/**************************************************************************/
/**                                                                      **/
/**                          E-MACHINE FORMS                             **/
/**                                                                      **/
/**************************************************************************/

#define LitVal 0		/*  lit        */
#define ConstVal 1		/*  const      */
#define RegVal 2		/*  (reg)      */
#define FregVal 3		/*  (freg)     */
#define TempVal 4		/*  (temp)     */
#define DirVal 5		/*  (dir)      */
#define IndRegVal 6		/* ((reg))     */
#define IndTempVal 7		/* ((temp))    */
#define IndDirVal 8		/* ((dir))     */
#define AddrConst 9		/*  @const     */
#define AddrDir 10		/*  @dir       */
#define RegAddr 11		/*  (reg) is @ */
#define TempAddr 12		/*  (temp) is @*/
#define DirAddr 13		/*  (dir) is @ */
#define AddrDirMod 14		/*  @dir+M     */
#define RegModAddr 15		/*  (reg)+M    */
#define TempModAddr 16		/*  (temp)+M   */
#define DirModAddr 17		/*  (dir)+M    */
#define IndRegModVal 18		/* ((reg)+M)   */
#define IndTempModVal 19	/* ((temp)+M)  */
#define IndDirModVal 20		/* ((dir)+M)   */
#define AddrDirModVal 21	/* (@dir+M)    */
#define RegBitAddr 22		/*  (reg) is @ */
#define RegBitModAddr 23	/*  (reg)+M    */
#define IndDispModVal 24	/*  ((disp)+M) */
#define AddrDispModVal 25	/*  @disp+M    */
#define DispModAddr 26		/*  (disp)+M   */
#define Regvar 27		/*  Regvar     */
#define Fregvar 28		/*  Fregvar    */
#define Flitval 29		/*  flit       */
#define DirBitModAddr 30	/*  (dir)+M    */

#define Regflag 32	/*used to speedup search for reguse*/

static const unsigned char IsRegForm [31+1] = {
	0,  0,  1,  1,  0,  0,  1,  0,
	/*RegVal,FregVal,IndRegVal,                   */
	0,  0,  0,  1,  0,  0,  0,  1,
	/* RegAddr,      RegModAddr,                  */
	0,0,1,0,0,0,1,1,
	/* IndRegModVal,RegBitAddr,RegBitModAddr      */
	0,0,0,1,1,0,0,0
	/*Regvar,Fregvar                              */
};

static const unsigned char IsIndRegForm [31+1] = {
	0,
	0,0,0,0,0,1,0,
	0,0,0,1,0,0,0,1,
	0,0,1,0,0,0,1,1,
	0,0,0,0,0,0,0,0
	/*IndRegVal,RegAddr,RegModAddr,IndRegModVal,RegBitAddr,RegBitModAddr*/
};

static const unsigned char IsModForm [31+1] = {
	0,
	0,0,0,0,0,0,0,
	0,0,0,0,0,0,1,1,
	1,1,1,1,1,1,0,1,
	1,1,1,0,0,0,1,0
	/*AddrDirMod,RegModAddr,TempModAddr,DirModAddr,IndRegModVal,IndTempModVal, */
	/*IndDirModVal,AddrDirModVal,RegBitModAddr,IndDispModVal,AddrDispModVal,   */
	/*DispModAddr,DirBitModAddr                                                */
};

static const unsigned char SimpleRegForm [31+1] = {
	0,
	0,1,1,0,0,0,0,
	0,0,0,1,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,1,1,0,0,0
	/*RegVal,FregVal,Regaddr,Regvar,Fregvar*/
};

static const unsigned char DirAddrForm [31+1] = {
	0,
	0,0,0,0,0,0,0,
	0,0,0,1,1,1,0,1,
	1,1,0,0,0,0,1,1,
	0,0,1,0,0,0,1,0
	/*RegAddr,TempAddr,DirAddr,RegModAddr,TempModAddr,DirModAddr,*/
	/*RegBitAddr,RegBitModAddr,DispModAddr,DirBitModAddr         */
};

static const unsigned char IsAddrForm [31+1] = {
	0,
	0,0,0,0,0,0,0,
	0,1,1,1,0,0,1,1,
	0,1,0,0,0,0,1,1,
	0,0,0,0,0,0,0,0
	/*AddrDir,RegAddr,RegModAddr,DirModAddr,RegBitAddr,RegBitModAddr,*/
	/*AddrDirMod, AddrConst                                          */
};

static const unsigned char IsDomAddrForm [31+1] = {
	0,
	0,0,0,1,1,1,1,
	1,1,1,1,1,1,1,1,
	1,1,1,1,1,1,1,1,
	1,1,1,0,0,0,1,0
	/*TempVal,DirVal,IndRegVal,IndTempVal,IndDirVal,AddrConst,AddrDir,RegAddr,*/
	/*TempAddr,DirAddr,AddrDirMod,RegModAddr,TempModAddr,DirModAddr,          */
	/*IndRegModVal,IndTempModVal,IndDirModVal,AddrDirModVal,RegBitAddr,       */
	/*RegBitModAddr,IndDispModVal,AddrDispModVal,DispModAddr,DirBitModAddr    */
};

static const unsigned char IsDomAccessForm [31+1] = {
	0,
	0,0,0,1,1,1,1,
	1,0,0,0,1,1,0,0,
	1,1,1,1,1,1,0,0,
	1,0,1,0,0,0,1,0
	/*TempVal,DirVal,IndRegVal,IndTempVal,IndDirVal,TempAddr,DirAddr,*/
	/*TempModAddr,DirModAddr,IndRegModVal,IndTempModVal,IndDirModVal,*/
	/*AddrDirModVal,IndDispModVal,DispModAddr,DirBitModAddr          */
};


/**     FIXUP  TYPES                                                         */

#define FIXfullword 0	/* normal 32-bit fixup */
#define FIXupper 1	/* hi16(..) type fixup */
#define FIXlower 2	/* lo16(..) type fixup */
#define FIXpcrel 3	/* 26-bit PC relative  */


#if((Language==PASCAL)||(Language==MODULA)) 
#define Pascalchar 0
#define PascalFixedstring 1
#define PascalVariableString 2
#define ExnameMax 71	/* maximum length of external name */

#else

#if((Language==CCOMP)||(Language==PSAL)) 
#define ExnameMax 224	/* maximum length of external name */

#else

#if(LanguageVariant==FORTRAN90 || AllowReverseEndianData!=0) 
#define ExnameMax 65

#else
#define ExnameMax 32	/* maximum length of external name */

#endif
#endif
#endif;

#define Stklimit 127


/*************************************************************************   */
/**                                                                      *   */
/**                CONSTANTS FOR REGISTER TRACKING MEMORY                *   */
/**                                                                      *   */
/*************************************************************************   */

#define DATAAT 1
#define CONSTAT 2
#define ADDROF 3
#define HIGHADDR 4
#define INDDATA 5
#define SCALE1 6
#define SCALE2 7
#define SCALE3 8
#define INDMODDT 9
#define CONSTINT 10
#define INDREGDT 11
#define SCALERV1 12
#define SCALERV2 13
#define SCALERV3 14
#define PARAMV 15
#define DISPLAYI 16
#define DISPLAYV 17

static const unsigned char VolatileMem [DISPLAYV-(DATAAT)+1] = {
	1,
	0,0,0,1,1,1,1,
	1,0,1,1,1,1,1,0,
	1};


#if(Language==CCOMP) 

/** For C and C++ we are able to use the INDREGDT register memory as         */
/** all modifications to a register variable pass through the                */
/** routine CTarget                                                          */

static const unsigned char EFormMemKeys [31+1] = {
        /*LitVal*/        CONSTINT,       /*ConstVal*/              0,
        /*RegVal*/               0,       /*FregVal*/               0,
        /*TempVal*/         DATAAT,       /*DirVal*/           DATAAT,
        /*IndRegVal*/     INDREGDT,       /*IndTempVal*/      INDDATA,
        /*IndDirVal*/      INDDATA,       /*AddrConst*/             0,
        /*AddrDir*/         ADDROF,       /*RegAddr*/               0,
        /*TempAddr*/        DATAAT,       /*DirAddr*/          DATAAT,
        /*AddrDirMod*/           0,       /*RegModAddr*/            0,
        /*TempModAddr*/          0,       /*DirModAddr*/            0,
        /*IndRegModVal*/  INDREGDT,       /*IndTempModVal*/  INDMODDT,
        /*IndDirModVal*/  INDMODDT,       /*AddrDirModVal*/         0,
        /*RegBitAddr*/           0,       /*RegBitModAddr*/         0,
        /*IndDispModVal*/  DISPLAYV,      /*AddrDispModVal*/        0,
        /*DispModAddr*/          0,       /*Regvar*/                0,
        /*Fregvar*/              0,       /*FlitVal*/        CONSTINT,
        /*DirBitModAddr*/        0,                               0
};


#else

static const unsigned char EFormMemKeys [31+1] = {
        /*LitVal*/        CONSTINT,       /*ConstVal*/              0,
        /*RegVal*/               0,       /*FregVal*/               0,
        /*TempVal*/         DATAAT,       /*DirVal*/           DATAAT,
        /*IndRegVal*/            0,       /*IndTempVal*/      INDDATA,
        /*IndDirVal*/      INDDATA,       /*AddrConst*/             0,
        /*AddrDir*/         ADDROF,       /*RegAddr*/               0,
        /*TempAddr*/        DATAAT,       /*DirAddr*/          DATAAT,
        /*AddrDirMod*/           0,       /*RegModAddr*/            0,
        /*TempModAddr*/          0,       /*DirModAddr*/            0,
        /*IndRegModVal*/         0,       /*IndTempModVal*/  INDMODDT,
        /*IndDirModVal*/  INDMODDT,       /*AddrDirModVal*/         0,
        /*RegBitAddr*/           0,       /*RegBitModAddr*/         0,
        /*IndDispModVal*/        0,       /*AddrDispModVal*/        0,
        /*DispModAddr*/          0,       /*Regvar*/                0,
        /*Fregvar*/              0,       /*FlitVal*/        CONSTINT,
        /*DirBitModAddr*/        0,                               0
};

#endif


/*************************************************************************   */
/**                                                                      *   */
/**                           RECORD FORMATS                             *   */
/**                                                                      *   */
/*************************************************************************   */

#define SIZELINEPREFIXFMT 8
#define SIZELINEPREFIXCHUNK (256*SIZELINEPREFIXFMT)
struct LinePrefixFmt{
	int line;
	int parent;
};


struct labadfmt{
	int labkey;
	int area;
	int offset;
	int reffrag;
};


struct Swrecfmt{
	int key;
	int tab;
};


struct SwPairFmt{
	int Entry;
	int Label;
};


struct Swtabfmt{
	int Mode;
	int Reffrag;
	int Lower;
	int Labbase;
	int Entries;
	int Rangelab;
	int SlotsUsed;
	int SwitchId;
	int PIClabel;
	union {
		int R [4095+1];
		struct SwPairFmt S [2043+1];
	} u0;
};

#define swtabbasesize 36

struct Exdatafmt{
	int PutId;
	int Refad;
	int DesId;
	int Desrefad;
	int Ca;
	int Props;
	short int flags;
	short int align;
	short int Area;
	short int backlink;
	char Name[33];
};
#define Exdatasize (((((ExnameMax+1)+3)&0xFFFFFFFC)+(4/*bytes*/ *8 /*other fields*/)))

/* Flags signify as follows                                                  */
/* 2**0 set dont tamper with name                                            */
/* 2**1 set data reference otherwise code (Unix doesnt care AIX does)        */
/* 2**2 set proc is internal (Again AIX needs to know so that the entry descriptors*/
/*                            and glue code can be done correctly)           */


struct Stkfmt{
	unsigned char Form;
	unsigned char Type;
	unsigned char Reg;
	unsigned char Modreg;
	short int Base;
	short int ModBase;
	unsigned char Flags;	/* Hold VOLATILE marker */
	unsigned char BitSize;
	unsigned char Scale;
	unsigned char Modform;
	int Cmval;
	double Rlval;
	int Offset;
	int Intvalue;
	float Rval;
	int Modoffset;
	int Modintval;
	int Domain;
	char *AdId;
	int Size;
	unsigned char Imagreg;
};


/**     Constants for stkfmt flags field                                     */
/**  (STKPART and STKFRAME are temporary flags used during code generation   */
/**   of Estk memory accesses)                                               */

#define STKVOL 1	/* Estk item is volatile                */
#define STKCONST 2	/* Estk item is a constant access       */
#define STKPART 4	/* access is partial of misaligned data */
#define STKFRAME 8	/* access is to local stack frame       */
#define STKSWOPPED 16	/* access is to a byteswopped item	 */
#define STKBSSWOPPED 32	/* Access is to item whose base is swopped */
#define STKIXSWOPPED 64	/* Access is to item whose index is swopped*/


struct paramfmt{
	int numpars;		/* number of parameters */
	int paramsize;		/* total size in bytes */
	int offset;		/* next param's home offset */
	int firstpar;		/* index into Parwords array */
	int nextpar;		/*  "     "       "      "   */
	int loadedpars;		/* bitmap of loaded param regs */
	int savedpars;		/*   "    "  saved   "     "   */
	int stackadj;		/* size of nested call stack adj   */
	int hidden;		/* contains hidden result param */
	short int nextireg;	/* Next reg used when int passed */
	short int nextfpreg	/* Next reg used when real passed*/;
};

/* last 2 of paramfmt added as specials for rs6000 other can ignore          */

/***************************** end of cgc.inc ************************************/


/* end of automatic translation */

