This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc-2.95.2 internal compiler error with template


Sorry I didn't narrow this down any more.  The appended .ii file causes the
following error message:

    [rutt@gertie ccbe]$ /usr/xtensa/stools/bin/g++ -c universe_test.ii
    /user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h: In instantiation of `UNIVERSE<X *,X::Mapper>':
    /user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe_test.cpp:24:   instantiated from here
    /user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h:277: Internal compiler error 109.
    /user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h:277: Please submit a full bug report.
    /user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h:277: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.

I'm using gcc-2.95.2 compiled on RH linux 6.1.  Here is the .ii file:

# 1 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe_test.cpp"
# 1 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h" 1
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 




# 1 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/btype.h" 1
 
 
 
 
 



 





 


 
 
 
 
 









# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 1 3
 


 





 
# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/syslimits.h" 1 3
 





# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 1 3
 


 

# 114 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 3



# 1 "/usr/include/limits.h" 1 3
 

















 






# 1 "/usr/include/features.h" 1 3
 




















 


























































 



















 





 



 







 
# 137 "/usr/include/features.h" 3


 









 





 



























# 195 "/usr/include/features.h" 3


































 



 








 




 

# 1 "/usr/include/sys/cdefs.h" 1 3
 




















 




 





 








 




# 71 "/usr/include/sys/cdefs.h" 3


 







 



# 103 "/usr/include/sys/cdefs.h" 3



 








 















 








 








 









 







# 249 "/usr/include/features.h" 2 3


 








 





 

 








# 1 "/usr/include/gnu/stubs.h" 1 3
 






































# 277 "/usr/include/features.h" 2 3




# 26 "/usr/include/limits.h" 2 3



 
# 1 "/usr/include/bits/posix1_lim.h" 1 3
 

















 









 

 


 


 


 


 


 


 


 



 


 


 


 


 



 


 


 


 


 


 


 


 


 


 


 


 



 


 


 


 


 



 
# 1 "/usr/include/bits/local_lim.h" 1 3
 


















 





 
# 1 "/usr/include/linux/limits.h" 1 3



















# 27 "/usr/include/bits/local_lim.h" 2 3


 





 

 


 

 


 

 


 



 

# 126 "/usr/include/bits/posix1_lim.h" 2 3








 







# 30 "/usr/include/limits.h" 2 3




# 1 "/usr/include/bits/posix2_lim.h" 1 3
 

















 







 


 


 


 


 




 




 



 


 



 




 




































# 34 "/usr/include/limits.h" 2 3








 





 

# 121 "/usr/include/limits.h" 3




  








# 117 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 2 3




# 7 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/syslimits.h" 2 3


# 11 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 2 3





 



 



 




 





 



 












 

 




 



 








 



 













 



# 107 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 3




 









# 32 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/btype.h" 2

# 1 "/usr/include/time.h" 1 3
 

















 










extern "C" { 




 


# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 1 3






 


# 19 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3



 


 





 


# 61 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 


































typedef unsigned int size_t;






















 




 

# 271 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


# 283 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 

# 317 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




 





















# 38 "/usr/include/time.h" 2 3


 

# 1 "/usr/include/bits/time.h" 1 3
 


















 







 


 





 







# 59 "/usr/include/bits/time.h" 3
 
# 42 "/usr/include/time.h" 2 3


 












# 1 "/usr/include/bits/types.h" 1 3
 

















 









# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 1 3






 


# 19 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3



 


 





 


# 61 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 


# 188 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3





 




 

# 271 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


# 283 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 

# 317 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




 





















# 29 "/usr/include/bits/types.h" 2 3


 
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;

__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __quad_t;
# 48 "/usr/include/bits/types.h" 3

typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;

__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;

typedef __quad_t *__qaddr_t;

typedef __u_quad_t __dev_t;		 
typedef __u_int __uid_t;		 
typedef __u_int __gid_t;		 
typedef __u_long __ino_t;		 
typedef __u_int __mode_t;		 
typedef __u_int __nlink_t; 		 
typedef long int __off_t;		 
typedef __quad_t __loff_t;		 
typedef int __pid_t;			 
typedef int __ssize_t;			 
typedef long int __rlim_t;		 
typedef __quad_t __rlim64_t;		 
typedef __u_int __id_t;			 

typedef struct
  {
    int __val[2];
  } __fsid_t;				 

 
typedef int __daddr_t;			 
typedef char *__caddr_t;
typedef long int __time_t;
typedef long int __swblk_t;		 

typedef long int __clock_t;

 
typedef unsigned long int __fd_mask;

 


 




 
typedef struct
  {
     





    __fd_mask __fds_bits[1024  / (8 * sizeof (__fd_mask)) ];


  } __fd_set;


typedef int __key_t;

 
typedef unsigned short int __ipc_pid_t;


 

 
typedef long int __blkcnt_t;
typedef __quad_t __blkcnt64_t;

 
typedef __u_long __fsblkcnt_t;
typedef __u_quad_t __fsblkcnt64_t;

 
typedef __u_long __fsfilcnt_t;
typedef __u_quad_t __fsfilcnt64_t;

 
typedef __u_long __ino64_t;

 
typedef __loff_t __off64_t;

 
typedef int __t_scalar_t;
typedef unsigned int __t_uscalar_t;

 
typedef int __intptr_t;


 





# 57 "/usr/include/time.h" 2 3


 
typedef __clock_t clock_t;









 
typedef __time_t time_t;









 

struct timespec
  {
    long int tv_sec;		 
    long int tv_nsec;		 
  };






 
struct tm
{
  int tm_sec;			 
  int tm_min;			 
  int tm_hour;			 
  int tm_mday;			 
  int tm_mon;			 
  int tm_year;			 
  int tm_wday;			 
  int tm_yday;			 
  int tm_isdst;			 


  long int tm_gmtoff;		 
  __const char *tm_zone;	 




};


 

extern clock_t clock  (void)  throw ()  ;

 
extern time_t time  (time_t *__timer)  throw ()  ;

 
extern double difftime  (time_t __time1, time_t __time0)  throw ()  
     __attribute__ ((__const__));

 
extern time_t mktime  (struct tm *__tp)  throw ()  ;


 


extern size_t strftime  (char *__restrict __s, size_t __maxsize,
			     __const char *__restrict __format,
			     __const struct tm *__restrict __tp)  throw ()  ;









 

extern struct tm *gmtime  (__const time_t *__timer)  throw ()  ;

 

extern struct tm *localtime  (__const time_t *__timer)  throw ()  ;


 

extern struct tm *__gmtime_r  (__const time_t *__restrict __timer,
				   struct tm *__restrict __tp)  throw ()  ;
extern struct tm *gmtime_r  (__const time_t *__restrict __timer,
				 struct tm *__restrict __tp)  throw ()  ;

 

extern struct tm *localtime_r  (__const time_t *__restrict __timer,
				    struct tm *__restrict __tp)  throw ()  ;


 

extern char *asctime  (__const struct tm *__tp)  throw ()  ;

 
extern char *ctime  (__const time_t *__timer)  throw ()  ;


 

 

extern char *asctime_r  (__const struct tm *__restrict __tp,
			     char *__restrict __buf)  throw ()  ;

 
extern char *ctime_r  (__const time_t *__restrict __timer,
			   char *__restrict __buf)  throw ()  ;



 
extern char *__tzname[2];	 
extern int __daylight;		 
extern long int __timezone;	 



 
extern char *tzname[2];

 

extern void tzset  (void)  throw ()  ;



extern int daylight;
extern long int timezone;



 

extern int stime  (__const time_t *__when)  throw ()  ;



 






 


 
extern time_t timegm  (struct tm *__tp)  throw ()  ;

 
extern time_t timelocal  (struct tm *__tp)  throw ()  ;

 
extern int dysize  (int __year)  throw ()  ;




 
extern int nanosleep  (__const struct timespec *__requested_time,
			   struct timespec *__remaining)  throw ()  ;



# 264 "/usr/include/time.h" 3


# 274 "/usr/include/time.h" 3



} 




# 33 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/btype.h" 2




# 1 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/vbtype.h" 1
 
 
 
 
 



 





 
 







typedef signed char         S8;
typedef short               S16;
typedef long                S32;



typedef long long           S64;


typedef unsigned char       U8;
typedef unsigned short      U16;
typedef unsigned long       U32;



typedef unsigned long long  U64;



















typedef float           F32;
typedef double          F64;

typedef unsigned char   BOOLEAN;

typedef S16             MEMBANKREF;



 
 
 
 
 
# 37 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/btype.h" 2


extern U32              gHostIsBigendian;

enum { NOBANK = -1, NOREG = -1, NOMATCH = -1 };

class EXPRESSION;

void fatal_exit();
void fatal_err(const char *, int);
void assert_print( const char *, ...);
void assert_fail(const char *, int, const char *);
void compilerError(const char *err, U32 val, BOOLEAN fatal,
		   const char *file, int line);

 







 



void DebugWarn(const char* fmt,...);

class DbgTimer {
public:
    DbgTimer(clock_t &v) : var(v), time(clock()) {}
    ~DbgTimer() { var += clock() - time; }
private:
    clock_t &var;
    clock_t time;
};



extern clock_t gSchedBBTime,
    gRegaloTime,
    gRegaloBlockTime,
    gBCMTime,
    gGCPTime,
    gCFlowTime,
    gRSETime,
    gIVETime,
    gGAPTime;

































 


enum OPERATOR {
 


    IL_BAD,  
    IL_ABS,          
    IL_ADC,          
    IL_ADD,          
    IL_ADS,
    IL_APR,          
    IL_BAN,          
    IL_BAR,
    IL_BIN,
    IL_BLK,
    IL_BLST,
    IL_BOR,          
    IL_BXR,          
    IL_CAL,          
    IL_CEQ,          
    IL_CGE,          
    IL_CGEC,         
    IL_CGT,          
    IL_CLE,          
    IL_CLT,          
    IL_CLTC,         
    IL_CNE,          
    IL_CON,          
    IL_CPL,          
    IL_CVT,          
    IL_DIV,          
    IL_ENM,          
    IL_ENT,          
    IL_FLD,          
    IL_FPR,          
    IL_FUN,          
    IL_INI,          
    IL_JMP,          
    IL_JPC,          
    IL_LAB,          
    IL_LOD,          
    IL_LSC,          
    IL_LSH,          
    IL_MAC16MUL,     
    IL_MAC16MULA,    
    IL_MAC16MULS,    
    IL_MAC16MULU,    
    IL_MAC16MULLD,   
    IL_MAC16LD,      
    IL_MAX,          
    IL_MIN,          
    IL_MOD,          
    IL_MUL,          
    IL_NEG,          
    IL_PGA,          
    IL_PHI,          
    IL_RET,          
    IL_RSC,          
    IL_RSH,          
    IL_SAH,
    IL_SBC,          
    IL_SBS,
    IL_SCP,          
    IL_SEL,
    IL_SMT,          
    IL_STO,          
    IL_SUB,          
    IL_SYM,          
    IL_TYP,          
    IL_UCP,          
    IL_UNA,
    IL_XJP,          
    IL_ZCL,          
    IL_LAST
};

enum BASIC_TYPE {
 




    CHAR_BT,
    SHORT_BT,
    INT_BT,
    LONG_BT,
    ADDR_BT,
    VOID_BT,
    FUNC_BT,
    FLOAT_BT,
    DOUBLE_BT,
    STRUCT_BT,
    PRED_BT,

    LAST_BT
};

enum STO_CLASS {
    STC_LABEL,
    STC_EXTERN,
    STC_STATIC,
    STC_GLOBAL,
    STC_PARAM,
    STC_LOCAL
};

class TYPE_FLAGS {
public:
    TYPE_FLAGS() {
	u.value = 0; 
    }
    inline int          GetFMemBank()       const { return (BASIC_TYPE)u.bits.membank; }
    inline BASIC_TYPE   GetFTypeOrd()       const { return (BASIC_TYPE)u.bits.btype; }
    inline BOOLEAN      GetFSigned()        const { return (BOOLEAN)u.bits.sgn; }
    inline BOOLEAN      GetFVolatile()      const { return (BOOLEAN)u.bits.vol; }
    inline BOOLEAN      GetFConst()         const { return (BOOLEAN)u.bits.cnst; }
    inline BOOLEAN      GetFRestrict()      const { return (BOOLEAN)u.bits.rstrct; }
    inline BOOLEAN      GetNoOptFlag()      const { return (BOOLEAN)u.bits.noopt; }
    inline BOOLEAN      GetNoOpt()          const { return (BOOLEAN)(u.bits.noopt | u.bits.carry); }
    inline BOOLEAN      GetFCarry()         const { return (BOOLEAN)u.bits.carry; }
    inline BOOLEAN      GetFBrRef()         const { return (BOOLEAN)u.bits.brref; }
    inline BOOLEAN      GetFEquiv()         const { return (BOOLEAN)u.bits.eqv; }
    inline BOOLEAN      GetFTimeDep()       const { return (BOOLEAN)u.bits.timedep; }
    inline BOOLEAN      GetFSwapped()       const { return (BOOLEAN)u.bits.swapped; }
    inline BOOLEAN      GetFInvar()         const { return (BOOLEAN)u.bits.invar; }
    inline U32          GetFValue()         const { return u.value; }
           U32          GetAlign()          const;
           U32          GetParamAlign()     const;

    inline void         Zero()                    { u.value = 0; }
    inline void         SetFMemBank(int m)        { u.bits.membank = m; }
    inline void         SetFTypeOrd(BASIC_TYPE t) { u.bits.btype = (int)t; }
    inline void         SetFSigned(BOOLEAN b)     { u.bits.sgn = b; }
    inline void         SetFVolatile(BOOLEAN b)   { u.bits.vol = b; }
    inline void         SetFConst(BOOLEAN b)      { u.bits.cnst = b; }
    inline void         SetFRestrict(BOOLEAN b)   { u.bits.rstrct = b; }
    inline void         SetNoOptFlag(BOOLEAN b)   { u.bits.noopt = b; }
    inline void         SetFCarry(BOOLEAN b)      { u.bits.carry = b; }
    inline void         SetFBrRef(BOOLEAN b)      { u.bits.brref = b; }
    inline void         SetFEquiv(BOOLEAN b)      { u.bits.eqv = b; }
    inline void         SetFTimeDep(BOOLEAN b)    { u.bits.timedep = b; }
    inline void         SetFSwapped(BOOLEAN b)    { u.bits.swapped = b; }
    inline void         SetFInvar(BOOLEAN b)      { u.bits.invar = b; }
    inline void         SetFValue(U32 v)          { u.value = v; }
    inline void         SetAlign(U32 v)           { u.bits.align = v; }
private:
    union {
	U32     value;
	struct {
	    U32     membank : 8;
	    U32     btype   : 4;
	    U32     sgn     : 1;
	    U32     vol     : 1;
	    U32     cnst    : 1;
	    U32     rstrct  : 1;
	    U32     noopt   : 1;
	    U32     carry   : 1;
	    U32     timedep : 1;
	    U32     brref   : 1;
	    U32     eqv     : 1;
	    U32     swapped : 1;
	    U32     invar   : 1;

	     





	    U32     align: 4;  
	} bits;
    } u;
};

union FUNC_FLAGS {
     




    struct {
        U32         notrealcall : 1;
        U32         shareable : 1;
        U32         noreadmem : 1;
        U32         noreadglobals : 1;
        U32         nowritemem : 1;
        U32         nowriteglobals : 1;
        U32         nosideeffect : 1;
        U32         noreturn : 1;
    }       bits;
    U32     value;
};

inline U32      GetFValue(const FUNC_FLAGS &f)
			{ return f.value; }
inline void     SetFValue(FUNC_FLAGS &f, U32 v)
			{ f.value = v; }

inline BOOLEAN  GetFRealCall(const FUNC_FLAGS &f)
			{ return !f.bits.notrealcall; }
inline void     SetFRealCall(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.notrealcall = !v; }

inline BOOLEAN  GetFShareable(const FUNC_FLAGS &f)
			{ return (BOOLEAN)f.bits.shareable; }
inline void     SetFShareable(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.shareable = v; }

inline BOOLEAN  GetFReadsMem(const FUNC_FLAGS &f)
			{ return !f.bits.noreadmem; }
inline void     SetFReadsMem(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.noreadmem = !v; }

inline BOOLEAN  GetFReadsGlobals(const FUNC_FLAGS &f)
			{ return !f.bits.noreadglobals; }
inline void     SetFReadsGlobals(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.noreadglobals = !v; }

inline BOOLEAN  GetFWritesMem(const FUNC_FLAGS &f)
			{ return !f.bits.nowritemem; }
inline void     SetFWritesMem(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.nowritemem = !v; }

inline BOOLEAN  GetFWritesGlobals(const FUNC_FLAGS &f)
			{ return !f.bits.nowriteglobals; }
inline void     SetFWritesGlobals(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.nowriteglobals = !v; }

inline BOOLEAN  GetFSideEffect(const FUNC_FLAGS &f)
			{ return !f.bits.nosideeffect; }
inline void     SetFSideEffect(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.nosideeffect = !v; }

inline BOOLEAN  GetFNoReturn(const FUNC_FLAGS &f)
			{ return (BOOLEAN)f.bits.noreturn; }
inline void     SetFNoReturn(FUNC_FLAGS &f, BOOLEAN v)
			{ f.bits.noreturn = v; }

extern TYPE_FLAGS   uchar_flags;
extern TYPE_FLAGS   schar_flags;
extern TYPE_FLAGS   ushort_flags;
extern TYPE_FLAGS   sshort_flags;
extern TYPE_FLAGS   uint_flags;
extern TYPE_FLAGS   sint_flags;
extern TYPE_FLAGS   ulong_flags;
extern TYPE_FLAGS   slong_flags;
extern TYPE_FLAGS   void_flags;
extern TYPE_FLAGS   func_flags;
extern TYPE_FLAGS   float_flags;
extern TYPE_FLAGS   double_flags;
extern TYPE_FLAGS   pred_flags;
extern TYPE_FLAGS   addr_flags;
extern TYPE_FLAGS   struct_flags;
extern TYPE_FLAGS   reg_flags;
extern TYPE_FLAGS   aint_flags;
extern TYPE_FLAGS   byte_flags;




struct TYPEINFO {
    U32     size;
    U32     bit_size;
    U32     align;
    U32     isint : 1;
    U32     isflt : 1;
    U32     isprd : 1;
    U32     isadr : 1;
    U32     sgnlod : 1;
    U32     unslod : 1;
    char    *name;
};

enum {
    DONT_REPLACE,
    REPLACE_ZERO,
    REPLACE_ONE,
    REPLACE_LEFT,
    REPLACE_RIGHT,
    REPLACE_NEGATE
};

typedef EXPRESSION  *(*LOPTFN)(EXPRESSION *, BOOLEAN &);

struct OPERINFO {
    LOPTFN      optFn;
    OPERATOR    commuted;
    U8          rightIsZeroAction;
    U8          rightIsOneAction;
    U8          rightIsMOneAction;
    U8          rightIsLeftAction;
    U32         shareable       : 1;
    U32         issigned        : 1;
    U32         iscompare       : 1;
    U32         carryin         : 1;
    U32         associates      : 1;
    U32         moveable        : 1;
    char        *name;
    int         instruction;
};

extern OPERINFO operinfo_array[IL_LAST];
extern TYPEINFO typeinfo_array[];

void            def_inits();

inline U32      DefSize(BASIC_TYPE t)
			{ return typeinfo_array[(int)t].size; }
inline U32      BitSize(BASIC_TYPE t)
			{ return typeinfo_array[(int)t].bit_size; }
inline void     SetBitSize(BASIC_TYPE t, U32 size)
			{ typeinfo_array[(int)t].bit_size = size; }
inline void     SetDefSize(BASIC_TYPE t, U32 size)
			{ typeinfo_array[(int)t].size = size; }
inline U32      DefAlign(BASIC_TYPE t)
			{ return typeinfo_array[(int)t].align; }
inline void     SetDefAlign(BASIC_TYPE t, U32 algn)
			{ typeinfo_array[(int)t].align = algn; }
inline BOOLEAN  IsIntBT(BASIC_TYPE t)
			{ return (BOOLEAN)typeinfo_array[(int)t].isint; }
inline BOOLEAN  IsFltBT(BASIC_TYPE t)
			{ return (BOOLEAN)typeinfo_array[(int)t].isflt; }
inline BOOLEAN  IsPrdBT(BASIC_TYPE t)
			{ return (BOOLEAN)typeinfo_array[(int)t].isprd; }
inline BOOLEAN  IsAdrBT(BASIC_TYPE t)
			{ return (BOOLEAN)typeinfo_array[(int)t].isadr; }
inline BOOLEAN  HaveSignedLod(BASIC_TYPE t)
			{ return (BOOLEAN)typeinfo_array[(int)t].sgnlod; }
inline BOOLEAN  HaveUnsignedLod(BASIC_TYPE t)
			{ return (BOOLEAN)typeinfo_array[(int)t].unslod; }
inline void     SetSignedLod(BASIC_TYPE t, BOOLEAN f)
			{ typeinfo_array[(int)t].sgnlod = f; }
inline void     SetUnsignedLod(BASIC_TYPE t, BOOLEAN f)
			{ typeinfo_array[(int)t].unslod = f; }

inline LOPTFN   GetLOptFn(OPERATOR op)
			{ return operinfo_array[(int)op].optFn; }
inline BOOLEAN  IsCommutative(OPERATOR op)
			{ return operinfo_array[(int)op].commuted != IL_BAD; }
inline OPERATOR GetCommutedOp(OPERATOR op)
			{ return operinfo_array[(int)op].commuted; }
inline BOOLEAN  IsShareable(OPERATOR op)
			{ return (BOOLEAN)operinfo_array[(int)op].shareable; }
inline BOOLEAN  IsSignedOp(OPERATOR op)
			{ return (BOOLEAN)operinfo_array[(int)op].issigned; }
inline BOOLEAN  IsCompare(OPERATOR op)
			{ return (BOOLEAN)operinfo_array[(int)op].iscompare; }
inline BOOLEAN  HasCarryIn(OPERATOR op)
			{ return (BOOLEAN)operinfo_array[(int)op].carryin; }
inline BOOLEAN  IsAssociative(OPERATOR op)
			{ return (BOOLEAN)operinfo_array[(int)op].associates; }
inline BOOLEAN  IsMoveable(OPERATOR op)
			{ return (BOOLEAN)operinfo_array[(int)op].moveable; }
inline U32      GetRightIsZeroAction(OPERATOR op)
			{ return operinfo_array[(int)op].rightIsZeroAction; }
inline U32      GetRightIsOneAction(OPERATOR op)
			{ return operinfo_array[(int)op].rightIsOneAction; }
inline U32      GetRightIsMOneAction(OPERATOR op)
			{ return operinfo_array[(int)op].rightIsMOneAction; }
inline U32      GetRightIsLeftAction(OPERATOR op)
			{ return operinfo_array[(int)op].rightIsLeftAction; }
inline const char *OperName(OPERATOR op)
			{ return operinfo_array[(int)op].name; }




inline const char *TypeName(BASIC_TYPE t)
			{ return typeinfo_array[(int)t].name; }




 

 




template<class T,class P>T *debug_cast( P *p )
{
    return p ? &dynamic_cast<T&>(*p) : 0;
}















 
 
 
 
 
# 230 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h" 2

# 1 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/bitset.h" 1
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 




# 1 "/usr/include/stdio.h" 1 3
 

















 









extern "C" { 



# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 1 3






 


# 19 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3



 


 





 


# 61 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 


# 188 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3





 




 

# 271 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


# 283 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 

# 317 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




 





















# 33 "/usr/include/stdio.h" 2 3





# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 1 3
 
































































 






typedef void *__gnuc_va_list;



 

# 122 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 3




















# 209 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 3




# 38 "/usr/include/stdio.h" 2 3









 
typedef struct _IO_FILE FILE;








# 1 "/usr/include/libio.h" 1 3
 




























# 1 "/usr/include/_G_config.h" 1 3
 





 






# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 1 3






 


# 19 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3



 


 





 


# 61 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 


# 188 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3





 




 





























 



















































typedef unsigned int  wint_t;




 

 

# 317 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




 





















# 14 "/usr/include/_G_config.h" 2 3





















typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));




 


















 




 














# 30 "/usr/include/libio.h" 2 3
















 

# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 1 3
 
































































 










 

# 122 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 3




















# 209 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 3




# 48 "/usr/include/libio.h" 2 3







# 67 "/usr/include/libio.h" 3


 

















# 98 "/usr/include/libio.h" 3











 
























 



















struct _IO_jump_t;  struct _IO_FILE;

 







typedef void _IO_lock_t;



 

struct _IO_marker {
  struct _IO_marker *_next;
  struct _IO_FILE *_sbuf;
   

   
  int _pos;
# 186 "/usr/include/libio.h" 3

};

struct _IO_FILE {
  int _flags;		 


   
   
  char* _IO_read_ptr;	 
  char* _IO_read_end;	 
  char* _IO_read_base;	 
  char* _IO_write_base;	 
  char* _IO_write_ptr;	 
  char* _IO_write_end;	 
  char* _IO_buf_base;	 
  char* _IO_buf_end;	 
   
  char *_IO_save_base;  
  char *_IO_backup_base;   
  char *_IO_save_end;  

  struct _IO_marker *_markers;

  struct _IO_FILE *_chain;

  int _fileno;
  int _blksize;
  __off_t   _old_offset;  


   
  unsigned short _cur_column;
  signed char _vtable_offset;
  char _shortbuf[1];

   

  _IO_lock_t *_lock;








  __off64_t   _offset;
   
  int _unused2[16];

};





struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;











 

 

typedef __ssize_t __io_read_fn  (void *  __cookie, char *__buf,
				       size_t __nbytes)  ;

 





typedef __ssize_t __io_write_fn  (void *  __cookie, __const char *__buf,
				      size_t __n)  ;

 





typedef int __io_seek_fn  (void *  __cookie, __off_t   __pos, int __w)  ;

 
typedef int __io_close_fn  (void *  __cookie)  ;


# 311 "/usr/include/libio.h" 3




extern "C" {


extern int __underflow  (_IO_FILE *)  throw ()  ;
extern int __uflow  (_IO_FILE *)  throw ()  ;
extern int __overflow  (_IO_FILE *, int)  throw ()  ;
















extern int _IO_getc  (_IO_FILE *__fp)  throw ()  ;
extern int _IO_putc  (int __c, _IO_FILE *__fp)  throw ()  ;
extern int _IO_feof  (_IO_FILE *__fp)  throw ()  ;
extern int _IO_ferror  (_IO_FILE *__fp)  throw ()  ;

extern int _IO_peekc_locked  (_IO_FILE *__fp)  throw ()  ;

 



extern void _IO_flockfile  (_IO_FILE *)  throw ()  ;
extern void _IO_funlockfile  (_IO_FILE *)  throw ()  ;
extern int _IO_ftrylockfile  (_IO_FILE *)  throw ()  ;












extern int _IO_vfscanf  (_IO_FILE * __restrict, const char * __restrict,
			     __gnuc_va_list , int *__restrict)  throw ()  ;
extern int _IO_vfprintf  (_IO_FILE *__restrict, const char *__restrict,
			      __gnuc_va_list )  throw ()  ;
extern __ssize_t   _IO_padn  (_IO_FILE *, int, __ssize_t  )  throw ()  ;
extern size_t   _IO_sgetn  (_IO_FILE *, void *, size_t  )  throw ()  ;

extern __off64_t   _IO_seekoff  (_IO_FILE *, __off64_t  , int, int)  throw ()  ;
extern __off64_t   _IO_seekpos  (_IO_FILE *, __off64_t  , int)  throw ()  ;

extern void _IO_free_backup_area  (_IO_FILE *)  throw ()  ;


}



# 57 "/usr/include/stdio.h" 2 3


 

typedef __off_t  fpos_t;







 





 





 






 







 




 








# 1 "/usr/include/bits/stdio_lim.h" 1 3
 




































# 110 "/usr/include/stdio.h" 2 3



 
extern FILE *stdin;		 
extern FILE *stdout;		 
extern FILE *stderr;		 


 
extern int remove  (__const char *__filename)  throw ()  ;
 
extern int rename  (__const char *__old, __const char *__new)  throw ()  ;


 

extern FILE *tmpfile  (void)  throw ()  ;










 
extern char *tmpnam  (char *__s)  throw ()  ;


 

extern char *tmpnam_r  (char *__s)  throw ()  ;




 






extern char *tempnam  (__const char *__dir, __const char *__pfx)  throw ()  ;



 
extern int fclose  (FILE *__stream)  throw ()  ;
 
extern int fflush  (FILE *__stream)  throw ()  ;


 
extern int fflush_unlocked  (FILE *__stream)  throw ()  ;









 
extern FILE *fopen  (__const char *__restrict __filename,
			 __const char *__restrict __modes)  throw ()  ;
 
extern FILE *freopen  (__const char *__restrict __filename,
			   __const char *__restrict __modes,
			   FILE *__restrict __stream)  throw ()  ;
# 197 "/usr/include/stdio.h" 3










 
extern FILE *fdopen  (int __fd, __const char *__modes)  throw ()  ;


# 223 "/usr/include/stdio.h" 3



 

extern void setbuf  (FILE *__restrict __stream, char *__restrict __buf)  throw ()  ;
 


extern int setvbuf  (FILE *__restrict __stream, char *__restrict __buf,
			 int __modes, size_t __n)  throw ()  ;


 

extern void setbuffer  (FILE *__restrict __stream, char *__restrict __buf,
			    size_t __size)  throw ()  ;

 
extern void setlinebuf  (FILE *__stream)  throw ()  ;



 
extern int fprintf  (FILE *__restrict __stream,
			 __const char *__restrict __format, ...)  throw ()  ;
 
extern int printf  (__const char *__restrict __format, ...)  throw ()  ;
 
extern int sprintf  (char *__restrict __s,
			 __const char *__restrict __format, ...)  throw ()  ;

 
extern int vfprintf  (FILE *__restrict __s,
			  __const char *__restrict __format,
			  __gnuc_va_list  __arg)  throw ()  ;
 
extern int vprintf  (__const char *__restrict __format,
			 __gnuc_va_list  __arg)  throw ()  ;
 
extern int vsprintf  (char *__restrict __s,
			  __const char *__restrict __format,
			  __gnuc_va_list  __arg)  throw ()  ;


 
extern int snprintf  (char *__restrict __s, size_t __maxlen,
			  __const char *__restrict __format, ...)  throw ()  
     __attribute__ ((__format__ (__printf__, 3, 4)));

extern int __vsnprintf  (char *__restrict __s, size_t __maxlen,
			     __const char *__restrict __format,
			     __gnuc_va_list  __arg)  throw ()  
     __attribute__ ((__format__ (__printf__, 3, 0)));
extern int vsnprintf  (char *__restrict __s, size_t __maxlen,
			   __const char *__restrict __format,
			   __gnuc_va_list  __arg)  throw ()  
     __attribute__ ((__format__ (__printf__, 3, 0)));


# 302 "/usr/include/stdio.h" 3



 
extern int fscanf  (FILE *__restrict __stream,
			__const char *__restrict __format, ...)  throw ()  ;
 
extern int scanf  (__const char *__restrict __format, ...)  throw ()  ;
 
extern int sscanf  (__const char *__restrict __s,
			__const char *__restrict __format, ...)  throw ()  ;

# 330 "/usr/include/stdio.h" 3



 
extern int fgetc  (FILE *__stream)  throw ()  ;
extern int getc  (FILE *__stream)  throw ()  ;

 
extern int getchar  (void)  throw ()  ;

 




 
extern int getc_unlocked  (FILE *__stream)  throw ()  ;
extern int getchar_unlocked  (void)  throw ()  ;



 
extern int fgetc_unlocked  (FILE *__stream)  throw ()  ;



 
extern int fputc  (int __c, FILE *__stream)  throw ()  ;
extern int putc  (int __c, FILE *__stream)  throw ()  ;

 
extern int putchar  (int __c)  throw ()  ;

 




 
extern int fputc_unlocked  (int __c, FILE *__stream)  throw ()  ;



 
extern int putc_unlocked  (int __c, FILE *__stream)  throw ()  ;
extern int putchar_unlocked  (int __c)  throw ()  ;




 
extern int getw  (FILE *__stream)  throw ()  ;

 
extern int putw  (int __w, FILE *__stream)  throw ()  ;



 
extern char *fgets  (char *__restrict __s, int __n,
			 FILE *__restrict __stream)  throw ()  ;







 

extern char *gets  (char *__s)  throw ()  ;


# 420 "/usr/include/stdio.h" 3



 
extern int fputs  (__const char *__restrict __s,
		       FILE *__restrict __stream)  throw ()  ;







 
extern int puts  (__const char *__s)  throw ()  ;


 
extern int ungetc  (int __c, FILE *__stream)  throw ()  ;


 
extern size_t fread  (void *__restrict __ptr, size_t __size,
			  size_t __n, FILE *__restrict __stream)  throw ()  ;
 
extern size_t fwrite  (__const void *__restrict __ptr, size_t __size,
			   size_t __n, FILE *__restrict __s)  throw ()  ;


 
extern size_t fread_unlocked  (void *__restrict __ptr, size_t __size,
				   size_t __n, FILE *__restrict __stream)  throw ()  ;
extern size_t fwrite_unlocked  (__const void *__restrict __ptr,
				    size_t __size, size_t __n,
				    FILE *__restrict __stream)  throw ()  ;



 
extern int fseek  (FILE *__stream, long int __off, int __whence)  throw ()  ;
 
extern long int ftell  (FILE *__stream)  throw ()  ;
 
extern void rewind  (FILE *__stream)  throw ()  ;

 




 


typedef __off_t off_t;




















 
extern int fgetpos  (FILE *__restrict __stream,
			 fpos_t *__restrict __pos)  throw ()  ;
 
extern int fsetpos  (FILE *__stream, __const fpos_t *__pos)  throw ()  ;
# 519 "/usr/include/stdio.h" 3


# 529 "/usr/include/stdio.h" 3


 
extern void clearerr  (FILE *__stream)  throw ()  ;
 
extern int feof  (FILE *__stream)  throw ()  ;
 
extern int ferror  (FILE *__stream)  throw ()  ;


 
extern void clearerr_unlocked  (FILE *__stream)  throw ()  ;
extern int feof_unlocked  (FILE *__stream)  throw ()  ;
extern int ferror_unlocked  (FILE *__stream)  throw ()  ;



 
extern void perror  (__const char *__s)  throw ()  ;

 


extern int sys_nerr;
extern __const char *__const sys_errlist[];








 
extern int fileno  (FILE *__stream)  throw ()  ;



 
extern int fileno_unlocked  (FILE *__stream)  throw ()  ;





 
extern FILE *popen  (__const char *__command, __const char *__modes)  throw ()  ;

 
extern int pclose  (FILE *__stream)  throw ()  ;




 
extern char *ctermid  (char *__s)  throw ()  ;









# 603 "/usr/include/stdio.h" 3




 

 
extern void flockfile  (FILE *__stream)  throw ()  ;

 

extern int ftrylockfile  (FILE *__stream)  throw ()  ;

 
extern void funlockfile  (FILE *__stream)  throw ()  ;










 





} 




# 219 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/bitset.h" 2

# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/iostream.h" 1 3
 

























#pragma interface



# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/streambuf.h" 1 3
 


























#pragma interface


   



extern "C" {

}
 

# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 1 3
 
































































 










 



 

















void va_end (__gnuc_va_list);		 


 



 












 























 
 













# 175 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stdarg.h" 3


 




 

 

 

typedef __gnuc_va_list va_list;
























# 40 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/streambuf.h" 2 3

























extern "C++" {
class istream;  
class ostream; class streambuf;

 




typedef __off64_t   streamoff;
typedef __off64_t   streampos;




typedef __ssize_t   streamsize;

typedef unsigned long __fmtflags;
typedef unsigned char __iostate;

struct _ios_fields
{  
    streambuf *_strbuf;
    ostream* _tie;
    int _width;
    __fmtflags _flags;
    wchar_t   _fill;
    __iostate _state;
    __iostate _exceptions;
    int _precision;

    void *_arrays;  
};















# 124 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/streambuf.h" 3


class ios : public _ios_fields {
  ios& operator=(ios&);   
  ios (const ios&);  
  public:
    typedef __fmtflags fmtflags;
    typedef int iostate;
    typedef int openmode;
    typedef __ssize_t   streamsize;
    enum io_state {
	goodbit = 0 ,
	eofbit = 1 ,
	failbit = 2 ,
	badbit = 4  };
    enum open_mode {
	in = 1 ,
	out = 2 ,
	ate = 4 ,
	app = 8 ,
	trunc = 16 ,
	nocreate = 32 ,
	noreplace = 64 ,
	bin = 128 ,  
	binary = 128  };
    enum seek_dir { beg, cur, end};
    typedef enum seek_dir seekdir;
     
    enum { skipws= 01 ,
	   left= 02 , right= 04 , internal= 010 ,
	   dec= 020 , oct= 040 , hex= 0100 ,
	   showbase= 0200 , showpoint= 0400 ,
	   uppercase= 01000 , showpos= 02000 ,
	   scientific= 04000 , fixed= 010000 ,
	   unitbuf= 020000 , stdio= 040000 



	   };
    enum {  
	basefield=dec+oct+hex,
	floatfield = scientific+fixed,
	adjustfield = left+right+internal
    };

# 177 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/streambuf.h" 3


    ostream* tie() const { return _tie; }
    ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }

     
    wchar_t   fill() const { return _fill; }
    wchar_t   fill(wchar_t   newf)
	{wchar_t   oldf = _fill; _fill = newf; return oldf;}
    fmtflags flags() const { return _flags; }
    fmtflags flags(fmtflags new_val) {
	fmtflags old_val = _flags; _flags = new_val; return old_val; }
    int precision() const { return _precision; }
    int precision(int newp) {
	unsigned short oldp = _precision; _precision = (unsigned short)newp;
	return oldp; }
    fmtflags setf(fmtflags val) {
	fmtflags oldbits = _flags;
	_flags |= val; return oldbits; }
    fmtflags setf(fmtflags val, fmtflags mask) {
	fmtflags oldbits = _flags;
	_flags = (_flags & ~mask) | (val & mask); return oldbits; }
    fmtflags unsetf(fmtflags mask) {
	fmtflags oldbits = _flags;
	_flags &= ~mask; return oldbits; }
    int width() const { return _width; }
    int width(int val) { int save = _width; _width = val; return save; }




    void _throw_failure() const { }

    void clear(iostate state = 0) {
	_state = _strbuf ? state : state|badbit;
	if (_state & _exceptions) _throw_failure(); }
    void set(iostate flag) { _state |= flag;
	if (_state & _exceptions) _throw_failure(); }
    void setstate(iostate flag) { _state |= flag;  
	if (_state & _exceptions) _throw_failure(); }
    int good() const { return _state == 0; }
    int eof() const { return _state & ios::eofbit; }
    int fail() const { return _state & (ios::badbit|ios::failbit); }
    int bad() const { return _state & ios::badbit; }
    iostate rdstate() const { return _state; }
    operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
    int operator!() const { return fail(); }
    iostate exceptions() const { return _exceptions; }
    void exceptions(iostate enable) {
	_exceptions = enable;
	if (_state & _exceptions) _throw_failure(); }

    streambuf* rdbuf() const { return _strbuf; }
    streambuf* rdbuf(streambuf *_s) {
      streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }

    static int sync_with_stdio(int on);
    static void sync_with_stdio() { sync_with_stdio(1); }
    static fmtflags bitalloc();
    static int xalloc();
    void*& pword(int);
    void* pword(int) const;
    long& iword(int);
    long iword(int) const;









     
    class Init {
    public:
      Init () { }
    };

  protected:
    inline ios(streambuf* sb = 0, ostream* tie_to = 0);
    inline virtual ~ios();
    inline void init(streambuf* sb, ostream* tie = 0);
};




typedef ios::seek_dir _seek_dir;


 
 
 
 
 

 
 
class streammarker : private _IO_marker {
    friend class streambuf;
    void set_offset(int offset) { _pos = offset; }
  public:
    streammarker(streambuf *sb);
    ~streammarker();
    int saving() { return  1; }
    int delta(streammarker&);
    int delta();
};

struct streambuf : public _IO_FILE {  
    friend class ios;
    friend class istream;
    friend class ostream;
    friend class streammarker;
    const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
  protected:
    static streambuf* _list_all;  
    _IO_FILE*& xchain() { return _chain; }
    void _un_link();
    void _link_in();
    char* gptr() const
      { return _flags  & 0x100  ? _IO_save_base : _IO_read_ptr; }
    char* pptr() const { return _IO_write_ptr; }
    char* egptr() const
      { return _flags  & 0x100  ? _IO_save_end : _IO_read_end; }
    char* epptr() const { return _IO_write_end; }
    char* pbase() const { return _IO_write_base; }
    char* eback() const
      { return _flags  & 0x100  ? _IO_save_base : _IO_read_base;}
    char* base() const { return _IO_buf_base; }
    char* ebuf() const { return _IO_buf_end; }
    int blen() const { return _IO_buf_end - _IO_buf_base; }
    void xput_char(char c) { *_IO_write_ptr++ = c; }
    int xflags() { return _flags ; }
    int xflags(int f) {int fl = _flags ; _flags  = f; return fl;}
    void xsetflags(int f) { _flags  |= f; }
    void xsetflags(int f, int mask)
      { _flags  = (_flags  & ~mask) | (f & mask); }
    void gbump(int n)
      { _flags  & 0x100  ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
    void pbump(int n) { _IO_write_ptr += n; }
    void setb(char* b, char* eb, int a=0);
    void setp(char* p, char* ep)
      { _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
    void setg(char* eb, char* g, char *eg) {
      if (_flags  & 0x100 ) _IO_free_backup_area(this); 
      _IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
    char *shortbuf() { return _shortbuf; }

    int in_backup() { return _flags & 0x100 ; }
     
    char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
     
    char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
     
    char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
    char *Bptr() { return _IO_backup_base; }
     
    char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
    char *Nbase() { return _IO_save_base; }
    char *eNptr() { return _IO_save_end; }
    int have_backup() { return _IO_save_base != __null ; }
    int have_markers() { return _markers != __null ; }
    void free_backup_area();
    void unsave_markers();  
    int put_mode() { return _flags & 0x800 ; }
    int switch_to_get_mode();
    
    streambuf(int flags=0);
  public:
    static int flush_all();
    static void flush_all_linebuffered();  
    virtual ~streambuf();
    virtual int overflow(int c = (-1) );  
    virtual int underflow();  
    virtual int uflow();  
    virtual int pbackfail(int c);
 
    virtual streamsize xsputn(const char* s, streamsize n);
    virtual streamsize xsgetn(char* s, streamsize n);
    virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
    virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);

    streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out)
      { return _IO_seekoff (this, o, d, mode); }
    streampos pubseekpos(streampos pos, int mode = ios::in|ios::out)
      { return _IO_seekpos (this, pos, mode); }
    streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
    streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
    virtual streambuf* setbuf(char* p, int len);
    virtual int sync();
    virtual int doallocate();

    int seekmark(streammarker& mark, int delta = 0);
    int sputbackc(char c);
    int sungetc();
    int unbuffered() { return _flags & 2  ? 1 : 0; }
    int linebuffered() { return _flags & 0x200  ? 1 : 0; }
    void unbuffered(int i)
	{ if (i) _flags |= 2 ; else _flags &= ~2 ; }
    void linebuffered(int i)
	{ if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; }
    int allocate() {  
	if (base() || unbuffered()) return 0;
	else return doallocate(); }
     
    void allocbuf() { if (base() == __null ) doallocbuf(); }
    void doallocbuf();
    int in_avail() { return _IO_read_end - _IO_read_ptr; }
    int out_waiting() { return _IO_write_ptr - _IO_write_base; }
    streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
    streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
    streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
    int ignore(int);
    int get_column();
    int set_column(int);
    long sgetline(char* buf, size_t   n, char delim, int putback_delim);
    int sputc(int c) { return _IO_putc(c, this); }
    int sbumpc() { return _IO_getc(this); }
    int sgetc() { return ((  this  )->_IO_read_ptr >= (  this  )->_IO_read_end && __underflow (  this  ) == (-1)  ? (-1)  : *(unsigned char *) (  this  )->_IO_read_ptr)  ; }
    int snextc() {
	if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) )
	  return (-1) ;
	else return _IO_read_ptr++, sgetc(); }
    void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
    int vscan(char const *fmt0, __gnuc_va_list  ap, ios* stream = __null );
    int scan(char const *fmt0 ...);
    int vform(char const *fmt0, __gnuc_va_list  ap);
    int form(char const *fmt0 ...);




    virtual streamsize sys_read(char* buf, streamsize size);
    virtual streamsize sys_write(const char*, streamsize);
    virtual streampos sys_seek(streamoff, _seek_dir);
    virtual int sys_close();
    virtual int sys_stat(void*);  

    virtual int showmanyc();
    virtual void imbue(void *);

};

 
 

class filebuf : public streambuf {
  protected:
    void init();
  public:
    static const int openprot;  
    filebuf();
    filebuf(int fd);
    filebuf(int fd, char* p, int len);



    ~filebuf();
    filebuf* attach(int fd);
    filebuf* open(const char *filename, const char *mode);
    filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
    virtual int underflow();
    virtual int overflow(int c = (-1) );
    int is_open() const { return _fileno >= 0; }
    int fd() const { return is_open() ? _fileno : (-1) ; }
    filebuf* close();
    virtual int doallocate();
    virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
    virtual streambuf* setbuf(char* p, int len);
    streamsize xsputn(const char* s, streamsize n);
    streamsize xsgetn(char* s, streamsize n);
    virtual int sync();
  protected:  
 
    int is_reading() { return eback() != egptr(); }
    char* cur_ptr() { return is_reading() ?  gptr() : pptr(); }
     
    char* file_ptr() { return eGptr(); }
     
    virtual streamsize sys_read(char* buf, streamsize size);
    virtual streampos sys_seek(streamoff, _seek_dir);
    virtual streamsize sys_write(const char*, streamsize);
    virtual int sys_stat(void*);  
    virtual int sys_close();




};

inline void ios::init(streambuf* sb, ostream* tie_to) {
		_state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
		_strbuf=sb; _tie = tie_to; _width=0; _fill=' ';

		_flags=ios::skipws|ios::dec;



		_precision=6; _arrays = 0; }

inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }

inline ios::~ios() {



     
     
    operator delete[] (_arrays);
}
}  

# 31 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3/iostream.h" 2 3


extern "C++" {
class istream; class ostream;
typedef ios& (*__manip)(ios&);
typedef istream& (*__imanip)(istream&);
typedef ostream& (*__omanip)(ostream&);

extern istream& ws(istream& ins);
extern ostream& flush(ostream& outs);
extern ostream& endl(ostream& outs);
extern ostream& ends(ostream& outs);

class ostream : virtual public ios
{
     
    void do_osfx();
  public:
    ostream() { }
    ostream(streambuf* sb, ostream* tied= __null );
    int opfx() {
	if (!good()) return 0;
	else { if (_tie) _tie->flush();  ; return 1;} }
    void osfx() {  ;
		  if (flags() & (ios::unitbuf|ios::stdio))
		      do_osfx(); }
    ostream& flush();
    ostream& put(char c) { _strbuf->sputc(c); return *this; }





    ostream& write(const char *s, streamsize n);
    ostream& write(const unsigned char *s, streamsize n)
      { return write((const char*)s, n);}
    ostream& write(const signed char *s, streamsize n)
      { return write((const char*)s, n);}
    ostream& write(const void *s, streamsize n)
      { return write((const char*)s, n);}
    ostream& seekp(streampos);
    ostream& seekp(streamoff, _seek_dir);
    streampos tellp();
    ostream& form(const char *format ...);
    ostream& vform(const char *format, __gnuc_va_list  args);

    ostream& operator<<(char c);
    ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
    ostream& operator<<(signed char c) { return (*this) << (char)c; }
    ostream& operator<<(const char *s);
    ostream& operator<<(const unsigned char *s)
	{ return (*this) << (const char*)s; }
    ostream& operator<<(const signed char *s)
	{ return (*this) << (const char*)s; }
    ostream& operator<<(const void *p);
    ostream& operator<<(int n);
    ostream& operator<<(unsigned int n);
    ostream& operator<<(long n);
    ostream& operator<<(unsigned long n);

    __extension__ ostream& operator<<(long long n);
    __extension__ ostream& operator<<(unsigned long long n);

    ostream& operator<<(short n) {return operator<<((int)n);}
    ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}

    ostream& operator<<(bool b) { return operator<<((int)b); }

    ostream& operator<<(double n);
    ostream& operator<<(float n) { return operator<<((double)n); }

    ostream& operator<<(long double n);



    ostream& operator<<(__omanip func) { return (*func)(*this); }
    ostream& operator<<(__manip func) {(*func)(*this); return *this;}
    ostream& operator<<(streambuf*);



};

class istream : virtual public ios
{
     
protected:
    size_t   _gcount;

    int _skip_ws();
  public:
    istream(): _gcount (0) { }
    istream(streambuf* sb, ostream*tied= __null );
    istream& get(char* ptr, int len, char delim = '\n');
    istream& get(unsigned char* ptr, int len, char delim = '\n')
	{ return get((char*)ptr, len, delim); }
    istream& get(char& c);
    istream& get(unsigned char& c) { return get((char&)c); }
    istream& getline(char* ptr, int len, char delim = '\n');
    istream& getline(unsigned char* ptr, int len, char delim = '\n')
	{ return getline((char*)ptr, len, delim); }
    istream& get(signed char& c)  { return get((char&)c); }
    istream& get(signed char* ptr, int len, char delim = '\n')
	{ return get((char*)ptr, len, delim); }
    istream& getline(signed char* ptr, int len, char delim = '\n')
	{ return getline((char*)ptr, len, delim); }
    istream& read(char *ptr, streamsize n);
    istream& read(unsigned char *ptr, streamsize n)
      { return read((char*)ptr, n); }
    istream& read(signed char *ptr, streamsize n)
      { return read((char*)ptr, n); }
    istream& read(void *ptr, streamsize n)
      { return read((char*)ptr, n); }
    istream& get(streambuf& sb, char delim = '\n');
    istream& gets(char **s, char delim = '\n');
    int ipfx(int need = 0) {
	if (!good()) { set(ios::failbit); return 0; }
	else {
	   ;
	  if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
	  if (!need && (flags() & ios::skipws)) return _skip_ws();
	  else return 1;
	}
    }
    int ipfx0() {  
	if (!good()) { set(ios::failbit); return 0; }
	else {
	   ;
	  if (_tie) _tie->flush();
	  if (flags() & ios::skipws) return _skip_ws();
	  else return 1;
	}
    }
    int ipfx1() {  
	if (!good()) { set(ios::failbit); return 0; }
	else {
	   ;
	  if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
	  return 1;
	}
    }
    void isfx() {  ; }
    int get() { if (!ipfx1()) return (-1) ;
		else { int ch = _strbuf->sbumpc();
		       if (ch == (-1) ) set(ios::eofbit);
		       isfx();
		       return ch;
		     } }
    int peek();
    size_t   gcount() { return _gcount; }
    istream& ignore(int n=1, int delim = (-1) );
    int sync ();
    istream& seekg(streampos);
    istream& seekg(streamoff, _seek_dir);
    streampos tellg();
    istream& putback(char ch) {
	if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
	return *this;}
    istream& unget() {
	if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
	return *this;}
    istream& scan(const char *format ...);
    istream& vscan(const char *format, __gnuc_va_list  args);






    istream& operator>>(char*);
    istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
    istream& operator>>(signed char*p) { return operator>>((char*)p); }
    istream& operator>>(char& c);
    istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
    istream& operator>>(signed char& c) {return operator>>((char&)c);}
    istream& operator>>(int&);
    istream& operator>>(long&);

    __extension__ istream& operator>>(long long&);
    __extension__ istream& operator>>(unsigned long long&);

    istream& operator>>(short&);
    istream& operator>>(unsigned int&);
    istream& operator>>(unsigned long&);
    istream& operator>>(unsigned short&);

    istream& operator>>(bool&);

    istream& operator>>(float&);
    istream& operator>>(double&);
    istream& operator>>(long double&);
    istream& operator>>( __manip func) {(*func)(*this); return *this;}
    istream& operator>>(__imanip func) { return (*func)(*this); }
    istream& operator>>(streambuf*);
};

class iostream : public istream, public ostream
{
  public:
    iostream() { }
    iostream(streambuf* sb, ostream*tied= __null );
};

class _IO_istream_withassign : public istream {
public:
  _IO_istream_withassign& operator=(istream&);
  _IO_istream_withassign& operator=(_IO_istream_withassign& rhs)
    { return operator= (static_cast<istream&> (rhs)); }
};

class _IO_ostream_withassign : public ostream {
public:
  _IO_ostream_withassign& operator=(ostream&);
  _IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs)
    { return operator= (static_cast<ostream&> (rhs)); }
};

extern _IO_istream_withassign cin;
 
extern _IO_ostream_withassign cout, cerr;

extern _IO_ostream_withassign clog



;

extern istream& lock(istream& ins);
extern istream& unlock(istream& ins);
extern ostream& lock(ostream& outs);
extern ostream& unlock(ostream& outs);

struct Iostream_init { } ;   

inline ios& dec(ios& i)
{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
inline ios& hex(ios& i)
{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
inline ios& oct(ios& i)
{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
}  


# 220 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/bitset.h" 2

# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 1 3
 


 

# 114 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/limits.h" 3







# 221 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/bitset.h" 2


# 1 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/MEM_Pool.h" 1
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 




# 1 "/usr/include/stdlib.h" 1 3
 

















 







 





# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 1 3






 


# 19 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3



 


 





 


# 61 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 


# 188 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3





 




 


# 269 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




# 283 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 

# 317 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




 





















# 33 "/usr/include/stdlib.h" 2 3


extern "C" { 




 
typedef struct
  {
    int quot;			 
    int rem;			 
  } div_t;

 

typedef struct
  {
    long int quot;		 
    long int rem;		 
  } ldiv_t;



# 65 "/usr/include/stdlib.h" 3



 



 





 

extern size_t __ctype_get_mb_cur_max  (void)  throw ()  ;


 
extern double atof  (__const char *__nptr)  throw ()  ;
 
extern int atoi  (__const char *__nptr)  throw ()  ;
 
extern long int atol  (__const char *__nptr)  throw ()  ;


 
__extension__ extern long long int atoll  (__const char *__nptr)  throw ()  ;


 
extern double strtod  (__const char *__restrict __nptr,
			   char **__restrict __endptr)  throw ()  ;










 
extern long int strtol  (__const char *__restrict __nptr,
			     char **__restrict __endptr, int __base)  throw ()  ;
 
extern unsigned long int strtoul  (__const char *__restrict __nptr,
				       char **__restrict __endptr,
				       int __base)  throw ()  ;


 
__extension__
extern long long int strtoq  (__const char *__restrict __nptr,
				  char **__restrict __endptr, int __base)  throw ()  ;
 
__extension__
extern unsigned long long int strtouq  (__const char *__restrict __nptr,
					    char **__restrict __endptr,
					    int __base)  throw ()  ;



 

 
__extension__
extern long long int strtoll  (__const char *__restrict __nptr,
				   char **__restrict __endptr, int __base)  throw ()  ;
 
__extension__
extern unsigned long long int strtoull  (__const char *__restrict __nptr,
					     char **__restrict __endptr,
					     int __base)  throw ()  ;



# 190 "/usr/include/stdlib.h" 3



 


extern double __strtod_internal  (__const char *__restrict __nptr,
				      char **__restrict __endptr,
				      int __group)  throw ()  ;
extern float __strtof_internal  (__const char *__restrict __nptr,
				     char **__restrict __endptr, int __group)  throw ()  ;
extern long double  __strtold_internal  (__const char *
						__restrict __nptr,
						char **__restrict __endptr,
						int __group)  throw ()  ;

extern long int __strtol_internal  (__const char *__restrict __nptr,
					char **__restrict __endptr,
					int __base, int __group)  throw ()  ;



extern unsigned long int __strtoul_internal  (__const char *
						  __restrict __nptr,
						  char **__restrict __endptr,
						  int __base, int __group)  throw ()  ;




__extension__
extern long long int __strtoll_internal  (__const char *__restrict __nptr,
					      char **__restrict __endptr,
					      int __base, int __group)  throw ()  ;



__extension__
extern unsigned long long int __strtoull_internal  (__const char *
							__restrict __nptr,
							char **
							__restrict __endptr,
							int __base,
							int __group)  throw ()  ;




# 326 "/usr/include/stdlib.h" 3




 


extern char *l64a  (long int __n)  throw ()  ;

 
extern long int a64l  (__const char *__s)  throw ()  ;


# 1 "/usr/include/sys/types.h" 1 3
 

















 








extern "C" { 




typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;


typedef __loff_t loff_t;



typedef __ino_t ino_t;










typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;

















typedef __pid_t pid_t;




typedef __id_t id_t;



typedef __ssize_t ssize_t;




typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;



typedef __key_t key_t;









# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 1 3






 


# 19 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3



 


 





 


# 61 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 


# 188 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3





 




 

# 271 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


# 283 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 

# 317 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




 





















# 124 "/usr/include/sys/types.h" 2 3



 
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;


 

# 158 "/usr/include/sys/types.h" 3


 







typedef int int8_t __attribute__ ((__mode__ (  __QI__ ))) ;
typedef int int16_t __attribute__ ((__mode__ (  __HI__ ))) ;
typedef int int32_t __attribute__ ((__mode__ (  __SI__ ))) ;
typedef int int64_t __attribute__ ((__mode__ (  __DI__ ))) ;


typedef unsigned int u_int8_t __attribute__ ((__mode__ (  __QI__ ))) ;
typedef unsigned int u_int16_t __attribute__ ((__mode__ (  __HI__ ))) ;
typedef unsigned int u_int32_t __attribute__ ((__mode__ (  __SI__ ))) ;
typedef unsigned int u_int64_t __attribute__ ((__mode__ (  __DI__ ))) ;

typedef int register_t __attribute__ ((__mode__ (__word__)));


 






 
# 1 "/usr/include/endian.h" 1 3
 






















 









 
# 1 "/usr/include/bits/endian.h" 1 3
 






# 35 "/usr/include/endian.h" 2 3


 













# 190 "/usr/include/sys/types.h" 2 3


 
# 1 "/usr/include/sys/select.h" 1 3
 


















 






 


 
# 1 "/usr/include/bits/select.h" 1 3
 

























# 36 "/usr/include/bits/select.h" 3












# 56 "/usr/include/bits/select.h" 3

# 72 "/usr/include/bits/select.h" 3

# 31 "/usr/include/sys/select.h" 2 3


 
# 1 "/usr/include/bits/sigset.h" 1 3
 





















typedef int __sig_atomic_t;

 


typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int))) ];
  } __sigset_t;




 





# 125 "/usr/include/bits/sigset.h" 3

# 34 "/usr/include/sys/select.h" 2 3


 



extern "C" { 

 



struct timeval;

typedef __fd_mask fd_mask;

 
typedef __fd_set fd_set;

 



 




 






 




extern int __select  (int __nfds, __fd_set *__readfds,
			  __fd_set *__writefds, __fd_set *__exceptfds,
			  struct timeval *__timeout)  throw ()  ;
extern int select  (int __nfds, __fd_set *__readfds,
			__fd_set *__writefds, __fd_set *__exceptfds,
			struct timeval *__timeout)  throw ()  ;

# 91 "/usr/include/sys/select.h" 3


} 


# 193 "/usr/include/sys/types.h" 2 3


 
# 1 "/usr/include/sys/sysmacros.h" 1 3
 





















 








# 47 "/usr/include/sys/sysmacros.h" 3



# 196 "/usr/include/sys/types.h" 2 3




 

typedef __blkcnt_t blkcnt_t;	  
typedef __fsblkcnt_t fsblkcnt_t;  
typedef __fsfilcnt_t fsfilcnt_t;  












} 


# 339 "/usr/include/stdlib.h" 2 3


 



 
extern int32_t random  (void)  throw ()  ;

 
extern void srandom  (unsigned int __seed)  throw ()  ;

 



extern void *  initstate  (unsigned int __seed, void *  __statebuf,
			       size_t __statelen)  throw ()  ;

 

extern void *  setstate  (void *  __statebuf)  throw ()  ;



 



struct random_data
  {
    int32_t *fptr;		 
    int32_t *rptr;		 
    int32_t *state;		 
    int rand_type;		 
    int rand_deg;		 
    int rand_sep;		 
    int32_t *end_ptr;		 
  };

extern int random_r  (struct random_data *__restrict __buf,
			  int32_t *__restrict __result)  throw ()  ;

extern int srandom_r  (unsigned int __seed, struct random_data *__buf)  throw ()  ;

extern int initstate_r  (unsigned int __seed,
			     void *  __restrict __statebuf,
			     size_t __statelen,
			     struct random_data *__restrict __buf)  throw ()  ;

extern int setstate_r  (void *  __restrict __statebuf,
			    struct random_data *__restrict __buf)  throw ()  ;




 
extern int rand  (void)  throw ()  ;
 
extern void srand  (unsigned int __seed)  throw ()  ;


 
extern int rand_r  (unsigned int *__seed)  throw ()  ;




 

 
extern double drand48  (void)  throw ()  ;
extern double erand48  (unsigned short int __xsubi[3])  throw ()  ;

 
extern long int lrand48  (void)  throw ()  ;
extern long int nrand48  (unsigned short int __xsubi[3])  throw ()  ;

 
extern long int mrand48  (void)  throw ()  ;
extern long int jrand48  (unsigned short int __xsubi[3])  throw ()  ;

 
extern void srand48  (long int __seedval)  throw ()  ;
extern unsigned short int *seed48  (unsigned short int __seed16v[3])  throw ()  ;
extern void lcong48  (unsigned short int __param[7])  throw ()  ;

 
struct drand48_data
  {
    unsigned short int x[3];	 
    unsigned short int a[3];	 
    unsigned short int c;	 
    unsigned short int old_x[3];  
    int init;			 
  };


 
extern int drand48_r  (struct drand48_data *__restrict __buffer,
			   double *__restrict __result)  throw ()  ;
extern int erand48_r  (unsigned short int __xsubi[3],
			   struct drand48_data *__restrict __buffer,
			   double *__restrict __result)  throw ()  ;

 
extern int lrand48_r  (struct drand48_data *__restrict __buffer,
			   long int *__restrict __result)  throw ()  ;
extern int nrand48_r  (unsigned short int __xsubi[3],
			   struct drand48_data *__restrict __buffer,
			   long int *__restrict __result)  throw ()  ;

 
extern int mrand48_r  (struct drand48_data *__restrict __buffer,
			   long int *__restrict __result)  throw ()  ;
extern int jrand48_r  (unsigned short int __xsubi[3],
			   struct drand48_data *__restrict __buffer,
			   long int *__restrict __result)  throw ()  ;

 
extern int srand48_r  (long int __seedval, struct drand48_data *__buffer)  throw ()  ;

extern int seed48_r  (unsigned short int __seed16v[3],
			  struct drand48_data *__buffer)  throw ()  ;

extern int lcong48_r  (unsigned short int __param[7],
			   struct drand48_data *__buffer)  throw ()  ;







 
extern void *  malloc  (size_t __size)  throw ()  ;
 
extern void *  calloc  (size_t __nmemb, size_t __size)  throw ()  ;



 

extern void *  realloc  (void *  __ptr, size_t __size)  throw ()  ;
 
extern void free  (void *  __ptr)  throw ()  ;


 
extern void cfree  (void *  __ptr)  throw ()  ;



# 1 "/usr/include/alloca.h" 1 3
 























# 1 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 1 3






 


# 19 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3



 


 





 


# 61 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 





 


















 





 

 

# 131 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 


# 188 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3





 




 

# 271 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


# 283 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3


 

 

# 317 "/usr/xtensa/stools/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/stddef.h" 3




 





















# 25 "/usr/include/alloca.h" 2 3


extern "C" { 

 


 
extern void *  alloca  (size_t __size)  throw ()  ;





} 


# 492 "/usr/include/stdlib.h" 2 3




 
extern void *  valloc  (size_t __size)  throw ()  ;



 
extern void abort  (void)  throw ()   __attribute__ ((__noreturn__));


 
extern int atexit  (void (*__func) (void))  throw ()  ;


 

extern int __on_exit  (void (*__func) (int __status, void *  __arg),
			   void *  __arg)  throw ()  ;
extern int on_exit  (void (*__func) (int __status, void *  __arg),
			 void *  __arg)  throw ()  ;


 


extern void exit  (int __status)  throw ()   __attribute__ ((__noreturn__));








 
extern char *getenv  (__const char *__name)  throw ()  ;

 

extern char *__secure_getenv  (__const char *__name)  throw ()  ;


 
 

extern int putenv  (__const char *__string)  throw ()  ;



 

extern int setenv  (__const char *__name, __const char *__value,
			int __replace)  throw ()  ;

 
extern void unsetenv  (__const char *__name)  throw ()  ;



 


extern int clearenv  (void)  throw ()  ;




 



extern char *mktemp  (char *__template)  throw ()  ;

 




extern int mkstemp  (char *__template)  throw ()  ;



 
extern int system  (__const char *__command)  throw ()  ;










 





extern char *realpath  (__const char *__restrict __name,
			    char *__restrict __resolved)  throw ()  ;



 


typedef int (*__compar_fn_t)  (__const void * , __const void * )  ;






 

extern void *  bsearch  (__const void *  __key, __const void *  __base,
			       size_t __nmemb, size_t __size,
			       __compar_fn_t __compar)  ;

 

extern void qsort  (void *  __base, size_t __nmemb, size_t __size,
			  __compar_fn_t __compar)  ;


 
extern int abs  (int __x)  throw ()   __attribute__ ((__const__));
extern long int labs  (long int __x)  throw ()   __attribute__ ((__const__));






 

 
extern div_t div  (int __numer, int __denom)  throw ()   __attribute__ ((__const__));
extern ldiv_t ldiv  (long int __numer, long int __denom)  throw ()  
     __attribute__ ((__const__));








 


 


extern char *ecvt  (double __value, int __ndigit, int *__restrict __decpt,
			int *__restrict __sign)  throw ()  ;

 


extern char *fcvt  (double __value, int __ndigit, int *__restrict __decpt,
			int *__restrict __sign)  throw ()  ;

 


extern char *gcvt  (double __value, int __ndigit, char *__buf)  throw ()  ;

 
extern char *qecvt  (long double  __value, int __ndigit,
			 int *__restrict __decpt, int *__restrict __sign)  throw ()  ;
extern char *qfcvt  (long double  __value, int __ndigit,
			 int *__restrict __decpt, int *__restrict __sign)  throw ()  ;
extern char *qgcvt  (long double  __value, int __ndigit, char *__buf)  throw ()  ;



 

extern int ecvt_r  (double __value, int __ndigit, int *__restrict __decpt,
			int *__restrict __sign, char *__restrict __buf,
			size_t __len)  throw ()  ;
extern int fcvt_r  (double __value, int __ndigit, int *__restrict __decpt,
			int *__restrict __sign, char *__restrict __buf,
			size_t __len)  throw ()  ;

extern int qecvt_r  (long double  __value, int __ndigit,
			 int *__restrict __decpt, int *__restrict __sign,
			 char *__restrict __buf, size_t __len)  throw ()  ;
extern int qfcvt_r  (long double  __value, int __ndigit,
			 int *__restrict __decpt, int *__restrict __sign,
			 char *__restrict __buf, size_t __len)  throw ()  ;




 

extern int mblen  (__const char *__s, size_t __n)  throw ()  ;
 

extern int mbtowc  (wchar_t *__restrict __pwc,
			__const char *__restrict __s, size_t __n)  throw ()  ;
 

extern int wctomb  (char *__s, wchar_t __wchar)  throw ()  ;


 
extern size_t mbstowcs  (wchar_t *__restrict  __pwcs,
			     __const char *__restrict __s, size_t __n)  throw ()  ;
 
extern size_t wcstombs  (char *__restrict __s,
			     __const wchar_t *__restrict __pwcs, size_t __n)  throw ()  ;



 



extern int rpmatch  (__const char *__response)  throw ()  ;



# 732 "/usr/include/stdlib.h" 3



# 756 "/usr/include/stdlib.h" 3


# 766 "/usr/include/stdlib.h" 3





} 


# 166 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/MEM_Pool.h" 2



class MEM_Pool;
typedef MEM_Pool* MEM_Pool_p;

class MEM_Pool
{
public:

  enum xtype { stack, cxx };

  MEM_Pool(xtype _type = stack, bool _destruct = true);
  MEM_Pool(const MEM_Pool& pool);
  MEM_Pool& operator=(const MEM_Pool& pool);
  ~MEM_Pool();

  void* allocate(size_t byte_count);
  void reallocate(void*& block,
                  size_t new_size_in_bytes, size_t old_size_in_bytes);
  void deallocate(void* block);

  typedef class mark mark_p;
  class mark
  {
  public:
    mark(MEM_Pool_p pool);
    mark(MEM_Pool& pool);
    mark(const mark& mark);
    mark& operator=(const mark& mark);
    ~mark();

  private:
    class markPrivate;
    typedef markPrivate* markPrivate_p;
    markPrivate_p privateData;
  };

  const xtype type;
  const bool destruct;

private:
  friend class mark;
  friend class mark::markPrivate;

  class poolPrivate;
  typedef poolPrivate* poolPrivate_p;

  poolPrivate_p const privateData;

  class destroyPool
  {
  public:
    destroyPool(MEM_Pool_p pool)
      : savedDestroyPool(current)
    {
      current = pool;
    }

    ~destroyPool()
    {
      current = savedDestroyPool;
    }

    static MEM_Pool_p current;

  private:
    MEM_Pool_p const savedDestroyPool;
  };
};


 


inline void* operator new(size_t size, MEM_Pool_p pool)
{
  return pool->allocate(size);
}

inline void* operator new(size_t size, MEM_Pool& pool)
{
  return pool.allocate(size);
}

inline void* operator new[](size_t size, MEM_Pool_p pool)
{
  return pool->allocate(size);
}

inline void* operator new[](size_t size, MEM_Pool& pool)
{
  return pool.allocate(size);
}



 
 

template <class T>
inline void MEM_Destroy(T* object, MEM_Pool_p pool)
{
  if (pool->destruct) {
    MEM_Pool::destroyPool dp(pool);
    object->~T();
  }
  pool->deallocate(static_cast<void*>(object));
}

template <class T>
inline void MEM_Destroy(T* object, MEM_Pool& pool)
{
  MEM_Destroy(object,&pool);
}

template <class T>
inline void MEM_Destroy(T* object)
{
  if (MEM_Pool::destroyPool::current->destruct)
    object->~T();

  MEM_Pool::destroyPool::current->deallocate(static_cast<void*>(object));
}

template <class T>
inline void MEM_DestroyArrayRunDestructors(T* object_array)
{
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

   
  int *p = (int*) object_array;
  int count = p[-1];

  for (int i = 0; i < count; ++i)
    (object_array + i)->~T();
}


template <class T>
inline void MEM_DestroyArray(T* object_array, MEM_Pool_p pool)
{
  if (pool->destruct) {
    MEM_Pool::destroyPool dp(pool);

    MEM_DestroyArrayRunDestructors(object_array);
  }

  pool->deallocate(static_cast<void*>(object_array));

}


template <class T>
inline void MEM_DestroyArray(T* object_array, MEM_Pool& pool)
{
  MEM_DestroyArray(object_array,&pool);
}


template <class T>
inline void MEM_DestroyArray(T* object)
{
  if (MEM_Pool::destroyPool::current->destruct)
    MEM_DestroyArrayRunDestructors(object_array);

  MEM_Pool::destroyPool::current->deallocate(static_cast<void*>(object_array));
}




 
 
 
 
 
 
# 223 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/bitset.h" 2


class BITSET
{
public:
    static const BITSET EmptySet;

    BITSET();

    static BITSET Universe(U32 size, MEM_Pool* pool);
    static BITSET UniverseD(BITSET& bs, U32 size, MEM_Pool* pool);
    static BITSET Empty(U32 alloc_size, MEM_Pool* pool);
    static BITSET EmptyD(BITSET bs);
    static BITSET Copy(const BITSET bs1, MEM_Pool* pool);
    static BITSET CopyD(BITSET& bs2, const BITSET bs1, MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                         MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                         U32 elt5, MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                         U32 elt5, U32 elt6, MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                         U32 elt5, U32 elt6, U32 elt7, MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                         U32 elt5, U32 elt6, U32 elt7, U32 elt8,
                         MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                         U32 elt5, U32 elt6, U32 elt7, U32 elt8, U32 elt9,
                         MEM_Pool* pool);
    static BITSET SetOf(U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                         U32 elt5, U32 elt6, U32 elt7, U32 elt8, U32 elt9,
                         U32 elt10, MEM_Pool* pool);

    
    static BITSET SetOfD(BITSET& bs, U32 elt1, MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3,
                         MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                          MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                          U32 elt5, MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                          U32 elt5, U32 elt6, MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                          U32 elt5, U32 elt6, U32 elt7, MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                          U32 elt5, U32 elt6, U32 elt7, U32 elt8,
                          MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                          U32 elt5, U32 elt6, U32 elt7, U32 elt8, U32 elt9,
                          MEM_Pool* pool);
    static BITSET SetOfD(BITSET& bs, U32 elt1, U32 elt2, U32 elt3, U32 elt4,
                          U32 elt5, U32 elt6, U32 elt7, U32 elt8, U32 elt9,
                          U32 elt10, MEM_Pool* pool);

    
    static bool Member(const BITSET bs, U32 elt);
    static BITSET UnionD(BITSET& bs, U32 elt, MEM_Pool* pool);
    static BITSET UnionD(BITSET& bs1, const BITSET bs2, MEM_Pool* pool);

    static BITSET Union(const BITSET bs, U32 elt, MEM_Pool* pool);
    static BITSET Union(const BITSET bs1, const BITSET bs2, MEM_Pool* pool);

    static BITSET IntersectD(BITSET bs, U32 elt);
    static BITSET IntersectD(BITSET bs1, BITSET bs2);

    static BITSET Intersect(const BITSET bs, U32 elt, MEM_Pool* pool);
    static BITSET Intersect(const BITSET bs1, const BITSET bs2,
                             MEM_Pool* pool);

    static BITSET ComplementD(BITSET& bs, U32 universe_size, MEM_Pool* pool);
    static BITSET Complement(const BITSET bs, U32 universe_size,
                              MEM_Pool* pool);

    static BITSET DifferenceD(BITSET bs, U32 elt);
    static BITSET DifferenceD(BITSET bs1, BITSET bs2);

    static BITSET Difference(const BITSET bs, U32 elt, MEM_Pool* pool);
    static BITSET Difference(const BITSET bs1, const BITSET bs2,
                              MEM_Pool* pool);

    static BITSET SymmetricDifferenceD(BITSET& bs1, const BITSET bs2,
                                       MEM_Pool* pool);
    static BITSET SymmetricDifferenceD(BITSET& bs1, U32 elt,
                                       MEM_Pool* pool);
    static BITSET SymmetricDifference(const BITSET bs1, U32 elt,
                                       MEM_Pool* pool);
    static BITSET SymmetricDifference(const BITSET bs1, const BITSET bs2,
                                      MEM_Pool* pool);

    static bool Contains(const BITSET bs1, const BITSET bs2);

    static bool ChooseFirst(U32& result, const BITSET bs);
    static bool ChooseFirst(U32& result, const BITSET bs,
                            U32 after, bool after_defined = true);

    static U32 ElementCount(const BITSET bs);

    class Iterator
    {
    public:
        Iterator(const BITSET& bs);
        U32 Current() const;
        void Step();
        bool HasCurrent() const;
    private:
        const BITSET& bs;
        U32 current;
        bool has_current;
    };

    static void Print(FILE* file, const BITSET bs);

    typedef U32 word_t;
    const static U32 bits_per_word = sizeof(word_t) * 8;
    const static U32 bytes_per_word = sizeof(word_t);
private:
    
    static word_t empty_words[1];

    word_t* words;

    word_t& word(U32 i) 
    {
        return words[i+1];
    }

    word_t& wordCount()
    {
        return words[0];
    }

    word_t wordCount() const
    {
        return words[0];
    }

    word_t bitCount() const
    {
        return words[0] * bits_per_word;
    }

    static U32 wordCount(U32 size)
    {
        return (size + (bits_per_word - 1)) / bits_per_word;
    }

    word_t* wordVec()
    {
        return words + 1;
    }

    word_t const * wordVec() const
    {
        return words + 1;
    }

    BITSET(U32 size, MEM_Pool* pool);

    static void
    possiblyGrow(BITSET& bs, U32 newbitsize, MEM_Pool* pool);

    template <class functor>
    static U32 FindMaxNonEmptyWordCount(const BITSET bs1, const BITSET bs2,
                                        functor f);

    template <class functor>
    static void ForEachWord(BITSET bs, functor f);

    template <class functor>
    static void ForEachWord(BITSET bs, U32 first_word, functor f);

    template <class functor>
    static void ForEachWord(BITSET bs1, BITSET bs2, functor f);

    template <class functor>
    static void ForEachWord(BITSET bs1, BITSET bs2, U32 first_word, functor f);

    template <class functor>
    static void ForEachWord(BITSET bs1, BITSET bs2, BITSET bs3, functor f);
};

ostream& operator<<(ostream& ostream,const BITSET bs);





 
 
 
 
 
# 231 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h" 2


template <class TYPE, class MAPPER>
class UNIVERSE
{
public:
    typedef TYPE UnderlyingType;

    class Set
    {
        friend class UNIVERSE;
    private:
        Set(BITSET _bitset)
            : bitset(_bitset)
        {}

        operator BITSET() const
        {
            return set.bitset;
        }

        BITSET bitset;
    };

    UNIVERSE(MEM_Pool* _pool, U32 initial_size = 512)
        : pool(pool),
          alloc_size(initial_size == 0 ? 512 : initial_size),
          element_count(0),
          elements((TYPE*) pool->allocate(sizeof(TYPE) * alloc_size))
    {}

    void AddElement(TYPE element)
    {
        if (element_count >= alloc_size) {
            U32 newalloc_size = alloc_size * 2;
            pool->reallocate((void*)elements,
                             sizeof(TYPE) * newalloc_size,
                             sizeof(TYPE) * alloc_size);
            alloc_size = newalloc_size;
        }

        U32 index = element_count++;
        elements[index] = element;
        MAPPER::Index(element,index);
    }

    static const Set EmptySet = BITSET::EmptySet;

    Set Universe()
    {
        return BITSET::Universe(element_count,pool);
    }

    Set UniverseD(Set* set)
    {
        return BITSET::UniverseD(set,element_count,pool);
    }

    Set Empty(bool fullsize = true)
    {
        if (fullsize)
            return BITSET::Empty(element_count,pool);
        else
            return EmptySet;
    }

    Set EmptyD(Set* set)
    {
        return BITSET::EmptyD(set);
    }

    Set Copy(const Set set)
    {
        return BITSET::Copy(set,pool);
    }


    Set CopyD(Set& set2, const Set set)
    {
        return BITSET::Copy(set2,set,pool);
    }
    

    Set SetOf(TYPE e0)
    {
        return BITSET::SetOf(CastIn(e0),pool);
    }

    Set SetOf(TYPE e0, TYPE e1)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),pool);
    }

    Set SetOf(TYPE e0, TYPE e1, TYPE e2, TYPE e3)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),pool);
    }

    Set SetOf(TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),pool);
    }

    Set SetOf(TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),pool);
    }

    Set SetOf(TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5, TYPE e6)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),pool);
    }

    Set SetOf(TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5, TYPE e6,
              TYPE e7)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),CastIn(e7),pool);
    }

    Set SetOf(TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5, TYPE e6,
              TYPE e7, TYPE e8)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),CastIn(e7),CastIn(e8),pool);
    }

    Set SetOf(TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5, TYPE e6,
              TYPE e7, TYPE e8, TYPE e9)
    {
        return BITSET::SetOf(CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),CastIn(e7),CastIn(e8),
                             CastIn(e9),pool);
    }

    Set SetOfD(Set& set, TYPE e0)
    {
        return BITSET::SetOfD(set,CastIn(e0),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1, TYPE e2, TYPE e3)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5,
               TYPE e6)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5,
               TYPE e6, TYPE e7)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),CastIn(e7),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5,
               TYPE e6, TYPE e7, TYPE e8)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),CastIn(e7),CastIn(e8),pool);
    }

    Set SetOfD(Set& set, TYPE e0, TYPE e1, TYPE e2, TYPE e3, TYPE e4, TYPE e5,
               TYPE e6, TYPE e7, TYPE e8, TYPE e9)
    {
        return BITSET::SetOfD(set,CastIn(e0),CastIn(e1),CastIn(e2),
                             CastIn(e3),CastIn(e4),CastIn(e5),
                             CastIn(e6),CastIn(e7),CastIn(e8),
                             CastIn(e9),pool);
    }


    bool Member(const Set set, TYPE elt)
    {
        return BITSET::Member(set,CastIn(elt));
    }

    Set UnionD(Set& set, TYPE elt)
    {
        return BITSET::UnionD(CastIn(set),CastIn(elt),pool);
    }

    Set UnionD(Set& set1, const Set set2)
    {
        return BITSET::UnionD(set1,set2,pool);
    }

    Set Union(const Set set, TYPE elt)
    {
        return BITSET::Union(set,CastIn(elt),pool);
    }

    Set Union(const Set set1, const Set set2)
    {
        return BITSET::Union(set1,set2,pool);
    }

    Set IntersectD(Set set, TYPE elt)
    {
        return BITSET::IntersectD(set,CastIn(elt));
    }

    Set IntersectD(Set set1, Set set2)
    {
        return BITSET::UnionD(set1,set2);
    }

    Set Intersect(const Set set, TYPE elt)
    {
        return BITSET::Intersect(set,CastIn(elt),pool);
    }

    Set Intersect(const Set set1, const Set set2)
    {
        return BITSET::Intersect(set1,set2,pool);
    }

    Set ComplementD(Set& set)
    {
        return BITSET::ComplementD(set,element_count,pool);
    }

    Set Complement(const Set set, U32 universe_size)
    {
        return BITSET::Complement(set,_element_count,pool);
    }

    Set DifferenceD(Set set, TYPE elt)
    {
        return BITSET::DifferenceD(set,CastIn(elt));
    }

    Set DifferenceD(Set set1, Set set2)
    {
        return BITSET::DifferenceD(set1,set2);
    }

    Set Difference(const Set set, TYPE elt)
    {
        return BITSET::Difference(set,CastIn(elt),pool);
    }

    Set Difference(const Set set1, const Set set2)
    {
        return BITSET::Union(set1,set2);
    }

    Set SymetricDifferenceD(Set& set1, const Set set2)
    {
        return BITSET::SymetricDifferenceD(set1,set2,pool);
    }

    Set SymetricDifference(const Set set1, const Set set2)
    {
        return BITSET::SymetricDifference(set,set2,pool);
    }

    bool Contains(const Set set1, const Set set2)
    {
        return BITSET::Contains(set1,set2);
    }

    bool ChooseFirst(TYPE& result, const Set set)
    {
        U32 inx;
        if (BITSET::ChooseFirst(inx,set)) {
            result = CastOut(inx);
            return true;
        }

        return false;
    }

    bool ChooseFirst(TYPE& result, const Set set, const TYPE& after)
    {
        U32 inx;
        if (BITSET::ChooseFirst(inx,set,CastIn(after))) {
            result = CastOut(inx);
            return true;
        }

        return false;
    }

    U32 ElementCount(const Set set)
    {
        return BITSET::ElementCount(set);
    }

    class Iterator
    {
    public:
        Iterator(UNIVERSE& universe, const Set set)
            : universe(universe),
              iterator(BITSET::Iterator(set))
        {}

        TYPE Current() const
        {
            return universe.CastOut(iterator.Current());
        }

        void Step()
        {
            iterator.Step();
        }

        bool HasCurrent() const
        {
            return iterator.HasCurrent();
        }

    private:
        friend class UNIVERSE;

        UNIVERSE& universe;
        BITSET::Iterator iterator;
    };

    Iterator MakeIterator(const Set set)
    {
        return Iterator(_this,set);
    }

    void Print(FILE* file, const Set set) const 
    {
        BITSET::Print(file,set);
    }

private:
    U32 CastIn(const TYPE elt) const
    {
        U32 u = MAPPER
        (( u < element_count ) || (assert_print  ("Unknown universe element")  ,  0 ) || (assert_fail("/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h",597,"u < element_count"),0)) ;
        return u;
    }

    TYPE CastOut(U32 u) const
    {
        (( u < element_count ) || (assert_print  ("Unkown universe element")  ,  0 ) || (assert_fail("/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe.h",603,"u < element_count"),0)) ;
        return elements[u];
    }

    MEM_Pool* const pool;
    U32 alloc_size;
    U32 element_count;
    TYPE* elements;
};




 
 
 
 
 
# 1 "/user/home/rutt/tensilica/cvsroot/Xtensa/Software/chainsaw/ccbe/../common/universe_test.cpp" 2



class X
{
public:
    int i;

    class Mapper
    {
    public:
        void index(X* x, int i)
        {
            x->i = i;
        }
        U32 incex(X* x)
        {
            return x->i;
        }
    };
};

typedef UNIVERSE<X*,X::Mapper> XUniverse;
typedef XUniverse::Set XSet;

int
main()
{
    MEM_Pool pool(MEM_Pool::stack,false);

    XUniverse xu(&pool);

    X* xv[512];

    for (int i = 0; i < 512; ++i) {
        X* x = new (pool) X;
        xv[i] = x;
        xu.AddElement(x);
    }

    XSet xs = xu.Empty();

    for (int i = 0; i < 512; ++i) {
        if (xv[i].i != i)
            cerr << "index not right for " << i << "\n";
    }
}


        

    
        


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]