Lines Matching full:env
130 static HReg lookupIRTemp(ISelEnv * env, IRTemp tmp) in lookupIRTemp() argument
132 vassert(tmp < env->n_vregmap); in lookupIRTemp()
133 return env->vregmap[tmp]; in lookupIRTemp()
136 static void lookupIRTemp64(HReg * vrHI, HReg * vrLO, ISelEnv * env, IRTemp tmp) in lookupIRTemp64() argument
138 vassert(tmp < env->n_vregmap); in lookupIRTemp64()
139 vassert(! hregIsInvalid(env->vregmapHI[tmp])); in lookupIRTemp64()
140 *vrLO = env->vregmap[tmp]; in lookupIRTemp64()
141 *vrHI = env->vregmapHI[tmp]; in lookupIRTemp64()
145 lookupIRTempPair(HReg * vrHI, HReg * vrLO, ISelEnv * env, IRTemp tmp) in lookupIRTempPair() argument
147 vassert(env->mode64); in lookupIRTempPair()
148 vassert(tmp < env->n_vregmap); in lookupIRTempPair()
149 vassert(! hregIsInvalid(env->vregmapHI[tmp])); in lookupIRTempPair()
150 *vrLO = env->vregmap[tmp]; in lookupIRTempPair()
151 *vrHI = env->vregmapHI[tmp]; in lookupIRTempPair()
154 static void addInstr(ISelEnv * env, MIPSInstr * instr) in addInstr() argument
156 addHInstr(env->code, instr); in addInstr()
163 static HReg newVRegI(ISelEnv * env) in newVRegI() argument
166 HRcGPR(env->mode64), 0/*enc*/, env->vreg_ctr); in newVRegI()
167 env->vreg_ctr++; in newVRegI()
171 static HReg newVRegD(ISelEnv * env) in newVRegD() argument
174 HRcFlt64, 0/*enc*/, env->vreg_ctr); in newVRegD()
175 env->vreg_ctr++; in newVRegD()
179 static HReg newVRegF(ISelEnv * env) in newVRegF() argument
182 HRcFPR(env->mode64), 0/*enc*/, env->vreg_ctr); in newVRegF()
183 env->vreg_ctr++; in newVRegF()
187 static void add_to_sp(ISelEnv * env, UInt n) in add_to_sp() argument
192 addInstr(env, MIPSInstr_Alu(Malu_DADD, sp, sp, MIPSRH_Imm(True, in add_to_sp()
195 addInstr(env, MIPSInstr_Alu(Malu_ADD, sp, sp, MIPSRH_Imm(True, in add_to_sp()
199 static void sub_from_sp(ISelEnv * env, UInt n) in sub_from_sp() argument
204 addInstr(env, MIPSInstr_Alu(Malu_DSUB, sp, sp, in sub_from_sp()
207 addInstr(env, MIPSInstr_Alu(Malu_SUB, sp, sp, in sub_from_sp()
228 static MIPSRH *iselWordExpr_RH_wrk(ISelEnv * env, Bool syned, IRExpr * e);
229 static MIPSRH *iselWordExpr_RH(ISelEnv * env, Bool syned, IRExpr * e);
233 static MIPSRH *iselWordExpr_RH5u_wrk(ISelEnv * env, IRExpr * e);
234 static MIPSRH *iselWordExpr_RH5u(ISelEnv * env, IRExpr * e);
238 static MIPSRH *iselWordExpr_RH6u_wrk(ISelEnv * env, IRExpr * e);
239 static MIPSRH *iselWordExpr_RH6u(ISelEnv * env, IRExpr * e);
242 static HReg iselWordExpr_R_wrk(ISelEnv * env, IRExpr * e);
243 static HReg iselWordExpr_R(ISelEnv * env, IRExpr * e);
246 static MIPSAMode *iselWordExpr_AMode_wrk(ISelEnv * env, IRExpr * e,
248 static MIPSAMode *iselWordExpr_AMode(ISelEnv * env, IRExpr * e, IRType xferTy);
250 static void iselInt64Expr_wrk(HReg * rHi, HReg * rLo, ISelEnv * env,
252 static void iselInt64Expr(HReg * rHi, HReg * rLo, ISelEnv * env, IRExpr * e);
256 ISelEnv * env, IRExpr * e);
257 static void iselInt128Expr(HReg * rHi, HReg * rLo, ISelEnv * env, IRExpr * e);
259 static MIPSCondCode iselCondCode_wrk(ISelEnv * env, IRExpr * e);
260 static MIPSCondCode iselCondCode(ISelEnv * env, IRExpr * e);
262 static HReg iselDblExpr_wrk(ISelEnv * env, IRExpr * e);
263 static HReg iselDblExpr(ISelEnv * env, IRExpr * e);
265 static HReg iselFltExpr_wrk(ISelEnv * env, IRExpr * e);
266 static HReg iselFltExpr(ISelEnv * env, IRExpr * e);
268 static void set_MIPS_rounding_mode(ISelEnv * env, IRExpr * mode) in set_MIPS_rounding_mode() argument
279 HReg irrm = iselWordExpr_R(env, mode); in set_MIPS_rounding_mode()
280 HReg tmp = newVRegI(env); in set_MIPS_rounding_mode()
281 HReg fcsr_old = newVRegI(env); in set_MIPS_rounding_mode()
284 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, tmp, irrm, in set_MIPS_rounding_mode()
286 addInstr(env, MIPSInstr_Alu(Malu_XOR, tmp, irrm, MIPSRH_Reg(tmp))); in set_MIPS_rounding_mode()
287 addInstr(env, MIPSInstr_Alu(Malu_AND, tmp, tmp, MIPSRH_Imm(False, 3))); in set_MIPS_rounding_mode()
289 addInstr(env, MIPSInstr_MfFCSR(fcsr_old)); in set_MIPS_rounding_mode()
290 sub_from_sp(env, 8); /* Move SP down 8 bytes */ in set_MIPS_rounding_mode()
294 addInstr(env, MIPSInstr_Store(4, am_addr, fcsr_old, mode64)); in set_MIPS_rounding_mode()
297 addInstr(env, MIPSInstr_MtFCSR(tmp)); in set_MIPS_rounding_mode()
300 static void set_MIPS_rounding_default(ISelEnv * env) in set_MIPS_rounding_default() argument
302 HReg fcsr = newVRegI(env); in set_MIPS_rounding_default()
307 addInstr(env, MIPSInstr_Load(4, fcsr, am_addr, mode64)); in set_MIPS_rounding_default()
309 add_to_sp(env, 8); /* Reset SP */ in set_MIPS_rounding_default()
312 addInstr(env, MIPSInstr_MtFCSR(fcsr)); in set_MIPS_rounding_default()
349 static HReg mk_LoadRR32toFPR(ISelEnv * env, HReg r_srcHi, HReg r_srcLo) in mk_LoadRR32toFPR() argument
351 HReg fr_dst = newVRegD(env); in mk_LoadRR32toFPR()
357 sub_from_sp(env, 16); /* Move SP down 16 bytes */ in mk_LoadRR32toFPR()
363 addInstr(env, MIPSInstr_Store(4, am_addr0, r_srcLo, mode64)); in mk_LoadRR32toFPR()
364 addInstr(env, MIPSInstr_Store(4, am_addr1, r_srcHi, mode64)); in mk_LoadRR32toFPR()
366 addInstr(env, MIPSInstr_Store(4, am_addr0, r_srcHi, mode64)); in mk_LoadRR32toFPR()
367 addInstr(env, MIPSInstr_Store(4, am_addr1, r_srcLo, mode64)); in mk_LoadRR32toFPR()
375 addInstr(env, MIPSInstr_FpLdSt(True /*load */ , 8, fr_dst, am_addr0)); in mk_LoadRR32toFPR()
377 add_to_sp(env, 16); /* Reset SP */ in mk_LoadRR32toFPR()
390 ISelEnv* env, in doHelperCall() argument
513 aTy = typeOfIRExpr(env->type_env, arg); in doHelperCall()
517 addInstr(env, mk_iMOVds_RR(argregs[argreg], in doHelperCall()
518 iselWordExpr_R(env, arg))); in doHelperCall()
526 iselInt64Expr(&rHi, &rLo, env, arg); in doHelperCall()
528 addInstr(env, mk_iMOVds_RR( argregs[argreg++], rHi )); in doHelperCall()
530 addInstr(env, mk_iMOVds_RR( argregs[argreg], rLo)); in doHelperCall()
534 addInstr(env, mk_iMOVds_RR(argregs[argreg], in doHelperCall()
554 aTy = typeOfIRExpr(env->type_env, arg); in doHelperCall()
557 tmpregs[argreg] = iselWordExpr_R(env, arg); in doHelperCall()
565 iselInt64Expr(&raHi, &raLo, env, arg); in doHelperCall()
590 cc = iselCondCode(env, guard); in doHelperCall()
591 src = iselWordExpr_R(env, guard); in doHelperCall()
601 addInstr(env, mk_iMOVds_RR(argregs[i], tmpregs[i])); in doHelperCall()
644 addInstr(env, MIPSInstr_CallAlways(cc, target, argiregs, in doHelperCall()
647 addInstr(env, MIPSInstr_Call(cc, target, argiregs, src, *retloc)); in doHelperCall()
682 static Bool sane_AMode(ISelEnv * env, MIPSAMode * am) in sane_AMode() argument
699 static MIPSAMode *iselWordExpr_AMode(ISelEnv * env, IRExpr * e, IRType xferTy) in iselWordExpr_AMode() argument
701 MIPSAMode *am = iselWordExpr_AMode_wrk(env, e, xferTy); in iselWordExpr_AMode()
702 vassert(sane_AMode(env, am)); in iselWordExpr_AMode()
707 static MIPSAMode *iselWordExpr_AMode_wrk(ISelEnv * env, IRExpr * e, in iselWordExpr_AMode_wrk() argument
710 IRType ty = typeOfIRExpr(env->type_env, e); in iselWordExpr_AMode_wrk()
711 if (env->mode64) { in iselWordExpr_AMode_wrk()
723 iselWordExpr_R(env, e->Iex.Binop.arg1)); in iselWordExpr_AMode_wrk()
728 HReg r_base = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_AMode_wrk()
729 HReg r_idx = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_AMode_wrk()
742 iselWordExpr_R(env, e->Iex.Binop.arg1)); in iselWordExpr_AMode_wrk()
747 HReg r_base = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_AMode_wrk()
748 HReg r_idx = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_AMode_wrk()
756 return MIPSAMode_IR(0, iselWordExpr_R(env, e)); in iselWordExpr_AMode_wrk()
777 static HReg iselWordExpr_R(ISelEnv * env, IRExpr * e) in iselWordExpr_R() argument
779 HReg r = iselWordExpr_R_wrk(env, e); in iselWordExpr_R()
782 vassert(hregClass(r) == HRcGPR(env->mode64)); in iselWordExpr_R()
788 static HReg iselWordExpr_R_wrk(ISelEnv * env, IRExpr * e) in iselWordExpr_R_wrk() argument
791 IRType ty = typeOfIRExpr(env->type_env, e); in iselWordExpr_R_wrk()
799 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselWordExpr_R_wrk()
803 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
804 MIPSAMode *am_addr = iselWordExpr_AMode(env, e->Iex.Load.addr, ty); in iselWordExpr_R_wrk()
810 addInstr(env, MIPSInstr_Load(toUChar(sizeofIRType(ty)), in iselWordExpr_R_wrk()
871 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
872 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
880 ri_srcR = iselWordExpr_RH(env, True /*signed */ , in iselWordExpr_R_wrk()
886 ri_srcR = iselWordExpr_RH(env, False /*unsigned */, in iselWordExpr_R_wrk()
892 addInstr(env, MIPSInstr_Alu(aluOp, r_dst, r_srcL, ri_srcR)); in iselWordExpr_R_wrk()
917 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
918 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
921 ri_srcR = iselWordExpr_RH6u(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
923 ri_srcR = iselWordExpr_RH5u(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
929 HReg tmp = newVRegI(env); in iselWordExpr_R_wrk()
930 HReg r_srcL_se = newVRegI(env); in iselWordExpr_R_wrk()
938 addInstr(env, MIPSInstr_Shft(Mshft_SLL, False, tmp, in iselWordExpr_R_wrk()
940 addInstr(env, MIPSInstr_Shft(Mshft_SRA, False, r_srcL_se, in iselWordExpr_R_wrk()
943 addInstr(env, MIPSInstr_Shft(shftOp, True /*32bit shift */, in iselWordExpr_R_wrk()
946 addInstr(env, MIPSInstr_Shft(shftOp, True /*32bit shift */, in iselWordExpr_R_wrk()
950 addInstr(env, MIPSInstr_Shft(shftOp, False/*64bit shift */, in iselWordExpr_R_wrk()
978 HReg dst = newVRegI(env); in iselWordExpr_R_wrk()
979 HReg r1 = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
980 HReg r2 = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1039 addInstr(env, MIPSInstr_Cmp(syned, size32, dst, r1, r2, cc)); in iselWordExpr_R_wrk()
1044 HReg tmp = newVRegI(env); in iselWordExpr_R_wrk()
1045 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1046 HReg argL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1047 HReg argR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1048 MIPSRH *argRH = iselWordExpr_RH(env, False /*signed */ , in iselWordExpr_R_wrk()
1055 addInstr(env, MIPSInstr_Alu(Malu_SLT, tmp, argL, argRH)); in iselWordExpr_R_wrk()
1056 addInstr(env, mk_iMOVds_RR(r_dst, argL)); in iselWordExpr_R_wrk()
1057 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, r_dst, argR, tmp)); in iselWordExpr_R_wrk()
1063 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1064 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1065 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1066 addInstr(env, MIPSInstr_Mul(False/*Unsigned or Signed */ , in iselWordExpr_R_wrk()
1074 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1075 HReg tHi = newVRegI(env); in iselWordExpr_R_wrk()
1076 HReg tLo = newVRegI(env); in iselWordExpr_R_wrk()
1077 HReg tLo_1 = newVRegI(env); in iselWordExpr_R_wrk()
1078 HReg tHi_1 = newVRegI(env); in iselWordExpr_R_wrk()
1079 HReg mask = newVRegI(env); in iselWordExpr_R_wrk()
1084 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1085 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1086 addInstr(env, MIPSInstr_Mul(syned /*Unsigned or Signed */ , in iselWordExpr_R_wrk()
1091 addInstr(env, MIPSInstr_Mfhi(tHi)); in iselWordExpr_R_wrk()
1092 addInstr(env, MIPSInstr_Mflo(tLo)); in iselWordExpr_R_wrk()
1094 addInstr(env, MIPSInstr_Shft(Mshft_SLL, False, tHi_1, in iselWordExpr_R_wrk()
1097 addInstr(env, MIPSInstr_LI(mask, 0xffffffff)); in iselWordExpr_R_wrk()
1098 addInstr(env, MIPSInstr_Alu(Malu_AND, tLo_1, tLo, in iselWordExpr_R_wrk()
1101 addInstr(env, MIPSInstr_Alu(Malu_OR, r_dst, tHi_1, in iselWordExpr_R_wrk()
1110 r_srcL = iselFltExpr(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1111 r_srcR = iselFltExpr(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1113 r_srcL = iselDblExpr(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1114 r_srcR = iselDblExpr(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1116 HReg tmp = newVRegI(env); in iselWordExpr_R_wrk()
1117 HReg r_ccMIPS = newVRegI(env); in iselWordExpr_R_wrk()
1118 HReg r_ccIR = newVRegI(env); in iselWordExpr_R_wrk()
1119 HReg r_ccIR_b0 = newVRegI(env); in iselWordExpr_R_wrk()
1120 HReg r_ccIR_b2 = newVRegI(env); in iselWordExpr_R_wrk()
1121 HReg r_ccIR_b6 = newVRegI(env); in iselWordExpr_R_wrk()
1125 addInstr(env, MIPSInstr_FpCompare(Mfp_CMP_EQ, tmp, r_srcL, r_srcR)); in iselWordExpr_R_wrk()
1126 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, r_ccMIPS, tmp, in iselWordExpr_R_wrk()
1129 addInstr(env, MIPSInstr_FpCompare(Mfp_CMP_UN, tmp, r_srcL, r_srcR)); in iselWordExpr_R_wrk()
1130 addInstr(env, MIPSInstr_Alu(Malu_OR, r_ccMIPS, r_ccMIPS, in iselWordExpr_R_wrk()
1133 addInstr(env, MIPSInstr_FpCompare(Mfp_CMP_LT, tmp, r_srcL, r_srcR)); in iselWordExpr_R_wrk()
1134 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, tmp, in iselWordExpr_R_wrk()
1136 addInstr(env, MIPSInstr_Alu(Malu_OR, r_ccMIPS, r_ccMIPS, in iselWordExpr_R_wrk()
1139 addInstr(env, MIPSInstr_FpCompare(Mfp_CMP_NGT, in iselWordExpr_R_wrk()
1141 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, tmp, tmp, in iselWordExpr_R_wrk()
1144 addInstr(env, MIPSInstr_Alu(Malu_NOR, tmp, tmp, MIPSRH_Reg(tmp))); in iselWordExpr_R_wrk()
1145 addInstr(env, MIPSInstr_Alu(Malu_AND, tmp, tmp, in iselWordExpr_R_wrk()
1147 addInstr(env, MIPSInstr_Alu(Malu_OR, r_ccMIPS, r_ccMIPS, in iselWordExpr_R_wrk()
1160 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True, r_ccIR_b0, r_ccMIPS, in iselWordExpr_R_wrk()
1162 addInstr(env, MIPSInstr_Alu(Malu_OR, r_ccIR_b0, r_ccMIPS, in iselWordExpr_R_wrk()
1164 addInstr(env, MIPSInstr_Alu(Malu_AND, r_ccIR_b0, r_ccIR_b0, in iselWordExpr_R_wrk()
1168 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, r_ccIR_b2, r_ccMIPS, in iselWordExpr_R_wrk()
1170 addInstr(env, MIPSInstr_Alu(Malu_AND, r_ccIR_b2, r_ccIR_b2, in iselWordExpr_R_wrk()
1174 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True, r_ccIR_b6, in iselWordExpr_R_wrk()
1176 addInstr(env, MIPSInstr_Alu(Malu_OR, r_ccIR_b6, r_ccMIPS, in iselWordExpr_R_wrk()
1178 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, r_ccIR_b6, r_ccIR_b6, in iselWordExpr_R_wrk()
1180 addInstr(env, MIPSInstr_Alu(Malu_AND, r_ccIR_b6, r_ccIR_b6, in iselWordExpr_R_wrk()
1184 addInstr(env, MIPSInstr_Alu(Malu_OR, r_ccIR, r_ccIR_b0, in iselWordExpr_R_wrk()
1186 addInstr(env, MIPSInstr_Alu(Malu_OR, r_ccIR, r_ccIR, in iselWordExpr_R_wrk()
1193 HReg tLo = newVRegI(env); in iselWordExpr_R_wrk()
1194 HReg tHi = newVRegI(env); in iselWordExpr_R_wrk()
1195 HReg mask = newVRegI(env); in iselWordExpr_R_wrk()
1196 HReg tLo_1 = newVRegI(env); in iselWordExpr_R_wrk()
1197 HReg tHi_1 = newVRegI(env); in iselWordExpr_R_wrk()
1198 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1201 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1202 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1204 addInstr(env, MIPSInstr_Div(syned, True, r_srcL, r_srcR)); in iselWordExpr_R_wrk()
1205 addInstr(env, MIPSInstr_Mfhi(tHi)); in iselWordExpr_R_wrk()
1206 addInstr(env, MIPSInstr_Mflo(tLo)); in iselWordExpr_R_wrk()
1208 addInstr(env, MIPSInstr_Shft(Mshft_SLL, False, tHi_1, tHi, in iselWordExpr_R_wrk()
1211 addInstr(env, MIPSInstr_LI(mask, 0xffffffff)); in iselWordExpr_R_wrk()
1212 addInstr(env, MIPSInstr_Alu(Malu_AND, tLo_1, tLo, in iselWordExpr_R_wrk()
1215 addInstr(env, MIPSInstr_Alu(Malu_OR, r_dst, tHi_1, in iselWordExpr_R_wrk()
1223 HReg tHi = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1224 HReg tLo = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1225 HReg tLo_1 = newVRegI(env); in iselWordExpr_R_wrk()
1226 HReg tHi_1 = newVRegI(env); in iselWordExpr_R_wrk()
1227 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1246 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, tHi_1, tHi, in iselWordExpr_R_wrk()
1248 addInstr(env, MIPSInstr_Alu(Malu_AND, tLo_1, tLo, in iselWordExpr_R_wrk()
1250 addInstr(env, MIPSInstr_Alu(Malu_OR, r_dst, tHi_1, in iselWordExpr_R_wrk()
1257 HReg tHi = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1258 HReg tLo = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1259 HReg tLo_1 = newVRegI(env); in iselWordExpr_R_wrk()
1260 HReg tHi_1 = newVRegI(env); in iselWordExpr_R_wrk()
1261 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1262 HReg mask = newVRegI(env); in iselWordExpr_R_wrk()
1264 addInstr(env, MIPSInstr_Shft(Mshft_SLL, False, tHi_1, tHi, in iselWordExpr_R_wrk()
1267 addInstr(env, MIPSInstr_LI(mask, 0xffffffff)); in iselWordExpr_R_wrk()
1268 addInstr(env, MIPSInstr_Alu(Malu_AND, tLo_1, tLo, in iselWordExpr_R_wrk()
1270 addInstr(env, MIPSInstr_Alu(Malu_OR, r_dst, tHi_1, in iselWordExpr_R_wrk()
1278 HReg valS = newVRegI(env); in iselWordExpr_R_wrk()
1279 HReg tmpF = newVRegF(env); in iselWordExpr_R_wrk()
1280 HReg valF = iselFltExpr(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1283 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1284 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTLS, tmpF, valF)); in iselWordExpr_R_wrk()
1285 set_MIPS_rounding_default(env); in iselWordExpr_R_wrk()
1289 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_dmfc1, valS, tmpF)); in iselWordExpr_R_wrk()
1297 valD = iselFltExpr(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1299 valD = iselDblExpr(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1300 HReg valS = newVRegF(env); in iselWordExpr_R_wrk()
1301 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1304 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1305 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTWD, valS, valD)); in iselWordExpr_R_wrk()
1306 set_MIPS_rounding_default(env); in iselWordExpr_R_wrk()
1310 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_mfc1, r_dst, valS)); in iselWordExpr_R_wrk()
1345 HReg regL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1346 HReg regR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1347 HReg res = newVRegI(env); in iselWordExpr_R_wrk()
1348 addInstr(env, mk_iMOVds_RR(hregMIPS_GPR4(env->mode64), regL)); in iselWordExpr_R_wrk()
1349 addInstr(env, mk_iMOVds_RR(hregMIPS_GPR5(env->mode64), regR)); in iselWordExpr_R_wrk()
1352 addInstr(env, MIPSInstr_CallAlways( MIPScc_AL, in iselWordExpr_R_wrk()
1355 addInstr(env, mk_iMOVds_RR(res, hregMIPS_GPR2(env->mode64))); in iselWordExpr_R_wrk()
1375 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1376 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1420 addInstr(env, MIPSInstr_Shft(Mshft_SLL, sz32, r_dst, r_src, in iselWordExpr_R_wrk()
1422 addInstr(env, MIPSInstr_Shft(Mshft_SRA, sz32, r_dst, r_dst, in iselWordExpr_R_wrk()
1429 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1430 HReg r_srcL = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1433 addInstr(env, MIPSInstr_LI(r_dst, 0x1)); in iselWordExpr_R_wrk()
1434 addInstr(env, MIPSInstr_Alu(Malu_SUB, r_dst, r_dst, r_srcR)); in iselWordExpr_R_wrk()
1442 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1443 HReg r_srcL = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1446 addInstr(env, MIPSInstr_Alu(Malu_NOR, r_dst, r_srcL, r_srcR)); in iselWordExpr_R_wrk()
1451 HReg fr_src = iselFltExpr(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1452 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1456 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_mfc1, r_dst, fr_src)); in iselWordExpr_R_wrk()
1463 HReg fr_src = iselFltExpr(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1464 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1468 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_dmfc1, r_dst, fr_src)); in iselWordExpr_R_wrk()
1476 valD = iselFltExpr(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1478 valD = iselDblExpr(env, e->Iex.Binop.arg2); in iselWordExpr_R_wrk()
1479 HReg valS = newVRegF(env); in iselWordExpr_R_wrk()
1480 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1482 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselWordExpr_R_wrk()
1483 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTWD, valS, valD)); in iselWordExpr_R_wrk()
1484 set_MIPS_rounding_default(env); in iselWordExpr_R_wrk()
1488 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_mfc1, r_dst, valS)); in iselWordExpr_R_wrk()
1497 return iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1500 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1501 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1502 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselWordExpr_R_wrk()
1512 r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1513 r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1514 addInstr(env, MIPSInstr_Alu(Malu_AND, r_dst, r_src, in iselWordExpr_R_wrk()
1520 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1521 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1522 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselWordExpr_R_wrk()
1535 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1536 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1560 addInstr(env, MIPSInstr_Alu(Malu_AND, r_dst, r_src, in iselWordExpr_R_wrk()
1566 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1567 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1569 addInstr(env, MIPSInstr_Shft(Mshft_SLL, False /*!32bit shift */, in iselWordExpr_R_wrk()
1571 addInstr(env, MIPSInstr_Shft(Mshft_SRL, False /*!32bit shift */, in iselWordExpr_R_wrk()
1577 if (env->mode64) { in iselWordExpr_R_wrk()
1578 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1579 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1580 addInstr(env, MIPSInstr_Shft(Mshft_SRA, False /*64bit shift */, in iselWordExpr_R_wrk()
1585 iselInt64Expr(&rHi, &rLo, env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1591 if (env->mode64) { in iselWordExpr_R_wrk()
1592 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1593 r_dst = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1597 iselInt64Expr(&rHi, &rLo, env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1603 vassert(env->mode64); in iselWordExpr_R_wrk()
1604 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1605 r_dst = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1610 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1611 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1613 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /*!32bit shift */, in iselWordExpr_R_wrk()
1620 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1621 HReg tmp = newVRegI(env); in iselWordExpr_R_wrk()
1622 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1625 addInstr(env, MIPSInstr_Alu(Malu_AND, tmp, r_src, in iselWordExpr_R_wrk()
1627 addInstr(env, MIPSInstr_Cmp(False, True, r_dst, tmp, in iselWordExpr_R_wrk()
1633 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1634 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1636 addInstr(env, MIPSInstr_Cmp(False, True, r_dst, r_src, in iselWordExpr_R_wrk()
1642 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1643 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1645 addInstr(env, MIPSInstr_Alu(Malu_SUB, r_dst, hregMIPS_GPR0(mode64), in iselWordExpr_R_wrk()
1648 addInstr(env, MIPSInstr_Alu(Malu_OR, r_dst, r_dst, in iselWordExpr_R_wrk()
1650 addInstr(env, MIPSInstr_Shft(Mshft_SRA, True, r_dst, r_dst, in iselWordExpr_R_wrk()
1661 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1662 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1664 addInstr(env, MIPSInstr_Alu(op, r_dst, in iselWordExpr_R_wrk()
1667 addInstr(env, MIPSInstr_Alu(Malu_OR, r_dst, r_dst, in iselWordExpr_R_wrk()
1675 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1676 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1678 addInstr(env, MIPSInstr_Unary(op, r_dst, r_src)); in iselWordExpr_R_wrk()
1684 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1686 if (env->mode64) { in iselWordExpr_R_wrk()
1687 r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1689 r_src = newVRegI(env); in iselWordExpr_R_wrk()
1690 iselInt64Expr(&hi, &lo, env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1691 addInstr(env, MIPSInstr_Alu(Malu_OR, r_src, lo, MIPSRH_Reg(hi))); in iselWordExpr_R_wrk()
1693 addInstr(env, MIPSInstr_Cmp(False, !(env->mode64), r_dst, r_src, in iselWordExpr_R_wrk()
1700 HReg tmp2 = newVRegI(env); in iselWordExpr_R_wrk()
1701 vassert(env->mode64); in iselWordExpr_R_wrk()
1702 tmp1 = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1704 addInstr(env, MIPSInstr_Alu(Malu_DSUB, tmp2, hregMIPS_GPR0(mode64), in iselWordExpr_R_wrk()
1707 addInstr(env, MIPSInstr_Alu(Malu_OR, tmp2, tmp2, MIPSRH_Reg(tmp1))); in iselWordExpr_R_wrk()
1708 addInstr(env, MIPSInstr_Shft(Mshft_SRA, False, tmp2, tmp2, in iselWordExpr_R_wrk()
1716 iselInt128Expr(&rHi, &rLo, env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1723 iselInt128Expr(&rHi, &rLo, env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1756 HReg regL = iselWordExpr_R(env, e->Iex.Unop.arg); in iselWordExpr_R_wrk()
1757 HReg res = newVRegI(env); in iselWordExpr_R_wrk()
1758 addInstr(env, mk_iMOVds_RR(hregMIPS_GPR4(env->mode64), regL)); in iselWordExpr_R_wrk()
1760 addInstr(env, MIPSInstr_CallAlways( MIPScc_AL, in iselWordExpr_R_wrk()
1763 addInstr(env, mk_iMOVds_RR(res, hregMIPS_GPR2(env->mode64))); in iselWordExpr_R_wrk()
1774 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1778 addInstr(env, MIPSInstr_Load(toUChar(sizeofIRType(ty)), r_dst, am_addr, in iselWordExpr_R_wrk()
1789 typeOfIRExpr(env->type_env, e->Iex.ITE.cond) == Ity_I1) { in iselWordExpr_R_wrk()
1790 HReg r_dst = iselWordExpr_R(env, e->Iex.ITE.iffalse); in iselWordExpr_R_wrk()
1791 HReg r1 = iselWordExpr_R(env, e->Iex.ITE.iftrue); in iselWordExpr_R_wrk()
1792 HReg r_cond = iselWordExpr_R(env, e->Iex.ITE.cond); in iselWordExpr_R_wrk()
1797 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, r_dst, r1, r_cond)); in iselWordExpr_R_wrk()
1807 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1827 addInstr(env, MIPSInstr_LI(r_dst, (ULong) l)); in iselWordExpr_R_wrk()
1833 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1845 doHelperCall(&addToSp, &rloc, env, NULL/*guard*/, e->Iex.CCall.cee, in iselWordExpr_R_wrk()
1851 addInstr(env, mk_iMOVds_RR(r_dst, hregMIPS_GPR2(mode64))); in iselWordExpr_R_wrk()
1878 static MIPSRH *iselWordExpr_RH(ISelEnv * env, Bool syned, IRExpr * e) in iselWordExpr_RH() argument
1880 MIPSRH *ri = iselWordExpr_RH_wrk(env, syned, e); in iselWordExpr_RH()
1889 vassert(hregClass(ri->Mrh.Reg.reg) == HRcGPR(env->mode64)); in iselWordExpr_RH()
1898 static MIPSRH *iselWordExpr_RH_wrk(ISelEnv * env, Bool syned, IRExpr * e) in iselWordExpr_RH_wrk() argument
1902 IRType ty = typeOfIRExpr(env->type_env, e); in iselWordExpr_RH_wrk()
1904 ((ty == Ity_I64) && env->mode64)); in iselWordExpr_RH_wrk()
1913 vassert(env->mode64); in iselWordExpr_RH_wrk()
1939 return MIPSRH_Reg(iselWordExpr_R(env, e)); in iselWordExpr_RH_wrk()
1948 static MIPSRH *iselWordExpr_RH5u(ISelEnv * env, IRExpr * e) in iselWordExpr_RH5u() argument
1951 ri = iselWordExpr_RH5u_wrk(env, e); in iselWordExpr_RH5u()
1968 static MIPSRH *iselWordExpr_RH5u_wrk(ISelEnv * env, IRExpr * e) in iselWordExpr_RH5u_wrk() argument
1970 IRType ty = typeOfIRExpr(env->type_env, e); in iselWordExpr_RH5u_wrk()
1981 return MIPSRH_Reg(iselWordExpr_R(env, e)); in iselWordExpr_RH5u_wrk()
1987 static MIPSRH *iselWordExpr_RH6u ( ISelEnv * env, IRExpr * e ) in iselWordExpr_RH6u() argument
1990 ri = iselWordExpr_RH6u_wrk(env, e); in iselWordExpr_RH6u()
1998 vassert(hregClass(ri->Mrh.Reg.reg) == HRcGPR(env->mode64)); in iselWordExpr_RH6u()
2007 static MIPSRH *iselWordExpr_RH6u_wrk ( ISelEnv * env, IRExpr * e ) in iselWordExpr_RH6u_wrk() argument
2009 IRType ty = typeOfIRExpr(env->type_env, e); in iselWordExpr_RH6u_wrk()
2022 return MIPSRH_Reg(iselWordExpr_R(env, e)); in iselWordExpr_RH6u_wrk()
2031 static MIPSCondCode iselCondCode(ISelEnv * env, IRExpr * e) in iselCondCode() argument
2033 MIPSCondCode cc = iselCondCode_wrk(env,e); in iselCondCode()
2039 static MIPSCondCode iselCondCode_wrk(ISelEnv * env, IRExpr * e) in iselCondCode_wrk() argument
2042 vassert(typeOfIRExpr(env->type_env, e) == Ity_I1); in iselCondCode_wrk()
2062 HReg dst = newVRegI(env); in iselCondCode_wrk()
2063 HReg r1 = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselCondCode_wrk()
2064 HReg r2 = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselCondCode_wrk()
2116 addInstr(env, MIPSInstr_Cmp(syned, size32, dst, r1, r2, cc)); in iselCondCode_wrk()
2120 addInstr(env, MIPSInstr_Store(4, in iselCondCode_wrk()
2127 HReg r_dst = newVRegI(env); in iselCondCode_wrk()
2128 HReg r_srcL = iselWordExpr_R(env, e->Iex.Unop.arg); in iselCondCode_wrk()
2131 addInstr(env, MIPSInstr_LI(r_dst, 0x1)); in iselCondCode_wrk()
2132 addInstr(env, MIPSInstr_Alu(Malu_SUB, r_dst, r_dst, r_srcR)); in iselCondCode_wrk()
2136 addInstr(env, MIPSInstr_Store(4, in iselCondCode_wrk()
2143 HReg r_dst = iselWordExpr_R_wrk(env, e); in iselCondCode_wrk()
2147 addInstr(env, MIPSInstr_Store(4, in iselCondCode_wrk()
2169 static void iselInt128Expr(HReg * rHi, HReg * rLo, ISelEnv * env, IRExpr * e) in iselInt128Expr() argument
2171 vassert(env->mode64); in iselInt128Expr()
2172 iselInt128Expr_wrk(rHi, rLo, env, e); in iselInt128Expr()
2173 vassert(hregClass(*rHi) == HRcGPR(env->mode64)); in iselInt128Expr()
2175 vassert(hregClass(*rLo) == HRcGPR(env->mode64)); in iselInt128Expr()
2180 static void iselInt128Expr_wrk(HReg * rHi, HReg * rLo, ISelEnv * env, in iselInt128Expr_wrk() argument
2184 vassert(typeOfIRExpr(env->type_env, e) == Ity_I128); in iselInt128Expr_wrk()
2188 lookupIRTempPair(rHi, rLo, env, e->Iex.RdTmp.tmp); in iselInt128Expr_wrk()
2198 HReg tLo = newVRegI(env); in iselInt128Expr_wrk()
2199 HReg tHi = newVRegI(env); in iselInt128Expr_wrk()
2201 HReg r_dst = newVRegI(env); in iselInt128Expr_wrk()
2202 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselInt128Expr_wrk()
2203 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselInt128Expr_wrk()
2204 addInstr(env, MIPSInstr_Mul(syned, True, False /*64bit mul */ , in iselInt128Expr_wrk()
2206 addInstr(env, MIPSInstr_Mfhi(tHi)); in iselInt128Expr_wrk()
2207 addInstr(env, MIPSInstr_Mflo(tLo)); in iselInt128Expr_wrk()
2215 *rHi = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselInt128Expr_wrk()
2216 *rLo = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselInt128Expr_wrk()
2220 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselInt128Expr_wrk()
2221 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselInt128Expr_wrk()
2222 HReg tLo = newVRegI(env); in iselInt128Expr_wrk()
2223 HReg tHi = newVRegI(env); in iselInt128Expr_wrk()
2226 addInstr(env, MIPSInstr_Div(syned, False, r_srcL, r_srcR)); in iselInt128Expr_wrk()
2227 addInstr(env, MIPSInstr_Mfhi(tHi)); in iselInt128Expr_wrk()
2228 addInstr(env, MIPSInstr_Mflo(tLo)); in iselInt128Expr_wrk()
2238 iselInt128Expr(&rHi1, &rLo1, env, e->Iex.Binop.arg1); in iselInt128Expr_wrk()
2240 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselInt128Expr_wrk()
2241 HReg tLo = newVRegI(env); in iselInt128Expr_wrk()
2242 HReg tHi = newVRegI(env); in iselInt128Expr_wrk()
2245 addInstr(env, MIPSInstr_Div(syned, False, rLo1, r_srcR)); in iselInt128Expr_wrk()
2246 addInstr(env, MIPSInstr_Mfhi(tHi)); in iselInt128Expr_wrk()
2247 addInstr(env, MIPSInstr_Mflo(tLo)); in iselInt128Expr_wrk()
2270 static void iselInt64Expr(HReg * rHi, HReg * rLo, ISelEnv * env, IRExpr * e) in iselInt64Expr() argument
2272 vassert(!env->mode64); in iselInt64Expr()
2273 iselInt64Expr_wrk(rHi, rLo, env, e); in iselInt64Expr()
2281 static void iselInt64Expr_wrk(HReg * rHi, HReg * rLo, ISelEnv * env, IRExpr * e) in iselInt64Expr_wrk() argument
2284 vassert(typeOfIRExpr(env->type_env, e) == Ity_I64); in iselInt64Expr_wrk()
2288 lookupIRTemp64(rHi, rLo, env, e->Iex.RdTmp.tmp); in iselInt64Expr_wrk()
2293 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2294 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2295 HReg r_addr = iselWordExpr_R(env, e->Iex.Load.addr); in iselInt64Expr_wrk()
2296 addInstr(env, MIPSInstr_Load(4, tHi, MIPSAMode_IR(0, r_addr), mode64)); in iselInt64Expr_wrk()
2297 addInstr(env, MIPSInstr_Load(4, tLo, MIPSAMode_IR(4, r_addr), mode64)); in iselInt64Expr_wrk()
2308 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2309 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2314 addInstr(env, MIPSInstr_LI(tLo, (ULong) wLo)); in iselInt64Expr_wrk()
2318 addInstr(env, MIPSInstr_LI(tHi, (ULong) wHi)); in iselInt64Expr_wrk()
2319 addInstr(env, MIPSInstr_LI(tLo, (ULong) wLo)); in iselInt64Expr_wrk()
2329 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2330 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2334 addInstr(env, MIPSInstr_Load(4, tLo, am_addr, mode64)); in iselInt64Expr_wrk()
2335 addInstr(env, MIPSInstr_Load(4, tHi, nextMIPSAModeInt(am_addr), mode64)); in iselInt64Expr_wrk()
2343 vassert(typeOfIRExpr(env->type_env, e->Iex.ITE.cond) == Ity_I1); in iselInt64Expr_wrk()
2346 HReg desLo = newVRegI(env); in iselInt64Expr_wrk()
2347 HReg desHi = newVRegI(env); in iselInt64Expr_wrk()
2348 HReg cond = iselWordExpr_R(env, e->Iex.ITE.cond); in iselInt64Expr_wrk()
2352 iselInt64Expr(&expr0Hi, &expr0Lo, env, e->Iex.ITE.iffalse); in iselInt64Expr_wrk()
2353 iselInt64Expr(&expr1Hi, &expr1Lo, env, e->Iex.ITE.iftrue); in iselInt64Expr_wrk()
2359 addInstr(env, mk_iMOVds_RR(desLo, expr0Lo)); in iselInt64Expr_wrk()
2360 addInstr(env, mk_iMOVds_RR(desHi, expr0Hi)); in iselInt64Expr_wrk()
2361 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, desLo, expr1Lo, cond)); in iselInt64Expr_wrk()
2362 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, desHi, expr1Hi, cond)); in iselInt64Expr_wrk()
2378 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2379 HReg tHi1 = newVRegI(env); in iselInt64Expr_wrk()
2380 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2382 carryBit = newVRegI(env); in iselInt64Expr_wrk()
2387 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2388 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2389 addInstr(env, MIPSInstr_Alu(Malu_ADD, tLo, xLo, MIPSRH_Reg(yLo))); in iselInt64Expr_wrk()
2392 addInstr(env, MIPSInstr_Cmp(False, size32, carryBit, tLo, xLo, cc)); in iselInt64Expr_wrk()
2394 addInstr(env, MIPSInstr_Alu(Malu_ADD, tHi1, xHi, MIPSRH_Reg(yHi))); in iselInt64Expr_wrk()
2395 addInstr(env, MIPSInstr_Alu(Malu_ADD, tHi, tHi1, in iselInt64Expr_wrk()
2407 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2408 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2410 borrow = newVRegI(env); in iselInt64Expr_wrk()
2412 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2413 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2415 addInstr(env, MIPSInstr_Alu(Malu_SUB, tLo, xLo, MIPSRH_Reg(yLo))); in iselInt64Expr_wrk()
2418 addInstr(env, MIPSInstr_Cmp(False, size32, borrow, xLo, yLo, cc)); in iselInt64Expr_wrk()
2420 addInstr(env, MIPSInstr_Alu(Malu_ADD, yHi, yHi, in iselInt64Expr_wrk()
2422 addInstr(env, MIPSInstr_Alu(Malu_SUB, tHi, xHi, MIPSRH_Reg(yHi))); in iselInt64Expr_wrk()
2430 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2431 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2432 HReg r_dst = newVRegI(env); in iselInt64Expr_wrk()
2434 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2435 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2437 addInstr(env, MIPSInstr_Mul(syned /*Unsigned or Signed */, in iselInt64Expr_wrk()
2440 addInstr(env, MIPSInstr_Mfhi(tHi)); in iselInt64Expr_wrk()
2441 addInstr(env, MIPSInstr_Mflo(tLo)); in iselInt64Expr_wrk()
2450 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2451 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2453 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2455 iselInt64Expr(&r_sHi, &r_sLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2456 addInstr(env, MIPSInstr_Div(syned, True, r_sLo, r_srcR)); in iselInt64Expr_wrk()
2457 addInstr(env, MIPSInstr_Mfhi(tHi)); in iselInt64Expr_wrk()
2458 addInstr(env, MIPSInstr_Mflo(tLo)); in iselInt64Expr_wrk()
2467 *rHi = iselWordExpr_R(env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2468 *rLo = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2476 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2477 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2480 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2481 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2482 addInstr(env, MIPSInstr_Alu(op, tHi, xHi, MIPSRH_Reg(yHi))); in iselInt64Expr_wrk()
2483 addInstr(env, MIPSInstr_Alu(op, tLo, xLo, MIPSRH_Reg(yLo))); in iselInt64Expr_wrk()
2505 HReg a0tmp = newVRegI(env); in iselInt64Expr_wrk()
2506 HReg a2 = newVRegI(env); in iselInt64Expr_wrk()
2507 HReg a3 = newVRegI(env); in iselInt64Expr_wrk()
2508 HReg v0 = newVRegI(env); in iselInt64Expr_wrk()
2509 HReg v1 = newVRegI(env); in iselInt64Expr_wrk()
2510 HReg zero = newVRegI(env); in iselInt64Expr_wrk()
2513 iselInt64Expr(&a1, &a0, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2514 sa = iselWordExpr_RH6u(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2517 addInstr(env, MIPSInstr_LI(a2, sa->Mrh.Imm.imm16)); in iselInt64Expr_wrk()
2520 addInstr(env, MIPSInstr_Alu(Malu_AND, a2, sa->Mrh.Reg.reg, in iselInt64Expr_wrk()
2524 addInstr(env, MIPSInstr_LI(zero, 0x00000000)); in iselInt64Expr_wrk()
2526 addInstr(env, MIPSInstr_Alu(Malu_NOR, v0, zero, MIPSRH_Reg(a2))); in iselInt64Expr_wrk()
2528 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2531 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2534 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselInt64Expr_wrk()
2537 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselInt64Expr_wrk()
2540 addInstr(env, MIPSInstr_Alu(Malu_AND, a0tmp, a2, in iselInt64Expr_wrk()
2543 addInstr(env, MIPSInstr_Alu(Malu_OR, v0, a3, MIPSRH_Reg(v0))); in iselInt64Expr_wrk()
2546 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, v0, v1, a0tmp)); in iselInt64Expr_wrk()
2548 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, v1, zero, a0tmp)); in iselInt64Expr_wrk()
2569 HReg a2 = newVRegI(env); in iselInt64Expr_wrk()
2570 HReg a2tmp = newVRegI(env); in iselInt64Expr_wrk()
2571 HReg a3 = newVRegI(env); in iselInt64Expr_wrk()
2572 HReg v0 = newVRegI(env); in iselInt64Expr_wrk()
2573 HReg v1 = newVRegI(env); in iselInt64Expr_wrk()
2574 HReg zero = newVRegI(env); in iselInt64Expr_wrk()
2577 iselInt64Expr(&a0, &a1, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2578 sa = iselWordExpr_RH6u(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2581 addInstr(env, MIPSInstr_LI(a2, sa->Mrh.Imm.imm16)); in iselInt64Expr_wrk()
2584 addInstr(env, MIPSInstr_Alu(Malu_AND, a2, sa->Mrh.Reg.reg, in iselInt64Expr_wrk()
2588 addInstr(env, MIPSInstr_LI(zero, 0x00000000)); in iselInt64Expr_wrk()
2590 addInstr(env, MIPSInstr_Alu(Malu_NOR, v0, zero, MIPSRH_Reg(a2))); in iselInt64Expr_wrk()
2592 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2595 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2598 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselInt64Expr_wrk()
2601 addInstr(env, MIPSInstr_Alu(Malu_AND, v0, a2, in iselInt64Expr_wrk()
2604 addInstr(env, MIPSInstr_Alu(Malu_OR, v1, a3, MIPSRH_Reg(v1))); in iselInt64Expr_wrk()
2606 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselInt64Expr_wrk()
2610 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, v1, a2tmp, v0)); in iselInt64Expr_wrk()
2612 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, a2tmp, zero, v0)); in iselInt64Expr_wrk()
2614 addInstr(env, mk_iMOVds_RR(v0, a2tmp)); in iselInt64Expr_wrk()
2638 HReg a2 = newVRegI(env); in iselInt64Expr_wrk()
2639 HReg a3 = newVRegI(env); in iselInt64Expr_wrk()
2640 HReg v0 = newVRegI(env); in iselInt64Expr_wrk()
2641 HReg v1 = newVRegI(env); in iselInt64Expr_wrk()
2642 HReg zero = newVRegI(env); in iselInt64Expr_wrk()
2645 iselInt64Expr(&a1, &a0, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2646 sa = iselWordExpr_RH6u(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2649 addInstr(env, MIPSInstr_LI(a2, sa->Mrh.Imm.imm16)); in iselInt64Expr_wrk()
2652 addInstr(env, MIPSInstr_Alu(Malu_AND, a2, sa->Mrh.Reg.reg, in iselInt64Expr_wrk()
2656 addInstr(env, MIPSInstr_LI(zero, 0x00000000)); in iselInt64Expr_wrk()
2658 addInstr(env, MIPSInstr_Alu(Malu_NOR, v0, zero, MIPSRH_Reg(a2))); in iselInt64Expr_wrk()
2660 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselInt64Expr_wrk()
2663 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselInt64Expr_wrk()
2666 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2669 addInstr(env, MIPSInstr_Alu(Malu_AND, v0, a2, in iselInt64Expr_wrk()
2672 addInstr(env, MIPSInstr_Alu(Malu_OR, v1, a3, MIPSRH_Reg(v1))); in iselInt64Expr_wrk()
2674 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2678 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, v1, a2, v0)); in iselInt64Expr_wrk()
2680 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, a2, zero, v0)); in iselInt64Expr_wrk()
2681 addInstr(env, mk_iMOVds_RR(v0, a2)); in iselInt64Expr_wrk()
2704 HReg a0tmp = newVRegI(env); in iselInt64Expr_wrk()
2705 HReg a1tmp = newVRegI(env); in iselInt64Expr_wrk()
2706 HReg a2 = newVRegI(env); in iselInt64Expr_wrk()
2707 HReg a3 = newVRegI(env); in iselInt64Expr_wrk()
2708 HReg v0 = newVRegI(env); in iselInt64Expr_wrk()
2709 HReg v1 = newVRegI(env); in iselInt64Expr_wrk()
2710 HReg zero = newVRegI(env); in iselInt64Expr_wrk()
2713 iselInt64Expr(&a1, &a0, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2714 sa = iselWordExpr_RH6u(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2717 addInstr(env, MIPSInstr_LI(a2, sa->Mrh.Imm.imm16)); in iselInt64Expr_wrk()
2720 addInstr(env, MIPSInstr_Alu(Malu_AND, a2, sa->Mrh.Reg.reg, in iselInt64Expr_wrk()
2724 addInstr(env, MIPSInstr_LI(zero, 0x00000000)); in iselInt64Expr_wrk()
2726 addInstr(env, MIPSInstr_Alu(Malu_NOR, v0, zero, MIPSRH_Reg(a2))); in iselInt64Expr_wrk()
2728 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2731 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True /* 32bit shift */, in iselInt64Expr_wrk()
2734 addInstr(env, MIPSInstr_Shft(Mshft_SRL, True /* 32bit shift */, in iselInt64Expr_wrk()
2737 addInstr(env, MIPSInstr_Shft(Mshft_SRA, True /* 32bit shift */, in iselInt64Expr_wrk()
2740 addInstr(env, MIPSInstr_Alu(Malu_AND, a0tmp, a2, in iselInt64Expr_wrk()
2743 addInstr(env, MIPSInstr_Shft(Mshft_SRA, True /* 32bit shift */, in iselInt64Expr_wrk()
2746 addInstr(env, MIPSInstr_Alu(Malu_OR, v0, a3, MIPSRH_Reg(v0))); in iselInt64Expr_wrk()
2749 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, v0, v1, a0tmp)); in iselInt64Expr_wrk()
2751 addInstr(env, MIPSInstr_MoveCond(MMoveCond_movn, v1, a1tmp, a0tmp)); in iselInt64Expr_wrk()
2759 HReg tmpD = newVRegD(env); in iselInt64Expr_wrk()
2760 HReg valF = iselFltExpr(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2761 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2762 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2766 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2767 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTLS, tmpD, valF)); in iselInt64Expr_wrk()
2768 set_MIPS_rounding_default(env); in iselInt64Expr_wrk()
2770 sub_from_sp(env, 16); /* Move SP down 16 bytes */ in iselInt64Expr_wrk()
2774 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 8, tmpD, in iselInt64Expr_wrk()
2778 addInstr(env, MIPSInstr_Load(4, tLo, am_addr, mode64)); in iselInt64Expr_wrk()
2779 addInstr(env, MIPSInstr_Load(4, tHi, nextMIPSAModeFloat(am_addr), in iselInt64Expr_wrk()
2782 addInstr(env, MIPSInstr_Load(4, tHi, am_addr, mode64)); in iselInt64Expr_wrk()
2783 addInstr(env, MIPSInstr_Load(4, tLo, nextMIPSAModeFloat(am_addr), in iselInt64Expr_wrk()
2788 add_to_sp(env, 16); in iselInt64Expr_wrk()
2805 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2806 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2807 HReg src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2808 HReg tmp = newVRegI(env); in iselInt64Expr_wrk()
2810 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, tmp, src, in iselInt64Expr_wrk()
2812 addInstr(env, MIPSInstr_Shft(Mshft_SRA, True, tmp, tmp, in iselInt64Expr_wrk()
2815 addInstr(env, mk_iMOVds_RR(tHi, tmp)); in iselInt64Expr_wrk()
2816 addInstr(env, mk_iMOVds_RR(tLo, tmp)); in iselInt64Expr_wrk()
2825 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2826 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2827 HReg src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2828 addInstr(env, mk_iMOVds_RR(tHi, src)); in iselInt64Expr_wrk()
2829 addInstr(env, mk_iMOVds_RR(tLo, src)); in iselInt64Expr_wrk()
2830 addInstr(env, MIPSInstr_Shft(Mshft_SRA, True, tHi, tHi, in iselInt64Expr_wrk()
2839 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2840 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2841 HReg src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2842 addInstr(env, MIPSInstr_Alu(Malu_AND, tLo, src, in iselInt64Expr_wrk()
2844 addInstr(env, MIPSInstr_Alu(Malu_ADD, tHi, hregMIPS_GPR0(mode64), in iselInt64Expr_wrk()
2853 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2854 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2855 HReg src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2856 addInstr(env, mk_iMOVds_RR(tLo, src)); in iselInt64Expr_wrk()
2857 addInstr(env, MIPSInstr_Alu(Malu_ADD, tHi, hregMIPS_GPR0(mode64), in iselInt64Expr_wrk()
2866 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2867 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2868 HReg tmp = newVRegI(env); in iselInt64Expr_wrk()
2869 HReg tmp1 = newVRegI(env); in iselInt64Expr_wrk()
2870 HReg tmp2 = newVRegI(env); in iselInt64Expr_wrk()
2871 HReg zero = newVRegI(env); in iselInt64Expr_wrk()
2875 iselInt64Expr(&yHi, &yLo, env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2877 addInstr(env, MIPSInstr_LI(zero, 0x00000000)); in iselInt64Expr_wrk()
2880 addInstr(env, MIPSInstr_Alu(Malu_SUB, tmp2, zero, MIPSRH_Reg(yLo))); in iselInt64Expr_wrk()
2881 addInstr(env, MIPSInstr_Cmp(False, True, tmp1, zero, tmp2, cc)); in iselInt64Expr_wrk()
2882 addInstr(env, MIPSInstr_Alu(Malu_SUB, tmp, zero, MIPSRH_Reg(yHi))); in iselInt64Expr_wrk()
2883 addInstr(env, MIPSInstr_Alu(Malu_SUB, tmp1, tmp, MIPSRH_Reg(tmp1))); in iselInt64Expr_wrk()
2888 addInstr(env, MIPSInstr_Alu(Malu_OR, tHi, yHi, MIPSRH_Reg(tmp1))); in iselInt64Expr_wrk()
2889 addInstr(env, MIPSInstr_Alu(Malu_OR, tLo, yLo, MIPSRH_Reg(tmp2))); in iselInt64Expr_wrk()
2897 HReg tmp1 = newVRegI(env); in iselInt64Expr_wrk()
2898 HReg tmp2 = newVRegI(env); in iselInt64Expr_wrk()
2900 iselInt64Expr(&srcHi, &srcLo, env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2902 addInstr(env, MIPSInstr_Alu(Malu_OR, tmp1, srcLo, in iselInt64Expr_wrk()
2906 addInstr(env, MIPSInstr_Alu(Malu_SUB, tmp2, hregMIPS_GPR0(mode64), in iselInt64Expr_wrk()
2909 addInstr(env, MIPSInstr_Alu(Malu_OR, tmp2, tmp2, MIPSRH_Reg(tmp1))); in iselInt64Expr_wrk()
2910 addInstr(env, MIPSInstr_Shft(Mshft_SRA, True, tmp2, tmp2, in iselInt64Expr_wrk()
2918 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2919 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2921 HReg fr_src = iselDblExpr(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2923 sub_from_sp(env, 16); /* Move SP down 16 bytes */ in iselInt64Expr_wrk()
2927 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 8, fr_src, in iselInt64Expr_wrk()
2931 addInstr(env, MIPSInstr_Load(4, tLo, am_addr, mode64)); in iselInt64Expr_wrk()
2932 addInstr(env, MIPSInstr_Load(4, tHi, nextMIPSAModeFloat(am_addr), in iselInt64Expr_wrk()
2935 addInstr(env, MIPSInstr_Load(4, tHi, am_addr, mode64)); in iselInt64Expr_wrk()
2936 addInstr(env, MIPSInstr_Load(4, tLo, nextMIPSAModeFloat(am_addr), in iselInt64Expr_wrk()
2941 add_to_sp(env, 16); in iselInt64Expr_wrk()
2949 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2950 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2951 iselInt64Expr(&tHi, &tLo, env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2952 addInstr(env, MIPSInstr_Alu(Malu_NOR, tLo, tLo, MIPSRH_Reg(tLo))); in iselInt64Expr_wrk()
2953 addInstr(env, MIPSInstr_Alu(Malu_NOR, tHi, tHi, MIPSRH_Reg(tHi))); in iselInt64Expr_wrk()
2980 static HReg iselFltExpr(ISelEnv * env, IRExpr * e) in iselFltExpr() argument
2982 HReg r = iselFltExpr_wrk(env, e); in iselFltExpr()
2988 static HReg iselFltExpr_wrk(ISelEnv * env, IRExpr * e) in iselFltExpr_wrk() argument
2990 IRType ty = typeOfIRExpr(env->type_env, e); in iselFltExpr_wrk()
2994 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselFltExpr_wrk()
3001 MIPSAMode *am_addr = iselWordExpr_AMode(env, e->Iex.Load.addr, ty); in iselFltExpr_wrk()
3003 r_dst = newVRegD(env); in iselFltExpr_wrk()
3004 addInstr(env, MIPSInstr_FpLdSt(True /*load */, 8, r_dst, am_addr)); in iselFltExpr_wrk()
3006 r_dst = newVRegF(env); in iselFltExpr_wrk()
3007 addInstr(env, MIPSInstr_FpLdSt(True /*load */, 4, r_dst, am_addr)); in iselFltExpr_wrk()
3017 r_dst = newVRegD(env); in iselFltExpr_wrk()
3018 addInstr(env, MIPSInstr_FpLdSt(True /*load */, 8, r_dst, am_addr)); in iselFltExpr_wrk()
3020 r_dst = newVRegF(env); in iselFltExpr_wrk()
3021 addInstr(env, MIPSInstr_FpLdSt(True /*load */, 4, r_dst, am_addr)); in iselFltExpr_wrk()
3029 HReg fr_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3030 HReg r_dst = newVRegF(env); in iselFltExpr_wrk()
3034 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_mtc1, r_dst, fr_src)); in iselFltExpr_wrk()
3040 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3041 HReg dst = newVRegD(env); in iselFltExpr_wrk()
3043 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTDS, dst, src)); in iselFltExpr_wrk()
3049 HReg fr_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3050 r_dst = newVRegF(env); in iselFltExpr_wrk()
3053 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_dmtc1, r_dst, fr_src)); in iselFltExpr_wrk()
3056 r_dst = newVRegD(env); in iselFltExpr_wrk()
3057 iselInt64Expr(&Hi, &Lo, env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3058 r_dst = mk_LoadRR32toFPR(env, Hi, Lo); /* 2*I32 -> F64 */ in iselFltExpr_wrk()
3064 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3065 HReg tmp = newVRegF(env); in iselFltExpr_wrk()
3066 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3070 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_mtc1, tmp, r_src)); in iselFltExpr_wrk()
3073 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTDW, dst, tmp)); in iselFltExpr_wrk()
3080 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3081 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3082 addInstr(env, MIPSInstr_FpUnary(sz32 ? Mfp_ABSS : Mfp_ABSD, dst, src)); in iselFltExpr_wrk()
3088 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3089 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3090 addInstr(env, MIPSInstr_FpUnary(sz32 ? Mfp_NEGS : Mfp_NEGD, dst, src)); in iselFltExpr_wrk()
3095 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3096 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3097 addInstr(env, MIPSInstr_FpConvert(Mfp_TRULD, dst, src)); in iselFltExpr_wrk()
3102 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3103 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3104 addInstr(env, MIPSInstr_FpConvert(Mfp_ROUNDLD, dst, src)); in iselFltExpr_wrk()
3109 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3110 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3111 addInstr(env, MIPSInstr_FpConvert(Mfp_FLOORLD, dst, src)); in iselFltExpr_wrk()
3116 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3117 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3118 addInstr(env, MIPSInstr_FpConvert(Mfp_CEILLD, dst, src)); in iselFltExpr_wrk()
3138 HReg argL = iselFltExpr(env, e->Iex.Triop.details->arg2); in iselFltExpr_wrk()
3139 HReg argR = iselFltExpr(env, e->Iex.Triop.details->arg3); in iselFltExpr_wrk()
3140 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3173 set_MIPS_rounding_mode(env, e->Iex.Triop.details->arg1); in iselFltExpr_wrk()
3174 addInstr(env, MIPSInstr_FpBinary(op, dst, argL, argR)); in iselFltExpr_wrk()
3175 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3188 valD = iselFltExpr(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3190 valD = iselDblExpr(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3191 HReg valS = newVRegF(env); in iselFltExpr_wrk()
3193 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselFltExpr_wrk()
3194 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTSD, valS, valD)); in iselFltExpr_wrk()
3195 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3200 HReg valS = newVRegF(env); in iselFltExpr_wrk()
3201 HReg valF = iselFltExpr(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3203 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselFltExpr_wrk()
3204 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTWS, valS, valF)); in iselFltExpr_wrk()
3205 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3210 HReg valS = newVRegF(env); in iselFltExpr_wrk()
3211 HReg valF = iselFltExpr(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3213 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselFltExpr_wrk()
3214 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTLD, valS, valF)); in iselFltExpr_wrk()
3215 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3220 HReg r_dst = newVRegF(env); in iselFltExpr_wrk()
3221 HReg fr_src = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3222 HReg tmp = newVRegF(env); in iselFltExpr_wrk()
3226 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_mtc1, tmp, fr_src)); in iselFltExpr_wrk()
3228 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselFltExpr_wrk()
3229 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTSW, r_dst, tmp)); in iselFltExpr_wrk()
3230 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3236 HReg r_dst = newVRegF(env); in iselFltExpr_wrk()
3240 tmp = newVRegF(env); in iselFltExpr_wrk()
3241 fr_src = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3243 sub_from_sp(env, 8); in iselFltExpr_wrk()
3247 addInstr(env, MIPSInstr_Store(8, am_addr, fr_src, mode64)); in iselFltExpr_wrk()
3250 addInstr(env, MIPSInstr_FpLdSt(True /*load */, 8, tmp, am_addr)); in iselFltExpr_wrk()
3253 add_to_sp(env, 8); in iselFltExpr_wrk()
3256 tmp = newVRegD(env); in iselFltExpr_wrk()
3257 iselInt64Expr(&Hi, &Lo, env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3258 tmp = mk_LoadRR32toFPR(env, Hi, Lo); /* 2*I32 -> F64 */ in iselFltExpr_wrk()
3261 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselFltExpr_wrk()
3262 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTDL, r_dst, tmp)); in iselFltExpr_wrk()
3263 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3269 HReg r_dst = newVRegF(env); in iselFltExpr_wrk()
3273 tmp = newVRegF(env); in iselFltExpr_wrk()
3274 fr_src = iselWordExpr_R(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3276 sub_from_sp(env, 8); in iselFltExpr_wrk()
3280 addInstr(env, MIPSInstr_Store(8, am_addr, fr_src, mode64)); in iselFltExpr_wrk()
3283 addInstr(env, MIPSInstr_FpLdSt(True /*load */, 8, tmp, am_addr)); in iselFltExpr_wrk()
3286 add_to_sp(env, 8); in iselFltExpr_wrk()
3289 tmp = newVRegD(env); in iselFltExpr_wrk()
3290 iselInt64Expr(&Hi, &Lo, env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3291 tmp = mk_LoadRR32toFPR(env, Hi, Lo); /* 2*I32 -> F64 */ in iselFltExpr_wrk()
3294 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselFltExpr_wrk()
3295 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTSL, r_dst, tmp)); in iselFltExpr_wrk()
3296 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3304 HReg src = iselFltExpr(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
3305 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3306 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselFltExpr_wrk()
3307 addInstr(env, MIPSInstr_FpUnary(sz32 ? Mfp_SQRTS : Mfp_SQRTD, dst, in iselFltExpr_wrk()
3309 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3341 HReg dst = newVRegF(env); in iselFltExpr_wrk()
3342 HReg src1 = iselFltExpr(env, e->Iex.Qop.details->arg2); in iselFltExpr_wrk()
3343 HReg src2 = iselFltExpr(env, e->Iex.Qop.details->arg3); in iselFltExpr_wrk()
3344 HReg src3 = iselFltExpr(env, e->Iex.Qop.details->arg4); in iselFltExpr_wrk()
3345 set_MIPS_rounding_mode(env, e->Iex.Qop.details->arg1); in iselFltExpr_wrk()
3346 addInstr(env, MIPSInstr_FpTernary(op, dst, in iselFltExpr_wrk()
3348 set_MIPS_rounding_default(env); in iselFltExpr_wrk()
3386 HReg fsrc = iselDblExpr(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
3387 HReg fdst = newVRegF(env); in iselFltExpr_wrk()
3390 sub_from_sp(env, 16); in iselFltExpr_wrk()
3392 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 4, fsrc, zero_r1)); in iselFltExpr_wrk()
3394 addInstr(env, MIPSInstr_FpLdSt(True /*load */ , 4, fdst, zero_r1)); in iselFltExpr_wrk()
3395 add_to_sp(env, 16); in iselFltExpr_wrk()
3401 vassert(typeOfIRExpr(env->type_env, e->Iex.ITE.cond) == Ity_I1); in iselFltExpr_wrk()
3402 HReg r0 = iselFltExpr(env, e->Iex.ITE.iffalse); in iselFltExpr_wrk()
3403 HReg r1 = iselFltExpr(env, e->Iex.ITE.iftrue); in iselFltExpr_wrk()
3404 HReg r_cond = iselWordExpr_R(env, e->Iex.ITE.cond); in iselFltExpr_wrk()
3405 HReg r_dst = newVRegF(env); in iselFltExpr_wrk()
3406 addInstr(env, MIPSInstr_FpUnary((ty == Ity_F64) ? Mfp_MOVD : Mfp_MOVS, in iselFltExpr_wrk()
3408 addInstr(env, MIPSInstr_MoveCond((ty == Ity_F64) ? MFpMoveCond_movnd : in iselFltExpr_wrk()
3419 static HReg iselDblExpr(ISelEnv * env, IRExpr * e) in iselDblExpr() argument
3421 HReg r = iselDblExpr_wrk(env, e); in iselDblExpr()
3428 static HReg iselDblExpr_wrk(ISelEnv * env, IRExpr * e) in iselDblExpr_wrk() argument
3430 IRType ty = typeOfIRExpr(env->type_env, e); in iselDblExpr_wrk()
3435 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselDblExpr_wrk()
3440 HReg r_dst = newVRegD(env); in iselDblExpr_wrk()
3443 am_addr = iselWordExpr_AMode(env, e->Iex.Load.addr, ty); in iselDblExpr_wrk()
3444 addInstr(env, MIPSInstr_FpLdSt(True /*load */ , 8, r_dst, am_addr)); in iselDblExpr_wrk()
3451 HReg r_dst = newVRegD(env); in iselDblExpr_wrk()
3454 addInstr(env, MIPSInstr_FpLdSt(True /*load */ , 8, r_dst, am_addr)); in iselDblExpr_wrk()
3469 HReg src = iselFltExpr(env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3470 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3472 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTDS, dst, src)); in iselDblExpr_wrk()
3477 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3479 iselInt64Expr(&Hi, &Lo, env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3481 dst = mk_LoadRR32toFPR(env, Hi, Lo); /* 2*I32 -> F64 */ in iselDblExpr_wrk()
3486 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3487 HReg tmp = newVRegF(env); in iselDblExpr_wrk()
3488 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3492 addInstr(env, MIPSInstr_FpGpMove(MFpGpMove_mtc1, tmp, r_src)); in iselDblExpr_wrk()
3495 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTDW, dst, tmp)); in iselDblExpr_wrk()
3504 HReg src = iselDblExpr(env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3505 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3506 addInstr(env, MIPSInstr_FpUnary(fpop, dst, src)); in iselDblExpr_wrk()
3514 HReg src = iselDblExpr(env, e->Iex.Binop.arg2); in iselDblExpr_wrk()
3515 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3517 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselDblExpr_wrk()
3518 addInstr(env, MIPSInstr_FpConvert(Mfp_CVTLD, dst, src)); in iselDblExpr_wrk()
3519 set_MIPS_rounding_default(env); in iselDblExpr_wrk()
3525 HReg src = iselDblExpr(env, e->Iex.Binop.arg2); in iselDblExpr_wrk()
3526 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3527 set_MIPS_rounding_mode(env, e->Iex.Binop.arg1); in iselDblExpr_wrk()
3528 addInstr(env, MIPSInstr_FpUnary(Mfp_SQRTD, dst, src)); in iselDblExpr_wrk()
3529 set_MIPS_rounding_default(env); in iselDblExpr_wrk()
3547 HReg argL = iselDblExpr(env, e->Iex.Triop.details->arg2); in iselDblExpr_wrk()
3548 HReg argR = iselDblExpr(env, e->Iex.Triop.details->arg3); in iselDblExpr_wrk()
3549 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3569 set_MIPS_rounding_mode(env, e->Iex.Triop.details->arg1); in iselDblExpr_wrk()
3570 addInstr(env, MIPSInstr_FpBinary(op, dst, argL, argR)); in iselDblExpr_wrk()
3571 set_MIPS_rounding_default(env); in iselDblExpr_wrk()
3602 HReg dst = newVRegD(env); in iselDblExpr_wrk()
3603 HReg src1 = iselDblExpr(env, e->Iex.Qop.details->arg2); in iselDblExpr_wrk()
3604 HReg src2 = iselDblExpr(env, e->Iex.Qop.details->arg3); in iselDblExpr_wrk()
3605 HReg src3 = iselDblExpr(env, e->Iex.Qop.details->arg4); in iselDblExpr_wrk()
3606 set_MIPS_rounding_mode(env, e->Iex.Qop.details->arg1); in iselDblExpr_wrk()
3607 addInstr(env, MIPSInstr_FpTernary(op, dst, in iselDblExpr_wrk()
3609 set_MIPS_rounding_default(env); in iselDblExpr_wrk()
3621 && typeOfIRExpr(env->type_env, e->Iex.ITE.cond) == Ity_I1) { in iselDblExpr_wrk()
3622 HReg r0 = iselDblExpr(env, e->Iex.ITE.iffalse); in iselDblExpr_wrk()
3623 HReg r1 = iselDblExpr(env, e->Iex.ITE.iftrue); in iselDblExpr_wrk()
3624 HReg r_cond = iselWordExpr_R(env, e->Iex.ITE.cond); in iselDblExpr_wrk()
3625 HReg r_dst = newVRegD(env); in iselDblExpr_wrk()
3627 addInstr(env, MIPSInstr_FpUnary(Mfp_MOVD, r_dst, r0)); in iselDblExpr_wrk()
3628 addInstr(env, MIPSInstr_MoveCond(MFpMoveCond_movnd, r_dst, r1, in iselDblExpr_wrk()
3643 static void iselStmt(ISelEnv * env, IRStmt * stmt) in iselStmt() argument
3656 IRType tyd = typeOfIRExpr(env->type_env, stmt->Ist.Store.data); in iselStmt()
3659 am_addr = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd); in iselStmt()
3663 HReg r_src = iselWordExpr_R(env, stmt->Ist.Store.data); in iselStmt()
3664 addInstr(env, MIPSInstr_Store(toUChar(sizeofIRType(tyd)), in iselStmt()
3670 HReg r_addr = iselWordExpr_R(env, stmt->Ist.Store.addr); in iselStmt()
3672 iselInt64Expr(&vHi, &vLo, env, stmt->Ist.Store.data); in iselStmt()
3674 addInstr(env, MIPSInstr_Store(toUChar(sizeofIRType(Ity_I32)), in iselStmt()
3676 addInstr(env, MIPSInstr_Store(toUChar(sizeofIRType(Ity_I32)), in iselStmt()
3681 HReg fr_src = iselFltExpr(env, stmt->Ist.Store.data); in iselStmt()
3682 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 4, fr_src, in iselStmt()
3687 HReg fr_src = iselFltExpr(env, stmt->Ist.Store.data); in iselStmt()
3688 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 8, fr_src, in iselStmt()
3693 HReg fr_src = iselDblExpr(env, stmt->Ist.Store.data); in iselStmt()
3694 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 8, fr_src, in iselStmt()
3704 IRType ty = typeOfIRExpr(env->type_env, stmt->Ist.Put.data); in iselStmt()
3708 HReg r_src = iselWordExpr_R(env, stmt->Ist.Put.data); in iselStmt()
3711 addInstr(env, MIPSInstr_Store(toUChar(sizeofIRType(ty)), in iselStmt()
3722 iselInt64Expr(&vHi, &vLo, env, stmt->Ist.Put.data); in iselStmt()
3723 addInstr(env, MIPSInstr_Store(toUChar(sizeofIRType(Ity_I32)), in iselStmt()
3725 addInstr(env, MIPSInstr_Store(toUChar(sizeofIRType(Ity_I32)), in iselStmt()
3732 HReg fr_src = iselFltExpr(env, stmt->Ist.Put.data); in iselStmt()
3735 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 4, fr_src, in iselStmt()
3741 HReg fr_src = iselFltExpr(env, stmt->Ist.Put.data); in iselStmt()
3744 addInstr(env, MIPSInstr_FpLdSt(False /*store */ , 8, fr_src, in iselStmt()
3754 IRType ty = typeOfIRTemp(env->type_env, tmp); in iselStmt()
3757 HReg r_dst = lookupIRTemp(env, tmp); in iselStmt()
3758 HReg r_src = iselWordExpr_R(env, stmt->Ist.WrTmp.data); in iselStmt()
3759 addInstr(env, mk_iMOVds_RR(r_dst, r_src)); in iselStmt()
3765 HReg r_dst = lookupIRTemp(env, tmp); in iselStmt()
3766 HReg r_src = iselWordExpr_R(env, stmt->Ist.WrTmp.data); in iselStmt()
3767 addInstr(env, mk_iMOVds_RR(r_dst, r_src)); in iselStmt()
3771 iselInt64Expr(&rHi, &rLo, env, stmt->Ist.WrTmp.data); in iselStmt()
3772 lookupIRTemp64(&dstHi, &dstLo, env, tmp); in iselStmt()
3773 addInstr(env, mk_iMOVds_RR(dstHi, rHi)); in iselStmt()
3774 addInstr(env, mk_iMOVds_RR(dstLo, rLo)); in iselStmt()
3781 iselInt128Expr(&rHi, &rLo, env, stmt->Ist.WrTmp.data); in iselStmt()
3782 lookupIRTempPair(&dstHi, &dstLo, env, tmp); in iselStmt()
3783 addInstr(env, mk_iMOVds_RR(dstHi, rHi)); in iselStmt()
3784 addInstr(env, mk_iMOVds_RR(dstLo, rLo)); in iselStmt()
3789 HReg fr_dst = lookupIRTemp(env, tmp); in iselStmt()
3790 HReg fr_src = iselFltExpr(env, stmt->Ist.WrTmp.data); in iselStmt()
3791 addInstr(env, MIPSInstr_FpUnary(Mfp_MOVS, fr_dst, fr_src)); in iselStmt()
3797 HReg src = iselFltExpr(env, stmt->Ist.WrTmp.data); in iselStmt()
3798 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
3799 addInstr(env, MIPSInstr_FpUnary(Mfp_MOVD, dst, src)); in iselStmt()
3802 HReg src = iselDblExpr(env, stmt->Ist.WrTmp.data); in iselStmt()
3803 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
3804 addInstr(env, MIPSInstr_FpUnary(Mfp_MOVD, dst, src)); in iselStmt()
3818 retty = typeOfIRTemp(env->type_env, d->tmp); in iselStmt()
3839 doHelperCall( &addToSp, &rloc, env, d->guard, d->cee, retty, d->args ); in iselStmt()
3854 HReg r_dst = lookupIRTemp(env, d->tmp); in iselStmt()
3855 addInstr(env, MIPSInstr_Shft(Mshft_SLL, True, r_dst, in iselStmt()
3866 HReg r_dst = lookupIRTemp(env, d->tmp); in iselStmt()
3867 addInstr(env, mk_iMOVds_RR(r_dst, hregMIPS_GPR2(mode64))); in iselStmt()
3872 HReg rHi = newVRegI(env); in iselStmt()
3873 HReg rLo = newVRegI(env); in iselStmt()
3875 addInstr(env, mk_iMOVds_RR(rLo, hregMIPS_GPR2(mode64))); in iselStmt()
3876 addInstr(env, mk_iMOVds_RR(rHi, hregMIPS_GPR3(mode64))); in iselStmt()
3877 lookupIRTemp64(&dstHi, &dstLo, env, d->tmp); in iselStmt()
3878 addInstr(env, mk_iMOVds_RR(dstHi, rHi)); in iselStmt()
3879 addInstr(env, mk_iMOVds_RR(dstLo, rLo)); in iselStmt()
3891 HReg dst = lookupIRTemp(env, d->tmp); in iselStmt()
3893 addInstr(env, MIPSInstr_Load(mode64 ? 8 : 4, dst, am, mode64)); in iselStmt()
3894 add_to_sp(env, addToSp); in iselStmt()
3911 IRType tyRes = typeOfIRTemp(env->type_env, res); in iselStmt()
3912 IRType tyAddr = typeOfIRExpr(env->type_env, stmt->Ist.LLSC.addr); in iselStmt()
3921 r_addr = iselWordExpr_AMode(env, stmt->Ist.LLSC.addr, tyAddr); in iselStmt()
3923 HReg r_dst = lookupIRTemp(env, res); in iselStmt()
3925 addInstr(env, MIPSInstr_LoadL(4, r_dst, r_addr, mode64)); in iselStmt()
3928 addInstr(env, MIPSInstr_LoadL(8, r_dst, r_addr, mode64)); in iselStmt()
3934 r_addr = iselWordExpr_AMode(env, stmt->Ist.LLSC.addr, tyAddr); in iselStmt()
3935 HReg r_src = iselWordExpr_R(env, stmt->Ist.LLSC.storedata); in iselStmt()
3936 HReg r_dst = lookupIRTemp(env, res); in iselStmt()
3937 IRType tyData = typeOfIRExpr(env->type_env, in iselStmt()
3941 addInstr(env, mk_iMOVds_RR(r_dst, r_src)); in iselStmt()
3942 addInstr(env, MIPSInstr_StoreC(4, r_addr, r_dst, mode64)); in iselStmt()
3945 addInstr(env, mk_iMOVds_RR(r_dst, r_src)); in iselStmt()
3946 addInstr(env, MIPSInstr_StoreC(8, r_addr, r_dst, mode64)); in iselStmt()
3956 HReg old = lookupIRTemp(env, cas->oldLo); in iselStmt()
3957 HReg addr = iselWordExpr_R(env, cas->addr); in iselStmt()
3958 HReg expd = iselWordExpr_R(env, cas->expdLo); in iselStmt()
3959 HReg data = iselWordExpr_R(env, cas->dataLo); in iselStmt()
3960 if (typeOfIRTemp(env->type_env, cas->oldLo) == Ity_I64) { in iselStmt()
3961 addInstr(env, MIPSInstr_Cas(8, old, addr, expd, data, mode64)); in iselStmt()
3962 } else if (typeOfIRTemp(env->type_env, cas->oldLo) == Ity_I32) { in iselStmt()
3963 addInstr(env, MIPSInstr_Cas(4, old, addr, expd, data, mode64)); in iselStmt()
3992 MIPSCondCode cc = iselCondCode(env, stmt->Ist.Exit.guard); in iselStmt()
4000 if (env->chainingAllowed) { in iselStmt()
4006 ? (((Addr64)stmt->Ist.Exit.dst->Ico.U64) > (Addr64)env->max_ga) in iselStmt()
4007 : (((Addr32)stmt->Ist.Exit.dst->Ico.U32) > (Addr32)env->max_ga); in iselStmt()
4009 addInstr(env, MIPSInstr_XDirect( in iselStmt()
4017 HReg r = iselWordExpr_R(env, IRExpr_Const(stmt->Ist.Exit.dst)); in iselStmt()
4018 addInstr(env, MIPSInstr_XAssisted(r, amPC, cc, Ijk_Boring)); in iselStmt()
4039 HReg r = iselWordExpr_R(env, IRExpr_Const(stmt->Ist.Exit.dst)); in iselStmt()
4040 addInstr(env, MIPSInstr_XAssisted(r, amPC, cc, in iselStmt()
4066 static void iselNext ( ISelEnv* env, in iselNext() argument
4080 vassert(cdst->tag == (env->mode64 ? Ico_U64 :Ico_U32)); in iselNext()
4083 MIPSAMode* amPC = MIPSAMode_IR(offsIP, GuestStatePointer(env->mode64)); in iselNext()
4084 if (env->chainingAllowed) { in iselNext()
4089 = env->mode64 in iselNext()
4090 ? (((Addr64)cdst->Ico.U64) > (Addr64)env->max_ga) in iselNext()
4091 : (((Addr32)cdst->Ico.U32) > (Addr32)env->max_ga); in iselNext()
4093 addInstr(env, MIPSInstr_XDirect( in iselNext()
4094 env->mode64 ? (Addr64)cdst->Ico.U64 in iselNext()
4101 HReg r = iselWordExpr_R(env, next); in iselNext()
4102 addInstr(env, MIPSInstr_XAssisted(r, amPC, MIPScc_AL, in iselNext()
4112 HReg r = iselWordExpr_R(env, next); in iselNext()
4114 GuestStatePointer(env->mode64)); in iselNext()
4115 if (env->chainingAllowed) { in iselNext()
4116 addInstr(env, MIPSInstr_XIndir(r, amPC, MIPScc_AL)); in iselNext()
4118 addInstr(env, MIPSInstr_XAssisted(r, amPC, MIPScc_AL, in iselNext()
4142 HReg r = iselWordExpr_R(env, next); in iselNext()
4143 MIPSAMode* amPC = MIPSAMode_IR(offsIP, GuestStatePointer(env->mode64)); in iselNext()
4144 addInstr(env, MIPSInstr_XAssisted(r, amPC, MIPScc_AL, jk)); in iselNext()
4176 ISelEnv* env; in iselSB_MIPS() local
4197 env = LibVEX_Alloc_inline(sizeof(ISelEnv)); in iselSB_MIPS()
4198 env->vreg_ctr = 0; in iselSB_MIPS()
4199 env->mode64 = mode64; in iselSB_MIPS()
4200 env->fp_mode64 = fp_mode64; in iselSB_MIPS()
4203 env->code = newHInstrArray(); in iselSB_MIPS()
4205 /* Copy BB's type env. */ in iselSB_MIPS()
4206 env->type_env = bb->tyenv; in iselSB_MIPS()
4210 env->n_vregmap = bb->tyenv->types_used; in iselSB_MIPS()
4211 env->vregmap = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_MIPS()
4212 env->vregmapHI = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_MIPS()
4215 env->hwcaps = hwcaps_host; in iselSB_MIPS()
4216 env->chainingAllowed = chainingAllowed; in iselSB_MIPS()
4217 env->hwcaps = hwcaps_host; in iselSB_MIPS()
4218 env->max_ga = max_ga; in iselSB_MIPS()
4223 for (i = 0; i < env->n_vregmap; i++) { in iselSB_MIPS()
4267 env->vregmap[i] = hreg; in iselSB_MIPS()
4268 env->vregmapHI[i] = hregHI; in iselSB_MIPS()
4270 env->vreg_ctr = j; in iselSB_MIPS()
4275 addInstr(env, MIPSInstr_EvCheck(amCounter, amFailAddr)); in iselSB_MIPS()
4282 addInstr(env, MIPSInstr_ProfInc()); in iselSB_MIPS()
4287 iselStmt(env, bb->stmts[i]); in iselSB_MIPS()
4289 iselNext(env, bb->next, bb->jumpkind, bb->offsIP); in iselSB_MIPS()
4292 env->code->n_vregs = env->vreg_ctr; in iselSB_MIPS()
4293 return env->code; in iselSB_MIPS()