00001 /* 00002 * Copyright 2002, 2003, 2004 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2 of the GNU General Public License as 00011 published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 Further, this software is distributed without any warranty that it is 00018 free of the rightful claim of any third person regarding infringement 00019 or the like. Any license provided herein, whether implied or 00020 otherwise, applies only to this software file. Patent licenses, if 00021 any, provided herein do not apply to combinations of this program with 00022 other software, or any other product whatsoever. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with this program; if not, write the Free Software Foundation, Inc., 59 00026 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00027 00028 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00029 Mountain View, CA 94043, or: 00030 00031 http://www.sgi.com 00032 00033 For further information regarding this notice, see: 00034 00035 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00036 00037 */ 00038 00039 00040 /* ==================================================================== 00041 * ==================================================================== 00042 * 00043 * Target Specific Miscellany Declarations which include target 00044 * dependencies. 00045 * 00046 * THIS FILE IS ONLY TO BE INCLUDE BY ../cgtarget.h!!!! 00047 * 00048 * ==================================================================== 00049 * ==================================================================== 00050 */ 00051 00052 #define INST_BYTES 4 00053 #define DEFAULT_LONG_BRANCH_LIMIT (0x1ffffff * INST_BYTES) 00054 #define DEFAULT_BRP_BRANCH_LIMIT DEFAULT_LONG_BRANCH_LIMIT 00055 #define MIN_BRANCH_DISP (2097151 * INST_BYTES) 00056 00057 00058 inline INT32 CGTARG_Branch_Taken_Penalty(void) 00059 { 00060 return CGTARG_branch_taken_penalty_overridden ? 00061 CGTARG_branch_taken_penalty : 1; 00062 } 00063 00064 inline INT32 CGTARG_Issue_Width(void) 00065 { 00066 return 4; 00067 } 00068 00069 inline BOOL 00070 CGTARG_Use_Brlikely(float branch_taken_probability) 00071 { 00072 return FALSE; 00073 } 00074 00075 inline BOOL 00076 CGTARG_Can_Predicate_Calls() 00077 { 00078 return FALSE; 00079 } 00080 00081 00082 inline BOOL 00083 CGTARG_Can_Predicate_Returns() 00084 { 00085 return FALSE; 00086 } 00087 00088 inline BOOL 00089 CGTARG_Can_Predicate_Branches() 00090 { 00091 return FALSE; 00092 } 00093 00094 inline INT 00095 CGTARG_Text_Alignment (void) 00096 { 00097 #ifdef TARG_SL 00098 extern BOOL CG_check_quadword; 00099 if (CG_check_quadword) 00100 return 16; 00101 else 00102 #endif 00103 return 4; 00104 } 00105 00106 inline TOP 00107 CGTARG_Noop_Top(void) 00108 { 00109 return TOP_nop; // return simulated nop 00110 } 00111 00112 inline TOP 00113 CGTARG_Noop_Top(ISA_EXEC_UNIT_PROPERTY unit) 00114 { 00115 return CGTARG_Noop_Top(); 00116 } 00117 00118 inline TOP 00119 CGTARG_Simulated_Top(OP *op, ISA_EXEC_UNIT_PROPERTY unit) 00120 { 00121 00122 TOP top = OP_code(op); 00123 00124 /* Prune the obvious cases. */ 00125 if (!TOP_is_simulated(top)) return top; 00126 00127 /* Placeholder for itemizing specific simulated ops */ 00128 return top; 00129 } 00130 00131 /* 00132 * TN *CGTARG_Return_Enum_TN(OP *op, ISA_ENUM_CLASS class, INT *pos) 00133 * if 'op' has an enum operand which matches the ISA_ENUM_CLASS 00134 * <class> type, return the enum TN and its operand position. 00135 */ 00136 inline TN* 00137 CGTARG_Return_Enum_TN(OP *op, ISA_ENUM_CLASS_VALUE enum_class, INT *pos) 00138 { 00139 INT i; 00140 00141 for (i = 0; i < OP_opnds(op); ++i) { 00142 TN *opnd_tn = OP_opnd(op, i); 00143 if (TN_is_enum(opnd_tn) && (enum_class == TN_enum(opnd_tn))) { 00144 *pos = i; 00145 return opnd_tn; 00146 } 00147 } 00148 00149 return NULL; 00150 } 00151 00152 inline BOOL 00153 CGTARG_Is_OP_Barrier(OP *op) 00154 { 00155 if (OP_code(op) == TOP_asm) { 00156 /* HD - So far, we don't complete the OP_Asm_Map support, 00157 so I comment all the below statements. 00158 extern OP_MAP OP_Asm_Map; 00159 ASM_OP_ANNOT* asm_info = (ASM_OP_ANNOT*) OP_MAP_Get(OP_Asm_Map, op); 00160 return (WN_Asm_Clobbers_Mem(ASM_OP_wn(asm_info))); 00161 */ 00162 return TRUE; 00163 } 00164 #ifdef TARG_SL2 00165 else if ( OP_code(op) == TOP_c2_joint || 00166 OP_code(op) == TOP_c2_thctrl_lock || 00167 OP_code(op) == TOP_c2_thctrl_unlock || 00168 OP_code(op) == TOP_c2_thctrl_deact || 00169 OP_code(op) == TOP_c2_thctrl_act || 00170 OP_code(op) == TOP_c2_thctrl_mode4 || 00171 OP_code(op) == TOP_c2_thctrl_mode5 || 00172 OP_code(op) == TOP_c2_thctrl_mode6 || 00173 OP_code(op) == TOP_c2_thctrl_mode7 || 00174 OP_code(op) == TOP_c2_fork_m || 00175 OP_code(op) == TOP_c2_fork_n || 00176 OP_code(op) == TOP_peripheral_rw_begin || 00177 OP_code(op) == TOP_peripheral_rw_end){ 00178 return TRUE; 00179 } 00180 #endif 00181 else 00182 return FALSE; 00183 } 00184 00185 inline BOOL 00186 CGTARG_Is_OP_Intrinsic(OP *op) 00187 { 00188 return OP_code(op) == TOP_intrncall; 00189 } 00190 00191 inline BOOL 00192 CGTARG_Is_Bad_Shift_Op (OP *op) 00193 { 00194 return FALSE; 00195 } 00196 00197 inline BOOL 00198 CGTARG_Is_Right_Shift_Op (OP *op) 00199 { 00200 switch (OP_code(op)) { 00201 case TOP_sra: 00202 case TOP_srav: 00203 case TOP_srl: 00204 case TOP_srlv: 00205 case TOP_dsra: 00206 case TOP_dsra32: 00207 case TOP_dsrav: 00208 case TOP_dsrl: 00209 case TOP_dsrl32: 00210 case TOP_dsrlv: 00211 return TRUE; 00212 } 00213 return FALSE; 00214 } 00215 00216 inline BOOL 00217 CGTARG_Is_OP_Addr_Incr(OP *op) 00218 { 00219 TOP top = OP_code(op); 00220 return((top == TOP_addi || top == TOP_addiu || 00221 top == TOP_daddi || top == TOP_daddiu) && 00222 TN_has_value(OP_opnd(op, 1)) && 00223 (OP_result(op, 0) == OP_opnd(op, 0))); 00224 } 00225 00226 inline BOOL 00227 CGTARG_Can_daddu_Be_Folded(OP *op1, OP *op2) 00228 { 00229 return FALSE; 00230 } 00231 00232 inline TOP 00233 CGTARG_Copy_Op(UINT8 size, BOOL is_float) 00234 { 00235 if (is_float) { 00236 return size == 4 ? TOP_mov_s : TOP_mov_d; 00237 } 00238 return size == 4 ? TOP_add : TOP_dadd; 00239 } 00240 00241 inline BOOL 00242 CGTARG_Have_Indexed_Mem_Insts(void) 00243 { 00244 return FALSE; 00245 } 00246 00247 inline BOOL 00248 Has_Single_FP_Condition_Code (void) 00249 { 00250 return FALSE; 00251 } 00252 00253 inline BOOL 00254 CGTARG_Is_OP_daddu(OP *op) 00255 { 00256 TOP top = OP_code(op); 00257 return top == TOP_daddu; 00258 } 00259 00260 inline BOOL 00261 CGTARG_Can_Predicate() 00262 { 00263 return FALSE; 00264 } 00265 00266 extern TOP CGTARG_Get_unc_Variant(TOP top); 00267 extern void Make_Branch_Conditional(BB *bb); 00268 00269 inline BOOL 00270 CGTARG_Has_Branch_Predict(void) 00271 { 00272 return TRUE; 00273 }
1.5.6