Fennel: /home/pub/open/dev/fennel/calculator/PointerInstruction.h Source File (original) (raw)
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 #ifndef Fennel_PointerInstruction_Included 00029 #define Fennel_PointerInstruction_Included 00030 00031 #include "fennel/calculator/Instruction.h" 00032 00033 FENNEL_BEGIN_NAMESPACE 00034 00035 00042 typedef uint32_t PointerSizeT; 00043 #define POINTERSIZET_STANDARD_TYPE STANDARD_TYPE_UINT_32 00044 00057 typedef uint32_t PointerOperandT; 00058 #define POINTEROPERANDT_STANDARD_TYPE STANDARD_TYPE_UINT_32 00059 00060 class FENNEL_CALCULATOR_EXPORT PointerInstruction 00061 : public Instruction 00062 { 00063 public: 00064 explicit 00065 PointerInstruction() {} 00066 ~PointerInstruction() {} 00067 00068 protected: 00069 static vector 00070 regDesc( 00071 uint sizetArgs1, 00072 uint ptrArgs, 00073 StandardTypeDescriptorOrdinal type, 00074 uint operandArgs2) 00075 { 00076 vector v( 00077 sizetArgs1, 00078 POINTERSIZET_STANDARD_TYPE); 00079 uint i; 00080 for (i = 0; i < ptrArgs; i++) { 00081 v.push_back(type); 00082 } 00083 for (i = 0; i < operandArgs2; i++) { 00084 v.push_back(POINTEROPERANDT_STANDARD_TYPE); 00085 } 00086 return v; 00087 } 00088 }; 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 template class PointerInstruction_NotAPointerType; 00103 template <> class PointerInstruction_NotAPointerType<char *> {}; 00104 template <> class PointerInstruction_NotAPointerType<short *> {}; 00105 template <> class PointerInstruction_NotAPointerType<int *> {}; 00106 template <> class PointerInstruction_NotAPointerType<long *> {}; 00107 template <> class PointerInstruction_NotAPointerType<long long *> {}; 00108 template <> class PointerInstruction_NotAPointerType<unsigned char *> {}; 00109 template <> class PointerInstruction_NotAPointerType<unsigned short *> {}; 00110 template <> class PointerInstruction_NotAPointerType<unsigned int *> {}; 00111 template <> class PointerInstruction_NotAPointerType<unsigned long *> {}; 00112 template <> class PointerInstruction_NotAPointerType<unsigned long long *> {}; 00113 template <> class PointerInstruction_NotAPointerType<signed char *> {}; 00114 template <> class PointerInstruction_NotAPointerType<float *> {}; 00115 template <> class PointerInstruction_NotAPointerType<double *> {}; 00116 00117 FENNEL_END_NAMESPACE 00118 00119 #endif 00120 00121 00122