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 extern BOOL Trace_Exp;
00043 extern BOOL Trace_Exp2;
00044
00045
00046 #ifdef TARG_SL
00047 extern void Expand_Immediate (TN *dest, TN *src, TYPE_ID rtype, OPS *ops);
00048 #else
00049 extern void Expand_Immediate (TN *dest, TN *src, BOOL is_signed, OPS *ops);
00050 #endif
00051 extern void Expand_Const (TN *dest, TN *src, TYPE_ID mtype, OPS *ops);
00052 extern void Expand_Copy (TN *result, TN *src, TYPE_ID mtype, OPS *ops);
00053 #if defined(TARG_PR)
00054 extern void Expand_SR_Adj(BOOL isAdd, TN *result, TN *imm, OPS *ops);
00055 #endif
00056 extern void Expand_Add (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00057 extern void Expand_Sub (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00058 extern void Expand_Neg (TN *result, TN *src, TYPE_ID mtype, OPS *ops);
00059 extern void Expand_Aux_Sign (TN *result, TN *x, TN *y, TYPE_ID mtype, OPS *ops);
00060 extern void Expand_Abs (TN *result, TN *x, TYPE_ID mtype, OPS *ops);
00061 #ifdef TARG_IA64
00062 extern void Expand_Multiply (TN *result, TN *x, TN *y, TYPE_ID mtype, OPS *ops, OPCODE opcode);
00063 #else
00064 extern void Expand_Multiply (TN *result, TN *x, TN *y, TYPE_ID mtype, OPS *ops);
00065 #endif
00066 extern void Expand_High_Multiply (TN *result, TN *x, TN *y, TYPE_ID mtype, OPS *ops);
00067 extern void Expand_Sqrt (TN *result, TN *x, TYPE_ID mtype, OPS *ops);
00068 extern void Expand_Binary_Complement (TN *dest, TN *src, TYPE_ID mtype, OPS *ops);
00069 extern void Expand_Binary_And (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00070 extern void Expand_Binary_Or (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00071 extern void Expand_Binary_Xor (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00072 extern void Expand_Binary_Nor (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00073 extern void Expand_Logical_Not (TN *dest, TN *src, VARIANT variant, OPS *ops);
00074 extern void Expand_Logical_And (TN *dest, TN *src1, TN *src2, VARIANT variant, OPS *ops);
00075 extern void Expand_Logical_Or (TN *dest, TN *src1, TN *src2, VARIANT variant, OPS *ops);
00076 extern void Expand_Int_Less (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00077 extern void Expand_Int_Less_Equal (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00078 extern void Expand_Int_Greater (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00079 extern void Expand_Int_Greater_Equal (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00080 extern void Expand_Int_Equal (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00081 extern void Expand_Int_Not_Equal (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00082 extern void Expand_Bool_Equal (TN *dest, TN *src1, TN *src2, OPS *ops);
00083 extern void Expand_Bool_Not_Equal (TN *dest, TN *src1, TN *src2, OPS *ops);
00084 extern void Expand_Float_Less (TN *dest, TN *src1, TN *src2, VARIANT variant, TYPE_ID mtype, OPS *ops);
00085 extern void Expand_Float_Less_Equal (TN *dest, TN *src1, TN *src2, VARIANT variant, TYPE_ID mtype, OPS *ops);
00086 extern void Expand_Float_Greater (TN *dest, TN *src1, TN *src2, VARIANT variant, TYPE_ID mtype, OPS *ops);
00087 extern void Expand_Float_Greater_Equal (TN *dest, TN *src1, TN *src2, VARIANT variant, TYPE_ID mtype, OPS *ops);
00088 extern void Expand_Float_Equal (TN *dest, TN *src1, TN *src2, VARIANT variant, TYPE_ID mtype, OPS *ops);
00089 extern void Expand_Float_Not_Equal (TN *dest, TN *src1, TN *src2, VARIANT variant, TYPE_ID mtype, OPS *ops);
00090 extern void Expand_Convert_Length (TN *dest, TN *src, TN *length, TYPE_ID mtype, BOOL signed_extension, OPS *ops);
00091 #ifdef TARG_NVISA
00092 extern void Expand_Convert (TN *result, TYPE_ID rtype, TN *src, TYPE_ID stype, OPS *ops);
00093 #endif
00094 #if defined(TARG_X8664) || defined(TARG_MIPS)
00095 extern void Expand_Float_To_Float (TN *dest, TN *src, TYPE_ID rtype, TYPE_ID desc, OPS *ops);
00096 #else
00097 extern void Expand_Float_To_Float (TN *dest, TN *src, TYPE_ID mtype, OPS *ops);
00098 #endif
00099 extern void Expand_Int_To_Float (TN *dest, TN *src, TYPE_ID imtype, TYPE_ID fmtype, OPS *ops);
00100 extern void Expand_Float_To_Int_Cvt (TN *dest, TN *src, TYPE_ID imtype, TYPE_ID fmtype, OPS *ops);
00101 extern void Expand_Float_To_Int_Round (TN *dest, TN *src, TYPE_ID imtype, TYPE_ID fmtype, OPS *ops);
00102 extern void Expand_Float_To_Int_Trunc (TN *dest, TN *src, TYPE_ID imtype, TYPE_ID fmtype, OPS *ops);
00103 extern void Expand_Float_To_Int_Ceil (TN *dest, TN *src, TYPE_ID imtype, TYPE_ID fmtype, OPS *ops);
00104 extern void Expand_Float_To_Int_Floor (TN *dest, TN *src, TYPE_ID imtype, TYPE_ID fmtype, OPS *ops);
00105 #ifdef TARG_X8664
00106 extern void Expand_Float_To_Int_Tas (TN *dest, TN *src, TYPE_ID imtype, OPS *ops);
00107 extern void Expand_Int_To_Float_Tas (TN *dest, TN *src, TYPE_ID fmtype, OPS *ops);
00108 extern void Expand_Int_To_Vect_Tas (TN *dest, TN *src, TYPE_ID fmtype, OPS *ops);
00109 extern void Expand_Float_To_Float_Floorf (TN *dest, TN *src, TYPE_ID rtype, TYPE_ID desc, OPS *ops);
00110 extern void Expand_Float_To_Float_Floorl (TN *dest, TN *src, TYPE_ID rtype, TYPE_ID desc, OPS *ops);
00111 extern void Expand_Conv_To_Vector (TN *, TN *, TYPE_ID, TYPE_ID, OPS *);
00112 extern void Expand_Conv_From_Vector (TN *, TN *, TYPE_ID, TYPE_ID, OPS *);
00113 #endif
00114
00115 #if defined(TARG_X8664) || defined(TARG_MIPS)
00116 extern void Expand_Float_To_Float_Floor (TN *dest, TN *src, TYPE_ID rtype, TYPE_ID desc, OPS *ops);
00117 #endif // TARG_X8664 || TARG_MIPS
00118
00119 extern void Expand_Bool_To_Int (TN *dest, TN *src, TYPE_ID rtype, OPS *ops);
00120 extern void Expand_Min (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00121 extern void Expand_Max (TN *dest, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00122 extern void Expand_MinMax (TN *dest, TN *dest2, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00123 extern void Expand_Select (TN *dest_tn, TN *cond_tn, TN *true_tn, TN *false_tn, TYPE_ID mtype, BOOL float_cond, OPS *ops);
00124 extern void Expand_Flop (OPCODE opcode, TN *result, TN *src1, TN *src2, TN *src3, OPS *ops);
00125
00126 #ifdef TARG_X8664
00127 #define OP_NEED_PAIR(t) \
00128 (Is_Target_32bit() && ((t)==MTYPE_I8 || (t)==MTYPE_U8))
00129 extern void Expand_Replicate (OPCODE opcode, TN *result, TN *src1, OPS *ops);
00130 extern void Expand_Reduce_Add (OPCODE opcode, TN *result, TN *src1, OPS *ops);
00131 extern void Expand_Reduce_Mpy (OPCODE opcode, TN *result, TN *src1, OPS *ops);
00132 extern void Expand_Reduce_Max (OPCODE opcode, TN *result, TN *src1, OPS *ops);
00133 extern void Expand_Reduce_Min (OPCODE opcode, TN *result, TN *src1, OPS *ops);
00134 extern void Expand_Shuffle (OPCODE opcode, TN* result, TN* src1,
00135 VARIANT variant, OPS *ops);
00136 TN* Get_TN_Pair( TN* );
00137 TN* Create_TN_Pair( TN*, TYPE_ID );
00138 void Create_TN_Pair( TN*, TN* );
00139 #endif
00140
00141 #ifdef TARG_IA64
00142 extern TN* Expand_Immediate_Into_Register (TN *src, OPS *ops);
00143 #else
00144 extern TN* Expand_Immediate_Into_Register (TN *src, BOOL is_64bit, OPS *ops);
00145 #endif
00146 extern BOOL Expand_Special_And_Immed(TN *dest, TN *src1, INT64 imm, OPS *ops);
00147
00148
00149 typedef enum {shift_left, shift_aright, shift_lright} SHIFT_DIRECTION;
00150 extern void Expand_Shift (TN *result, TN *src1, TN *src2, TYPE_ID mtype, SHIFT_DIRECTION kind, OPS *ops);
00151 #ifdef TARG_X8664
00152 extern void Expand_Rrotate (TN *result, TN *src1, TN *src2, TYPE_ID rtype, TYPE_ID desc, OPS *ops);
00153 extern void Expand_Left_Rotate (TN *result, TN *src1, TN *src2, TYPE_ID rtype, TYPE_ID desc, OPS *ops);
00154 #endif
00155
00156
00157 extern void Expand_Lda (TN *dest, TN *src, OPS *ops);
00158
00159
00160 #if defined(TARG_MIPS) || defined(TARG_X8664)
00161 extern void Expand_Load (OPCODE opcode, TN *result, TN *src1, TN *src2, OPS *ops);
00162 extern void Expand_Store (TYPE_ID mtype, TN *src1, TN *src2, TN *src3, OPS *ops);
00163 #else
00164 extern void Expand_Load (OPCODE opcode, TN *result, TN *src1, TN *src2, VARIANT variant, OPS *ops);
00165 extern void Expand_Store (TYPE_ID mtype, TN *src1, TN *src2, TN *src3, VARIANT variant, OPS *ops);
00166 #endif
00167 extern void Expand_Misaligned_Load (OPCODE op, TN *result, TN *base, TN *disp, VARIANT variant, OPS *ops);
00168 extern void Expand_Misaligned_Store (TYPE_ID mtype, TN *obj_tn, TN *base_tn, TN *disp_tn, VARIANT variant, OPS *ops);
00169 extern void Expand_Lda_Label (TN *dest, TN *lab, OPS *ops);
00170
00171
00172 extern void Initialize_Branch_Variants(void);
00173 extern void Expand_Branch ( TN *targ, TN *src1, TN *src2, VARIANT variant, OPS *ops);
00174
00175
00176 extern TOP Pick_Compare_TOP (VARIANT *variant, TN **src1, TN **src2, OPS *ops);
00177
00178
00179 extern TN* Expand_Divide (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00180 #ifdef TARG_IA64
00181 extern void Expand_DivRem (TN *result, TN *result2, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops, OPCODE opcode);
00182 extern void Expand_Rem (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops, OPCODE opcode);
00183 extern void Expand_Mod (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops, OPCODE opcode);
00184 #else
00185 extern void Expand_DivRem (TN *result, TN *result2, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00186 extern void Expand_Rem (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00187 extern void Expand_Mod (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00188 #endif // TARG_IA64
00189
00190 extern void Expand_Float_Divide (TN *result, TN *src1, TN *src2, TYPE_ID mtype, OPS *ops);
00191 extern void Expand_Float_Recip (TN *result, TN *src, TYPE_ID mtype, OPS *ops);
00192
00193 #ifdef TARG_SL
00194 #define OP_NEED_PAIR(t) (((t)==MTYPE_I8) || ((t)==MTYPE_U8))
00195 extern TN* Get_TN_Pair(TN*);
00196 extern void Create_TN_Pair(TN*, TN*);
00197 extern TN* Create_TN_Pair(TN*, TYPE_ID);
00198 #endif
00199
00200 #ifdef TARG_NVISA
00201 extern INT Mtype_Index (TYPE_ID mtype);
00202 extern void Exp_Ldst_Init(void);
00203 #endif