Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2 of the GNU General Public License as 00007 published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU General Public License along 00021 with this program; if not, write the Free Software Foundation, Inc., 59 00022 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00023 00024 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00025 Mountain View, CA 94043, or: 00026 00027 http://www.sgi.com 00028 00029 For further information regarding this notice, see: 00030 00031 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00032 00033 */ 00034 00035 #ifndef intrn_info_INCLUDED 00036 #define intrn_info_INCLUDED "intrn_info.h" 00037 00038 #include "defs.h" 00039 #include "wintrinsic.h" 00040 00041 /* Enumeration of mnemonic names for the return types of intrinsic 00042 * functions and operators. 00043 */ 00044 typedef enum INTRN_RETKIND { 00045 IRETURN_UNKNOWN, /* Indeterminate type */ 00046 IRETURN_V, /* MTYPE_V */ 00047 IRETURN_I1, /* MTYPE_I1 */ 00048 IRETURN_I2, /* MTYPE_I2 */ 00049 IRETURN_I4, /* MTYPE_I4 */ 00050 IRETURN_I8, /* MTYPE_I8 */ 00051 IRETURN_U1, /* MTYPE_U1 */ 00052 IRETURN_U2, /* MTYPE_U2 */ 00053 IRETURN_U4, /* MTYPE_U4 */ 00054 IRETURN_U8, /* MTYPE_U8 */ 00055 IRETURN_F4, /* MTYPE_F4 */ 00056 IRETURN_F8, /* MTYPE_F8 */ 00057 IRETURN_FQ, /* MTYPE_FQ */ 00058 IRETURN_C4, /* MTYPE_C4 */ 00059 IRETURN_C8, /* MTYPE_C8 */ 00060 IRETURN_CQ, /* MTYPE_CQ */ 00061 IRETURN_PV, /* Pointer to MTYPE_V */ 00062 IRETURN_PU1, /* Pointer to MTYPE_U1 */ 00063 IRETURN_DA1, /* Dereference argument 1 */ 00064 IRETURN_SZT, /* size_t */ 00065 IRETURN_PC, /* pointer to char */ 00066 IRETURN_F10, /* MTYPE_F10 */ 00067 IRETURN_A4, /* MTYPE_A4 */ 00068 IRETURN_A8, /* MTYPE_A8 */ 00069 IRETURN_M 00070 } INTRN_RETKIND; 00071 #define INTRN_RETKIND_LAST IRETURN_A8 00072 00073 // some defines to make parameters more readable 00074 #define BYVAL TRUE 00075 #define NOT_BYVAL FALSE 00076 #define PURE TRUE 00077 #define NOT_PURE FALSE 00078 #define NO_SIDEEFFECTS TRUE 00079 #define SIDEEFFECTS FALSE 00080 #define NEVER_RETURN TRUE 00081 #define DOES_RETURN FALSE 00082 #define ACTUAL TRUE 00083 #define NOT_ACTUAL FALSE 00084 #define CGINTRINSIC TRUE 00085 #define NOT_CGINTRINSIC FALSE 00086 00087 // the info we store for each intrinsic 00088 typedef struct intrn_info_t { 00089 mBOOL is_by_val; 00090 mBOOL is_pure; 00091 mBOOL has_no_side_effects; 00092 mBOOL never_returns; 00093 mBOOL is_actual; 00094 mBOOL is_cg_intrinsic; 00095 INTRN_RETKIND return_kind; 00096 char *c_name; 00097 char *specific_name; 00098 char *runtime_name; 00099 } intrn_info_t; 00100 00101 00102 // eraxxon: On Cygwin, it appears that the 'const' turns 'intrn_info' 00103 // into a *local* symbol. When this symbol is referenced in multiple 00104 // places, only one will contain the initialization in 00105 // 'intrn_info.cxx', causing big problems. The standard 'fix' on 00106 // Cygwin is to use a Microsoft language extension, 00107 // __declspec(dllexport) in the declaration, but this is really quite 00108 // hackish since this declaration tag is only valid for Windows DLLs. 00109 // Removing the 'const' fixes the problem on Cygwin without 00110 // introducing hackish Microsoft extensions. 00111 00112 extern /*const*/ intrn_info_t intrn_info[INTRINSIC_LAST+1]; 00113 00114 inline BOOL INTRN_by_value (const INTRINSIC i) 00115 { 00116 return intrn_info[i].is_by_val; 00117 } 00118 00119 inline BOOL INTRN_is_pure (const INTRINSIC i) 00120 { 00121 return intrn_info[i].is_pure; 00122 } 00123 00124 inline BOOL INTRN_has_no_side_effects (const INTRINSIC i) 00125 { 00126 return intrn_info[i].has_no_side_effects; 00127 } 00128 00129 inline BOOL INTRN_never_returns (const INTRINSIC i) 00130 { 00131 return intrn_info[i].never_returns; 00132 } 00133 00134 inline BOOL INTRN_is_actual (const INTRINSIC i) 00135 { 00136 return intrn_info[i].is_actual; 00137 } 00138 00139 inline BOOL INTRN_cg_intrinsic (const INTRINSIC i) 00140 { 00141 return intrn_info[i].is_cg_intrinsic; 00142 } 00143 00144 inline INTRN_RETKIND INTRN_return_kind (const INTRINSIC i) 00145 { 00146 return intrn_info[i].return_kind; 00147 } 00148 00149 inline char * INTRN_c_name (const INTRINSIC i) 00150 { 00151 return intrn_info[i].c_name; 00152 } 00153 00154 inline char * INTRN_specific_name (const INTRINSIC i) 00155 { 00156 return intrn_info[i].specific_name; 00157 } 00158 00159 inline char * INTRN_rt_name (const INTRINSIC i) 00160 { 00161 return intrn_info[i].runtime_name; 00162 } 00163 00164 #endif