00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef _VPR_TYPES_H_
00043 #define _VPR_TYPES_H_
00044
00045 #include <vpr/vprConfig.h>
00046
00047 #ifdef VPR_USE_NSPR
00048 # include <vpr/md/NSPR/vprTypesNSPR.h>
00049 #else
00050 namespace vpr
00051 {
00052 #if SIZEOF_CHAR == 1
00053 typedef char Int8;
00054 typedef unsigned char Uint8;
00055 #endif
00056
00057 #if SIZEOF_SHORT == 2
00058 typedef short Int16;
00059 typedef unsigned short Uint16;
00060 #elif SIZEOF_INT == 2
00061 typedef int Int16;
00062 typedef unsigned int Uint16;
00063 #endif
00064
00065 #if SIZEOF_INT == 4
00066 typedef int Int32;
00067 typedef unsigned int Uint32;
00068 #elif SIZEOF_LONG == 4
00069 typedef long Int32;
00070 typedef unsigned long Uint32;
00071 #endif
00072
00073 #if SIZEOF_LONG == 8
00074 typedef long Int64;
00075 typedef unsigned long Uint64;
00076 #elif SIZEOF_LONG_LONG == 8
00077 typedef long long Int64;
00078 typedef unsigned long long Uint64;
00079 #elif SIZEOF_INT == 8
00080 typedef int Int64;
00081 typedef unsigned int Uint64;
00082 #endif
00083 };
00084 #endif
00085
00086
00087
00088
00089 namespace vpr
00090 {
00091
00093 struct Unit64Hash
00094 {
00095 union Uint64_val
00096 {
00097 vpr::Uint64 full;
00098 struct
00099 {
00100 vpr::Uint32 low32;
00101 vpr::Uint32 high32;
00102 } nested;
00103 };
00104
00105 vpr::Uint32 operator() (vpr::Uint64 val) const
00106 {
00107 Uint64_val temp;
00108 temp.full = val;
00109 return temp.nested.low32 + temp.nested.high32;
00110 }
00111 };
00112
00113 }
00114
00115
00116
00117
00118 #if defined(VPR_OS_IRIX) && defined(__GNUC__) && \
00119 __GNUC__ == 3 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ <= 1
00120
00121 #include <iostream>
00122
00123 namespace std
00124 {
00125
00126 inline std::ostream& operator<< (std::ostream& out, const vpr::Uint64& v)
00127 {
00128 out << (vpr::Uint32) v;
00129 return out;
00130 }
00131
00132 }
00133 #endif
00134
00135
00136 #endif