Lines Matching full:env
193 static HReg lookupIRTemp ( ISelEnv* env, IRTemp tmp ) in lookupIRTemp() argument
196 vassert(tmp < env->n_vregmap); in lookupIRTemp()
197 return env->vregmap[tmp]; in lookupIRTemp()
200 static void lookupIRTemp64 ( HReg* vrHI, HReg* vrLO, ISelEnv* env, IRTemp tmp ) in lookupIRTemp64() argument
203 vassert(tmp < env->n_vregmap); in lookupIRTemp64()
204 vassert(! hregIsInvalid(env->vregmapHI[tmp])); in lookupIRTemp64()
205 *vrLO = env->vregmap[tmp]; in lookupIRTemp64()
206 *vrHI = env->vregmapHI[tmp]; in lookupIRTemp64()
209 static void addInstr ( ISelEnv* env, X86Instr* instr ) in addInstr() argument
211 addHInstr(env->code, instr); in addInstr()
218 static HReg newVRegI ( ISelEnv* env ) in newVRegI() argument
220 HReg reg = mkHReg(True/*virtual reg*/, HRcInt32, 0/*enc*/, env->vreg_ctr); in newVRegI()
221 env->vreg_ctr++; in newVRegI()
225 static HReg newVRegF ( ISelEnv* env ) in newVRegF() argument
227 HReg reg = mkHReg(True/*virtual reg*/, HRcFlt64, 0/*enc*/, env->vreg_ctr); in newVRegF()
228 env->vreg_ctr++; in newVRegF()
232 static HReg newVRegV ( ISelEnv* env ) in newVRegV() argument
234 HReg reg = mkHReg(True/*virtual reg*/, HRcVec128, 0/*enc*/, env->vreg_ctr); in newVRegV()
235 env->vreg_ctr++; in newVRegV()
250 static X86RMI* iselIntExpr_RMI_wrk ( ISelEnv* env, const IRExpr* e );
251 static X86RMI* iselIntExpr_RMI ( ISelEnv* env, const IRExpr* e );
253 static X86RI* iselIntExpr_RI_wrk ( ISelEnv* env, const IRExpr* e );
254 static X86RI* iselIntExpr_RI ( ISelEnv* env, const IRExpr* e );
256 static X86RM* iselIntExpr_RM_wrk ( ISelEnv* env, const IRExpr* e );
257 static X86RM* iselIntExpr_RM ( ISelEnv* env, const IRExpr* e );
259 static HReg iselIntExpr_R_wrk ( ISelEnv* env, const IRExpr* e );
260 static HReg iselIntExpr_R ( ISelEnv* env, const IRExpr* e );
262 static X86AMode* iselIntExpr_AMode_wrk ( ISelEnv* env, const IRExpr* e );
263 static X86AMode* iselIntExpr_AMode ( ISelEnv* env, const IRExpr* e );
266 ISelEnv* env, const IRExpr* e );
268 ISelEnv* env, const IRExpr* e );
270 static X86CondCode iselCondCode_wrk ( ISelEnv* env, const IRExpr* e );
271 static X86CondCode iselCondCode ( ISelEnv* env, const IRExpr* e );
273 static HReg iselDblExpr_wrk ( ISelEnv* env, const IRExpr* e );
274 static HReg iselDblExpr ( ISelEnv* env, const IRExpr* e );
276 static HReg iselFltExpr_wrk ( ISelEnv* env, const IRExpr* e );
277 static HReg iselFltExpr ( ISelEnv* env, const IRExpr* e );
279 static HReg iselVecExpr_wrk ( ISelEnv* env, const IRExpr* e );
280 static HReg iselVecExpr ( ISelEnv* env, const IRExpr* e );
308 static void add_to_esp ( ISelEnv* env, Int n ) in add_to_esp() argument
311 addInstr(env, in add_to_esp()
315 static void sub_from_esp ( ISelEnv* env, Int n ) in sub_from_esp() argument
318 addInstr(env, in sub_from_esp()
347 static Int pushArg ( ISelEnv* env, IRExpr* arg, HReg r_vecRetAddr ) in pushArg() argument
352 addInstr(env, X86Instr_Push(X86RMI_Reg(r_vecRetAddr))); in pushArg()
356 addInstr(env, X86Instr_Push(X86RMI_Reg(hregX86_EBP()))); in pushArg()
360 IRType arg_ty = typeOfIRExpr(env->type_env, arg); in pushArg()
362 addInstr(env, X86Instr_Push(iselIntExpr_RMI(env, arg))); in pushArg()
367 iselInt64Expr(&rHi, &rLo, env, arg); in pushArg()
368 addInstr(env, X86Instr_Push(X86RMI_Reg(rHi))); in pushArg()
369 addInstr(env, X86Instr_Push(X86RMI_Reg(rLo))); in pushArg()
381 void callHelperAndClearArgs ( ISelEnv* env, X86CondCode cc, in callHelperAndClearArgs() argument
390 addInstr(env, X86Instr_Call( cc, (Addr)cee->addr, in callHelperAndClearArgs()
393 add_to_esp(env, 4*n_arg_ws); in callHelperAndClearArgs()
430 ISelEnv* env, in doHelperCall() argument
527 r_vecRetAddr = newVRegI(env); in doHelperCall()
528 sub_from_esp(env, 16); in doHelperCall()
529 addInstr(env, mk_iMOVsd_RR( hregX86_ESP(), r_vecRetAddr )); in doHelperCall()
544 n_arg_ws += pushArg(env, args[i], r_vecRetAddr); in doHelperCall()
594 vassert(typeOfIRExpr(env->type_env, arg) == Ity_I32); in doHelperCall()
595 tmpregs[argreg] = iselIntExpr_R(env, arg); in doHelperCall()
602 addInstr( env, mk_iMOVsd_RR( tmpregs[argregX], argregs[argregX] ) ); in doHelperCall()
614 addInstr(env, X86Instr_Alu32R(Xalu_MOV, in doHelperCall()
621 vassert(typeOfIRExpr(env->type_env, arg) == Ity_I32); in doHelperCall()
622 addInstr(env, X86Instr_Alu32R(Xalu_MOV, in doHelperCall()
623 iselIntExpr_RMI(env, arg), in doHelperCall()
650 cc = iselCondCode( env, guard ); in doHelperCall()
686 callHelperAndClearArgs( env, cc, cee, n_arg_ws, *retloc ); in doHelperCall()
695 X86AMode* genGuestArrayOffset ( ISelEnv* env, IRRegArray* descr, in genGuestArrayOffset() argument
724 tmp = newVRegI(env); in genGuestArrayOffset()
725 roff = iselIntExpr_R(env, off); in genGuestArrayOffset()
726 addInstr(env, mk_iMOVsd_RR(roff, tmp)); in genGuestArrayOffset()
728 addInstr(env, in genGuestArrayOffset()
731 addInstr(env, in genGuestArrayOffset()
741 void set_FPU_rounding_default ( ISelEnv* env ) in set_FPU_rounding_default() argument
748 addInstr(env, X86Instr_Push(X86RMI_Imm(DEFAULT_FPUCW))); in set_FPU_rounding_default()
749 addInstr(env, X86Instr_FpLdCW(zero_esp)); in set_FPU_rounding_default()
750 add_to_esp(env, 4); in set_FPU_rounding_default()
760 void set_FPU_rounding_mode ( ISelEnv* env, IRExpr* mode ) in set_FPU_rounding_mode() argument
762 HReg rrm = iselIntExpr_R(env, mode); in set_FPU_rounding_mode()
763 HReg rrm2 = newVRegI(env); in set_FPU_rounding_mode()
774 addInstr(env, mk_iMOVsd_RR(rrm, rrm2)); in set_FPU_rounding_mode()
775 addInstr(env, X86Instr_Alu32R(Xalu_AND, X86RMI_Imm(3), rrm2)); in set_FPU_rounding_mode()
776 addInstr(env, X86Instr_Sh32(Xsh_SHL, 10, rrm2)); in set_FPU_rounding_mode()
777 addInstr(env, X86Instr_Alu32R(Xalu_OR, X86RMI_Imm(DEFAULT_FPUCW), rrm2)); in set_FPU_rounding_mode()
778 addInstr(env, X86Instr_Push(X86RMI_Reg(rrm2))); in set_FPU_rounding_mode()
779 addInstr(env, X86Instr_FpLdCW(zero_esp)); in set_FPU_rounding_mode()
780 add_to_esp(env, 4); in set_FPU_rounding_mode()
788 static HReg do_sse_Not128 ( ISelEnv* env, HReg src ) in do_sse_Not128() argument
790 HReg dst = newVRegV(env); in do_sse_Not128()
793 addInstr(env, X86Instr_SseReRg(Xsse_XOR, dst, dst)); in do_sse_Not128()
795 addInstr(env, X86Instr_Sse32Fx4(Xsse_CMPEQF, dst, dst)); in do_sse_Not128()
797 addInstr(env, X86Instr_SseReRg(Xsse_XOR, src, dst)); in do_sse_Not128()
810 static void roundToF64 ( ISelEnv* env, HReg reg ) in roundToF64() argument
813 sub_from_esp(env, 8); in roundToF64()
814 addInstr(env, X86Instr_FpLdSt(False/*store*/, 8, reg, zero_esp)); in roundToF64()
815 addInstr(env, X86Instr_FpLdSt(True/*load*/, 8, reg, zero_esp)); in roundToF64()
816 add_to_esp(env, 8); in roundToF64()
838 static HReg iselIntExpr_R ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_R() argument
840 HReg r = iselIntExpr_R_wrk(env, e); in iselIntExpr_R()
851 static HReg iselIntExpr_R_wrk ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_R_wrk() argument
855 IRType ty = typeOfIRExpr(env->type_env,e); in iselIntExpr_R_wrk()
862 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselIntExpr_R_wrk()
867 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
868 X86AMode* amode = iselIntExpr_AMode ( env, e->Iex.Load.addr ); in iselIntExpr_R_wrk()
875 addInstr(env, X86Instr_Alu32R(Xalu_MOV, in iselIntExpr_R_wrk()
880 addInstr(env, X86Instr_LoadEX(2,False,amode,dst)); in iselIntExpr_R_wrk()
884 addInstr(env, X86Instr_LoadEX(1,False,amode,dst)); in iselIntExpr_R_wrk()
897 HReg junk = newVRegF(env); in iselIntExpr_R_wrk()
898 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
899 HReg srcL = iselDblExpr(env, triop->arg2); in iselIntExpr_R_wrk()
900 HReg srcR = iselDblExpr(env, triop->arg3); in iselIntExpr_R_wrk()
903 addInstr(env, X86Instr_FpBinary( in iselIntExpr_R_wrk()
910 addInstr(env, X86Instr_FpStSW_AX()); in iselIntExpr_R_wrk()
911 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), dst)); in iselIntExpr_R_wrk()
912 addInstr(env, X86Instr_Alu32R(Xalu_AND, X86RMI_Imm(0x4700), dst)); in iselIntExpr_R_wrk()
926 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
927 HReg reg = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
928 addInstr(env, mk_iMOVsd_RR(reg,dst)); in iselIntExpr_R_wrk()
929 addInstr(env, X86Instr_Unary32(Xun_NEG,dst)); in iselIntExpr_R_wrk()
953 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
954 HReg reg = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_R_wrk()
955 X86RMI* rmi = iselIntExpr_RMI(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
956 addInstr(env, mk_iMOVsd_RR(reg,dst)); in iselIntExpr_R_wrk()
957 addInstr(env, X86Instr_Alu32R(aluOp, rmi, dst)); in iselIntExpr_R_wrk()
990 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
993 HReg regL = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_R_wrk()
994 addInstr(env, mk_iMOVsd_RR(regL,dst)); in iselIntExpr_R_wrk()
999 addInstr(env, X86Instr_Alu32R( in iselIntExpr_R_wrk()
1003 addInstr(env, X86Instr_Alu32R( in iselIntExpr_R_wrk()
1007 addInstr(env, X86Instr_Sh32(Xsh_SHL, 24, dst)); in iselIntExpr_R_wrk()
1008 addInstr(env, X86Instr_Sh32(Xsh_SAR, 24, dst)); in iselIntExpr_R_wrk()
1011 addInstr(env, X86Instr_Sh32(Xsh_SHL, 16, dst)); in iselIntExpr_R_wrk()
1012 addInstr(env, X86Instr_Sh32(Xsh_SAR, 16, dst)); in iselIntExpr_R_wrk()
1027 addInstr(env, X86Instr_Sh32( shOp, nshift, dst )); in iselIntExpr_R_wrk()
1030 HReg regR = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
1031 addInstr(env, mk_iMOVsd_RR(regR,hregX86_ECX())); in iselIntExpr_R_wrk()
1032 addInstr(env, X86Instr_Sh32(shOp, 0/* %cl */, dst)); in iselIntExpr_R_wrk()
1040 HReg src1 = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_R_wrk()
1041 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1042 HReg src2 = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
1043 addInstr(env, mk_iMOVsd_RR(src1,dst)); in iselIntExpr_R_wrk()
1044 addInstr(env, X86Instr_Alu32R(Xalu_CMP, X86RMI_Reg(src2), dst)); in iselIntExpr_R_wrk()
1045 addInstr(env, X86Instr_CMov32(Xcc_B, X86RM_Reg(src2), dst)); in iselIntExpr_R_wrk()
1050 HReg hi8 = newVRegI(env); in iselIntExpr_R_wrk()
1051 HReg lo8 = newVRegI(env); in iselIntExpr_R_wrk()
1052 HReg hi8s = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_R_wrk()
1053 HReg lo8s = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
1054 addInstr(env, mk_iMOVsd_RR(hi8s, hi8)); in iselIntExpr_R_wrk()
1055 addInstr(env, mk_iMOVsd_RR(lo8s, lo8)); in iselIntExpr_R_wrk()
1056 addInstr(env, X86Instr_Sh32(Xsh_SHL, 8, hi8)); in iselIntExpr_R_wrk()
1057 addInstr(env, X86Instr_Alu32R(Xalu_AND, X86RMI_Imm(0xFF), lo8)); in iselIntExpr_R_wrk()
1058 addInstr(env, X86Instr_Alu32R(Xalu_OR, X86RMI_Reg(lo8), hi8)); in iselIntExpr_R_wrk()
1063 HReg hi16 = newVRegI(env); in iselIntExpr_R_wrk()
1064 HReg lo16 = newVRegI(env); in iselIntExpr_R_wrk()
1065 HReg hi16s = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_R_wrk()
1066 HReg lo16s = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
1067 addInstr(env, mk_iMOVsd_RR(hi16s, hi16)); in iselIntExpr_R_wrk()
1068 addInstr(env, mk_iMOVsd_RR(lo16s, lo16)); in iselIntExpr_R_wrk()
1069 addInstr(env, X86Instr_Sh32(Xsh_SHL, 16, hi16)); in iselIntExpr_R_wrk()
1070 addInstr(env, X86Instr_Alu32R(Xalu_AND, X86RMI_Imm(0xFFFF), lo16)); in iselIntExpr_R_wrk()
1071 addInstr(env, X86Instr_Alu32R(Xalu_OR, X86RMI_Reg(lo16), hi16)); in iselIntExpr_R_wrk()
1077 HReg a16 = newVRegI(env); in iselIntExpr_R_wrk()
1078 HReg b16 = newVRegI(env); in iselIntExpr_R_wrk()
1079 HReg a16s = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_R_wrk()
1080 HReg b16s = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
1088 addInstr(env, mk_iMOVsd_RR(a16s, a16)); in iselIntExpr_R_wrk()
1089 addInstr(env, mk_iMOVsd_RR(b16s, b16)); in iselIntExpr_R_wrk()
1090 addInstr(env, X86Instr_Sh32(Xsh_SHL, shift, a16)); in iselIntExpr_R_wrk()
1091 addInstr(env, X86Instr_Sh32(Xsh_SHL, shift, b16)); in iselIntExpr_R_wrk()
1092 addInstr(env, X86Instr_Sh32(shr_op, shift, a16)); in iselIntExpr_R_wrk()
1093 addInstr(env, X86Instr_Sh32(shr_op, shift, b16)); in iselIntExpr_R_wrk()
1094 addInstr(env, X86Instr_Alu32R(Xalu_MUL, X86RMI_Reg(a16), b16)); in iselIntExpr_R_wrk()
1099 HReg fL = iselDblExpr(env, e->Iex.Binop.arg1); in iselIntExpr_R_wrk()
1100 HReg fR = iselDblExpr(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
1101 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1102 addInstr(env, X86Instr_FpCmp(fL,fR,dst)); in iselIntExpr_R_wrk()
1105 addInstr(env, X86Instr_Sh32(Xsh_SHR, 8, dst)); in iselIntExpr_R_wrk()
1112 HReg rf = iselDblExpr(env, e->Iex.Binop.arg2); in iselIntExpr_R_wrk()
1113 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1125 sub_from_esp(env, 4); in iselIntExpr_R_wrk()
1128 set_FPU_rounding_mode( env, e->Iex.Binop.arg1 ); in iselIntExpr_R_wrk()
1131 addInstr(env, X86Instr_FpLdStI(False/*store*/, in iselIntExpr_R_wrk()
1136 addInstr(env, X86Instr_LoadEX(2,False,zero_esp,dst)); in iselIntExpr_R_wrk()
1140 addInstr(env, X86Instr_Alu32R( in iselIntExpr_R_wrk()
1145 set_FPU_rounding_default( env ); in iselIntExpr_R_wrk()
1148 add_to_esp(env, 4); in iselIntExpr_R_wrk()
1165 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1166 HReg src = iselIntExpr_R(env, expr32); in iselIntExpr_R_wrk()
1167 addInstr(env, mk_iMOVsd_RR(src,dst) ); in iselIntExpr_R_wrk()
1168 addInstr(env, X86Instr_Alu32R(Xalu_AND, in iselIntExpr_R_wrk()
1181 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1182 X86AMode* amode = iselIntExpr_AMode ( env, mi.bindee[0] ); in iselIntExpr_R_wrk()
1183 addInstr(env, X86Instr_LoadEX(1,False,amode,dst)); in iselIntExpr_R_wrk()
1195 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1196 X86AMode* amode = iselIntExpr_AMode ( env, mi.bindee[0] ); in iselIntExpr_R_wrk()
1197 addInstr(env, X86Instr_LoadEX(1,True,amode,dst)); in iselIntExpr_R_wrk()
1209 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1210 X86AMode* amode = iselIntExpr_AMode ( env, mi.bindee[0] ); in iselIntExpr_R_wrk()
1211 addInstr(env, X86Instr_LoadEX(2,False,amode,dst)); in iselIntExpr_R_wrk()
1222 dst = newVRegI(env); in iselIntExpr_R_wrk()
1225 addInstr(env, X86Instr_LoadEX(1,False,amode,dst)); in iselIntExpr_R_wrk()
1236 dst = newVRegI(env); in iselIntExpr_R_wrk()
1239 addInstr(env, X86Instr_LoadEX(2,False,amode,dst)); in iselIntExpr_R_wrk()
1248 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1249 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1251 addInstr(env, mk_iMOVsd_RR(src,dst) ); in iselIntExpr_R_wrk()
1252 addInstr(env, X86Instr_Alu32R(Xalu_AND, in iselIntExpr_R_wrk()
1259 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1260 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1262 addInstr(env, mk_iMOVsd_RR(src,dst) ); in iselIntExpr_R_wrk()
1263 addInstr(env, X86Instr_Sh32(Xsh_SHL, amt, dst)); in iselIntExpr_R_wrk()
1264 addInstr(env, X86Instr_Sh32(Xsh_SAR, amt, dst)); in iselIntExpr_R_wrk()
1270 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1271 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1272 addInstr(env, mk_iMOVsd_RR(src,dst) ); in iselIntExpr_R_wrk()
1273 addInstr(env, X86Instr_Unary32(Xun_NOT,dst)); in iselIntExpr_R_wrk()
1278 iselInt64Expr(&rHi,&rLo, env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1283 iselInt64Expr(&rHi,&rLo, env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1288 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1289 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1291 addInstr(env, mk_iMOVsd_RR(src,dst) ); in iselIntExpr_R_wrk()
1292 addInstr(env, X86Instr_Sh32(Xsh_SHR, shift, dst)); in iselIntExpr_R_wrk()
1297 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1298 X86CondCode cond = iselCondCode(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1299 addInstr(env, X86Instr_Set32(cond,dst)); in iselIntExpr_R_wrk()
1306 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1307 X86CondCode cond = iselCondCode(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1308 addInstr(env, X86Instr_Set32(cond,dst)); in iselIntExpr_R_wrk()
1309 addInstr(env, X86Instr_Sh32(Xsh_SHL, 31, dst)); in iselIntExpr_R_wrk()
1310 addInstr(env, X86Instr_Sh32(Xsh_SAR, 31, dst)); in iselIntExpr_R_wrk()
1315 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1316 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1317 addInstr(env, X86Instr_Bsfr32(True,src,dst)); in iselIntExpr_R_wrk()
1324 HReg tmp = newVRegI(env); in iselIntExpr_R_wrk()
1325 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1326 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1327 addInstr(env, X86Instr_Bsfr32(False,src,tmp)); in iselIntExpr_R_wrk()
1328 addInstr(env, X86Instr_Alu32R(Xalu_MOV, in iselIntExpr_R_wrk()
1330 addInstr(env, X86Instr_Alu32R(Xalu_SUB, in iselIntExpr_R_wrk()
1336 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1337 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1338 addInstr(env, mk_iMOVsd_RR(src,dst)); in iselIntExpr_R_wrk()
1339 addInstr(env, X86Instr_Unary32(Xun_NEG,dst)); in iselIntExpr_R_wrk()
1340 addInstr(env, X86Instr_Alu32R(Xalu_OR, in iselIntExpr_R_wrk()
1342 addInstr(env, X86Instr_Sh32(Xsh_SAR, 31, dst)); in iselIntExpr_R_wrk()
1348 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1349 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1350 addInstr(env, mk_iMOVsd_RR(src, dst)); in iselIntExpr_R_wrk()
1351 addInstr(env, X86Instr_Unary32(Xun_NEG, dst)); in iselIntExpr_R_wrk()
1352 addInstr(env, X86Instr_Alu32R(Xalu_OR, X86RMI_Reg(src), dst)); in iselIntExpr_R_wrk()
1357 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1358 HReg vec = iselVecExpr(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1360 sub_from_esp(env, 16); in iselIntExpr_R_wrk()
1361 addInstr(env, X86Instr_SseLdSt(False/*store*/, vec, esp0)); in iselIntExpr_R_wrk()
1362 addInstr(env, X86Instr_Alu32R( Xalu_MOV, X86RMI_Mem(esp0), dst )); in iselIntExpr_R_wrk()
1363 add_to_esp(env, 16); in iselIntExpr_R_wrk()
1372 HReg rf = iselFltExpr(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1373 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1376 set_FPU_rounding_default(env); in iselIntExpr_R_wrk()
1378 sub_from_esp(env, 8); in iselIntExpr_R_wrk()
1380 addInstr(env, in iselIntExpr_R_wrk()
1383 addInstr(env, in iselIntExpr_R_wrk()
1386 add_to_esp(env, 8); in iselIntExpr_R_wrk()
1394 return iselIntExpr_R(env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1402 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1404 iselInt64Expr(&xHi, &xLo, env, e->Iex.Unop.arg); in iselIntExpr_R_wrk()
1405 addInstr(env, X86Instr_Push(X86RMI_Reg(xHi))); in iselIntExpr_R_wrk()
1406 addInstr(env, X86Instr_Push(X86RMI_Reg(xLo))); in iselIntExpr_R_wrk()
1407 addInstr(env, X86Instr_Call( Xcc_ALWAYS, (Addr32)fn, in iselIntExpr_R_wrk()
1409 add_to_esp(env, 2*4); in iselIntExpr_R_wrk()
1410 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), dst)); in iselIntExpr_R_wrk()
1423 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1424 addInstr(env, X86Instr_Alu32R( in iselIntExpr_R_wrk()
1432 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1433 addInstr(env, X86Instr_LoadEX( in iselIntExpr_R_wrk()
1446 env, e->Iex.GetI.descr, in iselIntExpr_R_wrk()
1448 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1450 addInstr(env, X86Instr_LoadEX( 1, False, am, dst )); in iselIntExpr_R_wrk()
1454 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Mem(am), dst)); in iselIntExpr_R_wrk()
1462 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1474 doHelperCall( &addToSp, &rloc, env, NULL/*guard*/, in iselIntExpr_R_wrk()
1480 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), dst)); in iselIntExpr_R_wrk()
1487 X86RMI* rmi = iselIntExpr_RMI ( env, e ); in iselIntExpr_R_wrk()
1488 HReg r = newVRegI(env); in iselIntExpr_R_wrk()
1489 addInstr(env, X86Instr_Alu32R(Xalu_MOV, rmi, r)); in iselIntExpr_R_wrk()
1496 && typeOfIRExpr(env->type_env,e->Iex.ITE.cond) == Ity_I1) { in iselIntExpr_R_wrk()
1497 HReg r1 = iselIntExpr_R(env, e->Iex.ITE.iftrue); in iselIntExpr_R_wrk()
1498 X86RM* r0 = iselIntExpr_RM(env, e->Iex.ITE.iffalse); in iselIntExpr_R_wrk()
1499 HReg dst = newVRegI(env); in iselIntExpr_R_wrk()
1500 addInstr(env, mk_iMOVsd_RR(r1,dst)); in iselIntExpr_R_wrk()
1501 X86CondCode cc = iselCondCode(env, e->Iex.ITE.cond); in iselIntExpr_R_wrk()
1502 addInstr(env, X86Instr_CMov32(cc ^ 1, r0, dst)); in iselIntExpr_R_wrk()
1549 static X86AMode* iselIntExpr_AMode ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_AMode() argument
1551 X86AMode* am = iselIntExpr_AMode_wrk(env, e); in iselIntExpr_AMode()
1557 static X86AMode* iselIntExpr_AMode_wrk ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_AMode_wrk() argument
1559 IRType ty = typeOfIRExpr(env->type_env,e); in iselIntExpr_AMode_wrk()
1579 HReg r1 = iselIntExpr_R(env, e->Iex.Binop.arg1->Iex.Binop.arg1); in iselIntExpr_AMode_wrk()
1580 HReg r2 = iselIntExpr_R(env, e->Iex.Binop.arg1 in iselIntExpr_AMode_wrk()
1595 HReg r1 = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_AMode_wrk()
1596 HReg r2 = iselIntExpr_R(env, e->Iex.Binop.arg2->Iex.Binop.arg1 ); in iselIntExpr_AMode_wrk()
1606 HReg r1 = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselIntExpr_AMode_wrk()
1613 HReg r1 = iselIntExpr_R(env, e); in iselIntExpr_AMode_wrk()
1624 static X86RMI* iselIntExpr_RMI ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_RMI() argument
1626 X86RMI* rmi = iselIntExpr_RMI_wrk(env, e); in iselIntExpr_RMI()
1644 static X86RMI* iselIntExpr_RMI_wrk ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_RMI_wrk() argument
1646 IRType ty = typeOfIRExpr(env->type_env,e); in iselIntExpr_RMI_wrk()
1670 X86AMode* am = iselIntExpr_AMode(env, e->Iex.Load.addr); in iselIntExpr_RMI_wrk()
1676 HReg r = iselIntExpr_R ( env, e ); in iselIntExpr_RMI_wrk()
1687 static X86RI* iselIntExpr_RI ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_RI() argument
1689 X86RI* ri = iselIntExpr_RI_wrk(env, e); in iselIntExpr_RI()
1704 static X86RI* iselIntExpr_RI_wrk ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_RI_wrk() argument
1706 IRType ty = typeOfIRExpr(env->type_env,e); in iselIntExpr_RI_wrk()
1723 HReg r = iselIntExpr_R ( env, e ); in iselIntExpr_RI_wrk()
1734 static X86RM* iselIntExpr_RM ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_RM() argument
1736 X86RM* rm = iselIntExpr_RM_wrk(env, e); in iselIntExpr_RM()
1752 static X86RM* iselIntExpr_RM_wrk ( ISelEnv* env, const IRExpr* e ) in iselIntExpr_RM_wrk() argument
1754 IRType ty = typeOfIRExpr(env->type_env,e); in iselIntExpr_RM_wrk()
1767 HReg r = iselIntExpr_R ( env, e ); in iselIntExpr_RM_wrk()
1779 static X86CondCode iselCondCode ( ISelEnv* env, const IRExpr* e ) in iselCondCode() argument
1782 return iselCondCode_wrk(env,e); in iselCondCode()
1786 static X86CondCode iselCondCode_wrk ( ISelEnv* env, const IRExpr* e ) in iselCondCode_wrk() argument
1791 vassert(typeOfIRExpr(env->type_env,e) == Ity_I1); in iselCondCode_wrk()
1795 HReg r32 = lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselCondCode_wrk()
1797 addInstr(env, X86Instr_Test32(1,X86RM_Reg(r32))); in iselCondCode_wrk()
1807 r = newVRegI(env); in iselCondCode_wrk()
1808 addInstr(env, X86Instr_Alu32R(Xalu_MOV,X86RMI_Imm(0),r)); in iselCondCode_wrk()
1809 addInstr(env, X86Instr_Alu32R(Xalu_XOR,X86RMI_Reg(r),r)); in iselCondCode_wrk()
1816 return 1 ^ iselCondCode(env, e->Iex.Unop.arg); in iselCondCode_wrk()
1823 X86RM* rm = iselIntExpr_RM(env, e->Iex.Unop.arg); in iselCondCode_wrk()
1824 addInstr(env, X86Instr_Test32(1,rm)); in iselCondCode_wrk()
1833 X86RM* rm = iselIntExpr_RM(env, e->Iex.Unop.arg); in iselCondCode_wrk()
1834 addInstr(env, X86Instr_Test32(0xFF,rm)); in iselCondCode_wrk()
1843 X86RM* rm = iselIntExpr_RM(env, e->Iex.Unop.arg); in iselCondCode_wrk()
1844 addInstr(env, X86Instr_Test32(0xFFFF,rm)); in iselCondCode_wrk()
1856 HReg r0 = iselIntExpr_R(env, mi.bindee[0]); in iselCondCode_wrk()
1857 X86RMI* rmi1 = iselIntExpr_RMI(env, mi.bindee[1]); in iselCondCode_wrk()
1858 HReg tmp = newVRegI(env); in iselCondCode_wrk()
1859 addInstr(env, mk_iMOVsd_RR(r0, tmp)); in iselCondCode_wrk()
1860 addInstr(env, X86Instr_Alu32R(Xalu_AND,rmi1,tmp)); in iselCondCode_wrk()
1871 HReg r0 = iselIntExpr_R(env, mi.bindee[0]); in iselCondCode_wrk()
1872 X86RMI* rmi1 = iselIntExpr_RMI(env, mi.bindee[1]); in iselCondCode_wrk()
1873 HReg tmp = newVRegI(env); in iselCondCode_wrk()
1874 addInstr(env, mk_iMOVsd_RR(r0, tmp)); in iselCondCode_wrk()
1875 addInstr(env, X86Instr_Alu32R(Xalu_OR,rmi1,tmp)); in iselCondCode_wrk()
1886 addInstr(env, X86Instr_Alu32M(Xalu_CMP, X86RI_Imm(0), am)); in iselCondCode_wrk()
1893 HReg r1 = iselIntExpr_R(env, e->Iex.Unop.arg); in iselCondCode_wrk()
1895 addInstr(env, X86Instr_Alu32R(Xalu_CMP,rmi2,r1)); in iselCondCode_wrk()
1908 HReg tmp = newVRegI(env); in iselCondCode_wrk()
1909 iselInt64Expr( &hi1, &lo1, env, mi.bindee[0] ); in iselCondCode_wrk()
1910 addInstr(env, mk_iMOVsd_RR(hi1, tmp)); in iselCondCode_wrk()
1911 addInstr(env, X86Instr_Alu32R(Xalu_OR,X86RMI_Reg(lo1),tmp)); in iselCondCode_wrk()
1912 iselInt64Expr( &hi2, &lo2, env, mi.bindee[1] ); in iselCondCode_wrk()
1913 addInstr(env, X86Instr_Alu32R(Xalu_OR,X86RMI_Reg(hi2),tmp)); in iselCondCode_wrk()
1914 addInstr(env, X86Instr_Alu32R(Xalu_OR,X86RMI_Reg(lo2),tmp)); in iselCondCode_wrk()
1923 HReg tmp = newVRegI(env); in iselCondCode_wrk()
1924 iselInt64Expr( &hi, &lo, env, e->Iex.Unop.arg ); in iselCondCode_wrk()
1925 addInstr(env, mk_iMOVsd_RR(hi, tmp)); in iselCondCode_wrk()
1926 addInstr(env, X86Instr_Alu32R(Xalu_OR,X86RMI_Reg(lo), tmp)); in iselCondCode_wrk()
1939 HReg r1 = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselCondCode_wrk()
1940 addInstr(env, X86Instr_Test32(0xFF,X86RM_Reg(r1))); in iselCondCode_wrk()
1947 HReg r1 = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselCondCode_wrk()
1948 X86RMI* rmi2 = iselIntExpr_RMI(env, e->Iex.Binop.arg2); in iselCondCode_wrk()
1949 HReg r = newVRegI(env); in iselCondCode_wrk()
1950 addInstr(env, mk_iMOVsd_RR(r1,r)); in iselCondCode_wrk()
1951 addInstr(env, X86Instr_Alu32R(Xalu_XOR,rmi2,r)); in iselCondCode_wrk()
1952 addInstr(env, X86Instr_Test32(0xFF,X86RM_Reg(r))); in iselCondCode_wrk()
1968 HReg r1 = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselCondCode_wrk()
1969 X86RMI* rmi2 = iselIntExpr_RMI(env, e->Iex.Binop.arg2); in iselCondCode_wrk()
1970 HReg r = newVRegI(env); in iselCondCode_wrk()
1971 addInstr(env, mk_iMOVsd_RR(r1,r)); in iselCondCode_wrk()
1972 addInstr(env, X86Instr_Alu32R(Xalu_XOR,rmi2,r)); in iselCondCode_wrk()
1973 addInstr(env, X86Instr_Test32(0xFFFF,X86RM_Reg(r))); in iselCondCode_wrk()
1998 doHelperCall( &addToSp, &rloc, env, NULL/*guard*/, in iselCondCode_wrk()
2005 addInstr(env, X86Instr_Alu32R(Xalu_CMP, in iselCondCode_wrk()
2022 HReg r1 = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselCondCode_wrk()
2023 X86RMI* rmi2 = iselIntExpr_RMI(env, e->Iex.Binop.arg2); in iselCondCode_wrk()
2024 addInstr(env, X86Instr_Alu32R(Xalu_CMP,rmi2,r1)); in iselCondCode_wrk()
2042 HReg tHi = newVRegI(env); in iselCondCode_wrk()
2043 HReg tLo = newVRegI(env); in iselCondCode_wrk()
2044 iselInt64Expr( &hi1, &lo1, env, e->Iex.Binop.arg1 ); in iselCondCode_wrk()
2045 iselInt64Expr( &hi2, &lo2, env, e->Iex.Binop.arg2 ); in iselCondCode_wrk()
2046 addInstr(env, mk_iMOVsd_RR(hi1, tHi)); in iselCondCode_wrk()
2047 addInstr(env, X86Instr_Alu32R(Xalu_XOR,X86RMI_Reg(hi2), tHi)); in iselCondCode_wrk()
2048 addInstr(env, mk_iMOVsd_RR(lo1, tLo)); in iselCondCode_wrk()
2049 addInstr(env, X86Instr_Alu32R(Xalu_XOR,X86RMI_Reg(lo2), tLo)); in iselCondCode_wrk()
2050 addInstr(env, X86Instr_Alu32R(Xalu_OR,X86RMI_Reg(tHi), tLo)); in iselCondCode_wrk()
2072 static void iselInt64Expr ( HReg* rHi, HReg* rLo, ISelEnv* env, in iselInt64Expr() argument
2075 iselInt64Expr_wrk(rHi, rLo, env, e); in iselInt64Expr()
2086 static void iselInt64Expr_wrk ( HReg* rHi, HReg* rLo, ISelEnv* env, in iselInt64Expr_wrk() argument
2092 vassert(typeOfIRExpr(env->type_env,e) == Ity_I64); in iselInt64Expr_wrk()
2099 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2100 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2104 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wLo), tLo)); in iselInt64Expr_wrk()
2108 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wHi), tHi)); in iselInt64Expr_wrk()
2109 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(wLo), tLo)); in iselInt64Expr_wrk()
2118 lookupIRTemp64( rHi, rLo, env, e->Iex.RdTmp.tmp); in iselInt64Expr_wrk()
2127 tLo = newVRegI(env); in iselInt64Expr_wrk()
2128 tHi = newVRegI(env); in iselInt64Expr_wrk()
2129 am0 = iselIntExpr_AMode(env, e->Iex.Load.addr); in iselInt64Expr_wrk()
2131 addInstr(env, X86Instr_Alu32R( Xalu_MOV, X86RMI_Mem(am0), tLo )); in iselInt64Expr_wrk()
2132 addInstr(env, X86Instr_Alu32R( Xalu_MOV, X86RMI_Mem(am4), tHi )); in iselInt64Expr_wrk()
2142 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2143 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2144 addInstr(env, X86Instr_Alu32R( Xalu_MOV, X86RMI_Mem(am), tLo )); in iselInt64Expr_wrk()
2145 addInstr(env, X86Instr_Alu32R( Xalu_MOV, X86RMI_Mem(am4), tHi )); in iselInt64Expr_wrk()
2154 = genGuestArrayOffset( env, e->Iex.GetI.descr, in iselInt64Expr_wrk()
2157 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2158 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2159 addInstr(env, X86Instr_Alu32R( Xalu_MOV, X86RMI_Mem(am), tLo )); in iselInt64Expr_wrk()
2160 addInstr(env, X86Instr_Alu32R( Xalu_MOV, X86RMI_Mem(am4), tHi )); in iselInt64Expr_wrk()
2169 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2170 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2171 iselInt64Expr(&e0Hi, &e0Lo, env, e->Iex.ITE.iffalse); in iselInt64Expr_wrk()
2172 iselInt64Expr(&e1Hi, &e1Lo, env, e->Iex.ITE.iftrue); in iselInt64Expr_wrk()
2173 addInstr(env, mk_iMOVsd_RR(e1Hi, tHi)); in iselInt64Expr_wrk()
2174 addInstr(env, mk_iMOVsd_RR(e1Lo, tLo)); in iselInt64Expr_wrk()
2175 X86CondCode cc = iselCondCode(env, e->Iex.ITE.cond); in iselInt64Expr_wrk()
2178 addInstr(env, X86Instr_CMov32(cc ^ 1, X86RM_Reg(e0Hi), tHi)); in iselInt64Expr_wrk()
2179 addInstr(env, X86Instr_CMov32(cc ^ 1, X86RM_Reg(e0Lo), tLo)); in iselInt64Expr_wrk()
2194 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2195 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2197 X86RM* rmLeft = iselIntExpr_RM(env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2198 HReg rRight = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2199 addInstr(env, mk_iMOVsd_RR(rRight, hregX86_EAX())); in iselInt64Expr_wrk()
2200 addInstr(env, X86Instr_MulL(syned, rmLeft)); in iselInt64Expr_wrk()
2202 addInstr(env, mk_iMOVsd_RR(hregX86_EDX(), tHi)); in iselInt64Expr_wrk()
2203 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), tLo)); in iselInt64Expr_wrk()
2215 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2216 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2218 X86RM* rmRight = iselIntExpr_RM(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2219 iselInt64Expr(&sHi,&sLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2220 addInstr(env, mk_iMOVsd_RR(sHi, hregX86_EDX())); in iselInt64Expr_wrk()
2221 addInstr(env, mk_iMOVsd_RR(sLo, hregX86_EAX())); in iselInt64Expr_wrk()
2222 addInstr(env, X86Instr_Div(syned, rmRight)); in iselInt64Expr_wrk()
2223 addInstr(env, mk_iMOVsd_RR(hregX86_EDX(), tHi)); in iselInt64Expr_wrk()
2224 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), tLo)); in iselInt64Expr_wrk()
2235 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2236 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2240 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2241 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2242 addInstr(env, mk_iMOVsd_RR(xHi, tHi)); in iselInt64Expr_wrk()
2243 addInstr(env, X86Instr_Alu32R(op, X86RMI_Reg(yHi), tHi)); in iselInt64Expr_wrk()
2244 addInstr(env, mk_iMOVsd_RR(xLo, tLo)); in iselInt64Expr_wrk()
2245 addInstr(env, X86Instr_Alu32R(op, X86RMI_Reg(yLo), tLo)); in iselInt64Expr_wrk()
2258 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2259 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2262 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2263 addInstr(env, mk_iMOVsd_RR(xHi, tHi)); in iselInt64Expr_wrk()
2264 addInstr(env, mk_iMOVsd_RR(xLo, tLo)); in iselInt64Expr_wrk()
2265 addInstr(env, X86Instr_Alu32R(Xalu_ADD, X86RMI_Imm(wLo), tLo)); in iselInt64Expr_wrk()
2266 addInstr(env, X86Instr_Alu32R(Xalu_ADC, X86RMI_Imm(wHi), tHi)); in iselInt64Expr_wrk()
2274 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2275 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2276 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2277 addInstr(env, mk_iMOVsd_RR(xHi, tHi)); in iselInt64Expr_wrk()
2278 addInstr(env, mk_iMOVsd_RR(xLo, tLo)); in iselInt64Expr_wrk()
2279 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2281 addInstr(env, X86Instr_Alu32R(Xalu_ADD, X86RMI_Reg(yLo), tLo)); in iselInt64Expr_wrk()
2282 addInstr(env, X86Instr_Alu32R(Xalu_ADC, X86RMI_Reg(yHi), tHi)); in iselInt64Expr_wrk()
2284 addInstr(env, X86Instr_Alu32R(Xalu_SUB, X86RMI_Reg(yLo), tLo)); in iselInt64Expr_wrk()
2285 addInstr(env, X86Instr_Alu32R(Xalu_SBB, X86RMI_Reg(yHi), tHi)); in iselInt64Expr_wrk()
2294 *rHi = iselIntExpr_R(env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2295 *rLo = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2320 tLo = newVRegI(env); in iselInt64Expr_wrk()
2321 tHi = newVRegI(env); in iselInt64Expr_wrk()
2322 tTemp = newVRegI(env); in iselInt64Expr_wrk()
2323 rAmt = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2324 iselInt64Expr(&sHi,&sLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2325 addInstr(env, mk_iMOVsd_RR(rAmt, hregX86_ECX())); in iselInt64Expr_wrk()
2326 addInstr(env, mk_iMOVsd_RR(sHi, tHi)); in iselInt64Expr_wrk()
2327 addInstr(env, mk_iMOVsd_RR(sLo, tLo)); in iselInt64Expr_wrk()
2330 addInstr(env, X86Instr_Sh3232(Xsh_SHL, 0/*%cl*/, tLo, tHi)); in iselInt64Expr_wrk()
2331 addInstr(env, X86Instr_Sh32(Xsh_SHL, 0/*%cl*/, tLo)); in iselInt64Expr_wrk()
2332 addInstr(env, X86Instr_Test32(32, X86RM_Reg(hregX86_ECX()))); in iselInt64Expr_wrk()
2333 addInstr(env, X86Instr_CMov32(Xcc_NZ, X86RM_Reg(tLo), tHi)); in iselInt64Expr_wrk()
2334 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(0), tTemp)); in iselInt64Expr_wrk()
2335 addInstr(env, X86Instr_CMov32(Xcc_NZ, X86RM_Reg(tTemp), tLo)); in iselInt64Expr_wrk()
2362 tLo = newVRegI(env); in iselInt64Expr_wrk()
2363 tHi = newVRegI(env); in iselInt64Expr_wrk()
2364 tTemp = newVRegI(env); in iselInt64Expr_wrk()
2365 rAmt = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2366 iselInt64Expr(&sHi,&sLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2367 addInstr(env, mk_iMOVsd_RR(rAmt, hregX86_ECX())); in iselInt64Expr_wrk()
2368 addInstr(env, mk_iMOVsd_RR(sHi, tHi)); in iselInt64Expr_wrk()
2369 addInstr(env, mk_iMOVsd_RR(sLo, tLo)); in iselInt64Expr_wrk()
2372 addInstr(env, X86Instr_Sh3232(Xsh_SHR, 0/*%cl*/, tHi, tLo)); in iselInt64Expr_wrk()
2373 addInstr(env, X86Instr_Sh32(Xsh_SHR, 0/*%cl*/, tHi)); in iselInt64Expr_wrk()
2374 addInstr(env, X86Instr_Test32(32, X86RM_Reg(hregX86_ECX()))); in iselInt64Expr_wrk()
2375 addInstr(env, X86Instr_CMov32(Xcc_NZ, X86RM_Reg(tHi), tLo)); in iselInt64Expr_wrk()
2376 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(0), tTemp)); in iselInt64Expr_wrk()
2377 addInstr(env, X86Instr_CMov32(Xcc_NZ, X86RM_Reg(tTemp), tHi)); in iselInt64Expr_wrk()
2388 HReg rf = iselDblExpr(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2389 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2390 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2406 sub_from_esp(env, 8); in iselInt64Expr_wrk()
2409 set_FPU_rounding_mode( env, e->Iex.Binop.arg1 ); in iselInt64Expr_wrk()
2412 addInstr(env, X86Instr_FpLdStI(False/*store*/, 8, rf, zero_esp)); in iselInt64Expr_wrk()
2416 addInstr(env, X86Instr_Alu32R( in iselInt64Expr_wrk()
2418 addInstr(env, X86Instr_Alu32R( in iselInt64Expr_wrk()
2422 set_FPU_rounding_default( env ); in iselInt64Expr_wrk()
2425 add_to_esp(env, 8); in iselInt64Expr_wrk()
2538 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2539 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2540 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2541 addInstr(env, X86Instr_Push(X86RMI_Reg(yHi))); in iselInt64Expr_wrk()
2542 addInstr(env, X86Instr_Push(X86RMI_Reg(yLo))); in iselInt64Expr_wrk()
2543 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2544 addInstr(env, X86Instr_Push(X86RMI_Reg(xHi))); in iselInt64Expr_wrk()
2545 addInstr(env, X86Instr_Push(X86RMI_Reg(xLo))); in iselInt64Expr_wrk()
2546 addInstr(env, X86Instr_Call( Xcc_ALWAYS, (Addr32)fn, in iselInt64Expr_wrk()
2548 add_to_esp(env, 4*4); in iselInt64Expr_wrk()
2549 addInstr(env, mk_iMOVsd_RR(hregX86_EDX(), tHi)); in iselInt64Expr_wrk()
2550 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), tLo)); in iselInt64Expr_wrk()
2579 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2580 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2581 X86RMI* y = iselIntExpr_RMI(env, e->Iex.Binop.arg2); in iselInt64Expr_wrk()
2582 addInstr(env, X86Instr_Push(y)); in iselInt64Expr_wrk()
2583 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1); in iselInt64Expr_wrk()
2584 addInstr(env, X86Instr_Push(X86RMI_Reg(xHi))); in iselInt64Expr_wrk()
2585 addInstr(env, X86Instr_Push(X86RMI_Reg(xLo))); in iselInt64Expr_wrk()
2586 addInstr(env, X86Instr_Call( Xcc_ALWAYS, (Addr32)fn, in iselInt64Expr_wrk()
2588 add_to_esp(env, 3*4); in iselInt64Expr_wrk()
2589 addInstr(env, mk_iMOVsd_RR(hregX86_EDX(), tHi)); in iselInt64Expr_wrk()
2590 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), tLo)); in iselInt64Expr_wrk()
2608 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2609 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2610 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2611 addInstr(env, mk_iMOVsd_RR(src,tHi)); in iselInt64Expr_wrk()
2612 addInstr(env, mk_iMOVsd_RR(src,tLo)); in iselInt64Expr_wrk()
2613 addInstr(env, X86Instr_Sh32(Xsh_SAR, 31, tHi)); in iselInt64Expr_wrk()
2621 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2622 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2623 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2624 addInstr(env, mk_iMOVsd_RR(src,tLo)); in iselInt64Expr_wrk()
2625 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(0), tHi)); in iselInt64Expr_wrk()
2633 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2634 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2635 HReg src = iselIntExpr_R(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2636 addInstr(env, mk_iMOVsd_RR(src,tLo)); in iselInt64Expr_wrk()
2637 addInstr(env, X86Instr_Alu32R(Xalu_AND, in iselInt64Expr_wrk()
2639 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(0), tHi)); in iselInt64Expr_wrk()
2649 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2650 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2651 HReg vec = iselVecExpr(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2655 sub_from_esp(env, 16); in iselInt64Expr_wrk()
2656 addInstr(env, X86Instr_SseLdSt(False/*store*/, vec, esp0)); in iselInt64Expr_wrk()
2657 addInstr(env, X86Instr_Alu32R( Xalu_MOV, in iselInt64Expr_wrk()
2659 addInstr(env, X86Instr_Alu32R( Xalu_MOV, in iselInt64Expr_wrk()
2661 add_to_esp(env, 16); in iselInt64Expr_wrk()
2669 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2670 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2671 X86CondCode cond = iselCondCode(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2672 addInstr(env, X86Instr_Set32(cond,tLo)); in iselInt64Expr_wrk()
2673 addInstr(env, X86Instr_Sh32(Xsh_SHL, 31, tLo)); in iselInt64Expr_wrk()
2674 addInstr(env, X86Instr_Sh32(Xsh_SAR, 31, tLo)); in iselInt64Expr_wrk()
2675 addInstr(env, mk_iMOVsd_RR(tLo, tHi)); in iselInt64Expr_wrk()
2683 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2684 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2686 iselInt64Expr(&sHi, &sLo, env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2687 addInstr(env, mk_iMOVsd_RR(sHi, tHi)); in iselInt64Expr_wrk()
2688 addInstr(env, mk_iMOVsd_RR(sLo, tLo)); in iselInt64Expr_wrk()
2689 addInstr(env, X86Instr_Unary32(Xun_NOT,tHi)); in iselInt64Expr_wrk()
2690 addInstr(env, X86Instr_Unary32(Xun_NOT,tLo)); in iselInt64Expr_wrk()
2699 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2700 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2702 iselInt64Expr(&yHi, &yLo, env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2704 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(0), tLo)); in iselInt64Expr_wrk()
2705 addInstr(env, X86Instr_Alu32R(Xalu_SUB, X86RMI_Reg(yLo), tLo)); in iselInt64Expr_wrk()
2707 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Imm(0), tHi)); in iselInt64Expr_wrk()
2708 addInstr(env, X86Instr_Alu32R(Xalu_SBB, X86RMI_Reg(yHi), tHi)); in iselInt64Expr_wrk()
2712 addInstr(env, X86Instr_Alu32R(Xalu_OR, X86RMI_Reg(yLo), tLo)); in iselInt64Expr_wrk()
2713 addInstr(env, X86Instr_Alu32R(Xalu_OR, X86RMI_Reg(yHi), tHi)); in iselInt64Expr_wrk()
2730 HReg xBoth = newVRegI(env); in iselInt64Expr_wrk()
2731 HReg merged = newVRegI(env); in iselInt64Expr_wrk()
2732 HReg tmp2 = newVRegI(env); in iselInt64Expr_wrk()
2734 iselInt64Expr(&xHi,&xLo, env, mi.bindee[0]); in iselInt64Expr_wrk()
2735 addInstr(env, mk_iMOVsd_RR(xHi,xBoth)); in iselInt64Expr_wrk()
2736 addInstr(env, X86Instr_Alu32R(Xalu_OR, in iselInt64Expr_wrk()
2739 iselInt64Expr(&yHi,&yLo, env, mi.bindee[1]); in iselInt64Expr_wrk()
2740 addInstr(env, mk_iMOVsd_RR(yHi,merged)); in iselInt64Expr_wrk()
2741 addInstr(env, X86Instr_Alu32R(Xalu_OR, in iselInt64Expr_wrk()
2743 addInstr(env, X86Instr_Alu32R(Xalu_OR, in iselInt64Expr_wrk()
2747 addInstr(env, mk_iMOVsd_RR(merged,tmp2)); in iselInt64Expr_wrk()
2748 addInstr(env, X86Instr_Unary32(Xun_NEG,tmp2)); in iselInt64Expr_wrk()
2749 addInstr(env, X86Instr_Alu32R(Xalu_OR, in iselInt64Expr_wrk()
2751 addInstr(env, X86Instr_Sh32(Xsh_SAR, 31, tmp2)); in iselInt64Expr_wrk()
2758 HReg tmp1 = newVRegI(env); in iselInt64Expr_wrk()
2759 HReg tmp2 = newVRegI(env); in iselInt64Expr_wrk()
2761 iselInt64Expr(&srcHi, &srcLo, env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2763 addInstr(env, mk_iMOVsd_RR(srcHi,tmp1)); in iselInt64Expr_wrk()
2764 addInstr(env, X86Instr_Alu32R(Xalu_OR, in iselInt64Expr_wrk()
2767 addInstr(env, mk_iMOVsd_RR(tmp1,tmp2)); in iselInt64Expr_wrk()
2768 addInstr(env, X86Instr_Unary32(Xun_NEG,tmp2)); in iselInt64Expr_wrk()
2769 addInstr(env, X86Instr_Alu32R(Xalu_OR, in iselInt64Expr_wrk()
2771 addInstr(env, X86Instr_Sh32(Xsh_SAR, 31, tmp2)); in iselInt64Expr_wrk()
2782 HReg rf = iselDblExpr(env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2783 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2784 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2788 set_FPU_rounding_default(env); in iselInt64Expr_wrk()
2790 sub_from_esp(env, 8); in iselInt64Expr_wrk()
2792 addInstr(env, in iselInt64Expr_wrk()
2795 addInstr(env, in iselInt64Expr_wrk()
2798 addInstr(env, in iselInt64Expr_wrk()
2801 add_to_esp(env, 8); in iselInt64Expr_wrk()
2820 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2821 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2822 iselInt64Expr(&xHi, &xLo, env, e->Iex.Unop.arg); in iselInt64Expr_wrk()
2823 addInstr(env, X86Instr_Push(X86RMI_Reg(xHi))); in iselInt64Expr_wrk()
2824 addInstr(env, X86Instr_Push(X86RMI_Reg(xLo))); in iselInt64Expr_wrk()
2825 addInstr(env, X86Instr_Call( Xcc_ALWAYS, (Addr32)fn, in iselInt64Expr_wrk()
2827 add_to_esp(env, 2*4); in iselInt64Expr_wrk()
2828 addInstr(env, mk_iMOVsd_RR(hregX86_EDX(), tHi)); in iselInt64Expr_wrk()
2829 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), tLo)); in iselInt64Expr_wrk()
2843 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
2844 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
2849 doHelperCall( &addToSp, &rloc, env, NULL/*guard*/, in iselInt64Expr_wrk()
2857 addInstr(env, mk_iMOVsd_RR(hregX86_EDX(), tHi)); in iselInt64Expr_wrk()
2858 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), tLo)); in iselInt64Expr_wrk()
2876 static HReg iselFltExpr ( ISelEnv* env, const IRExpr* e ) in iselFltExpr() argument
2878 HReg r = iselFltExpr_wrk( env, e ); in iselFltExpr()
2888 static HReg iselFltExpr_wrk ( ISelEnv* env, const IRExpr* e ) in iselFltExpr_wrk() argument
2890 IRType ty = typeOfIRExpr(env->type_env,e); in iselFltExpr_wrk()
2894 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselFltExpr_wrk()
2899 HReg res = newVRegF(env); in iselFltExpr_wrk()
2901 am = iselIntExpr_AMode(env, e->Iex.Load.addr); in iselFltExpr_wrk()
2902 addInstr(env, X86Instr_FpLdSt(True/*load*/, 4, res, am)); in iselFltExpr_wrk()
2911 HReg dst = newVRegF(env); in iselFltExpr_wrk()
2912 HReg src = iselDblExpr(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
2913 set_FPU_rounding_mode( env, e->Iex.Binop.arg1 ); in iselFltExpr_wrk()
2914 addInstr(env, X86Instr_Fp64to32(src,dst)); in iselFltExpr_wrk()
2915 set_FPU_rounding_default( env ); in iselFltExpr_wrk()
2922 HReg res = newVRegF(env); in iselFltExpr_wrk()
2923 addInstr(env, X86Instr_FpLdSt( True/*load*/, 4, res, am )); in iselFltExpr_wrk()
2931 HReg dst = newVRegF(env); in iselFltExpr_wrk()
2932 X86RMI* rmi = iselIntExpr_RMI(env, e->Iex.Unop.arg); in iselFltExpr_wrk()
2934 addInstr(env, X86Instr_Push(rmi)); in iselFltExpr_wrk()
2935 addInstr(env, X86Instr_FpLdSt( in iselFltExpr_wrk()
2938 add_to_esp(env, 4); in iselFltExpr_wrk()
2943 HReg rf = iselFltExpr(env, e->Iex.Binop.arg2); in iselFltExpr_wrk()
2944 HReg dst = newVRegF(env); in iselFltExpr_wrk()
2950 set_FPU_rounding_mode( env, e->Iex.Binop.arg1 ); in iselFltExpr_wrk()
2953 addInstr(env, X86Instr_FpUnary(Xfp_ROUND, rf, dst)); in iselFltExpr_wrk()
2956 set_FPU_rounding_default( env ); in iselFltExpr_wrk()
2993 static HReg iselDblExpr ( ISelEnv* env, const IRExpr* e ) in iselDblExpr() argument
2995 HReg r = iselDblExpr_wrk( env, e ); in iselDblExpr()
3005 static HReg iselDblExpr_wrk ( ISelEnv* env, const IRExpr* e ) in iselDblExpr_wrk() argument
3007 IRType ty = typeOfIRExpr(env->type_env,e); in iselDblExpr_wrk()
3012 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselDblExpr_wrk()
3017 HReg freg = newVRegF(env); in iselDblExpr_wrk()
3032 addInstr(env, X86Instr_Push(X86RMI_Imm(u.u32x2[1]))); in iselDblExpr_wrk()
3033 addInstr(env, X86Instr_Push(X86RMI_Imm(u.u32x2[0]))); in iselDblExpr_wrk()
3034 addInstr(env, X86Instr_FpLdSt(True/*load*/, 8, freg, in iselDblExpr_wrk()
3036 add_to_esp(env, 8); in iselDblExpr_wrk()
3042 HReg res = newVRegF(env); in iselDblExpr_wrk()
3044 am = iselIntExpr_AMode(env, e->Iex.Load.addr); in iselDblExpr_wrk()
3045 addInstr(env, X86Instr_FpLdSt(True/*load*/, 8, res, am)); in iselDblExpr_wrk()
3052 HReg res = newVRegF(env); in iselDblExpr_wrk()
3053 addInstr(env, X86Instr_FpLdSt( True/*load*/, 8, res, am )); in iselDblExpr_wrk()
3060 env, e->Iex.GetI.descr, in iselDblExpr_wrk()
3062 HReg res = newVRegF(env); in iselDblExpr_wrk()
3063 addInstr(env, X86Instr_FpLdSt( True/*load*/, 8, res, am )); in iselDblExpr_wrk()
3084 HReg res = newVRegF(env); in iselDblExpr_wrk()
3085 HReg srcL = iselDblExpr(env, triop->arg2); in iselDblExpr_wrk()
3086 HReg srcR = iselDblExpr(env, triop->arg3); in iselDblExpr_wrk()
3089 addInstr(env, X86Instr_FpBinary(fpop,srcL,srcR,res)); in iselDblExpr_wrk()
3092 roundToF64(env, res); in iselDblExpr_wrk()
3098 HReg rf = iselDblExpr(env, e->Iex.Binop.arg2); in iselDblExpr_wrk()
3099 HReg dst = newVRegF(env); in iselDblExpr_wrk()
3105 set_FPU_rounding_mode( env, e->Iex.Binop.arg1 ); in iselDblExpr_wrk()
3108 addInstr(env, X86Instr_FpUnary(Xfp_ROUND, rf, dst)); in iselDblExpr_wrk()
3111 set_FPU_rounding_default( env ); in iselDblExpr_wrk()
3117 HReg dst = newVRegF(env); in iselDblExpr_wrk()
3119 iselInt64Expr( &rHi, &rLo, env, e->Iex.Binop.arg2); in iselDblExpr_wrk()
3120 addInstr(env, X86Instr_Push(X86RMI_Reg(rHi))); in iselDblExpr_wrk()
3121 addInstr(env, X86Instr_Push(X86RMI_Reg(rLo))); in iselDblExpr_wrk()
3124 set_FPU_rounding_mode( env, e->Iex.Binop.arg1 ); in iselDblExpr_wrk()
3126 addInstr(env, X86Instr_FpLdStI( in iselDblExpr_wrk()
3131 set_FPU_rounding_default( env ); in iselDblExpr_wrk()
3133 add_to_esp(env, 8); in iselDblExpr_wrk()
3148 HReg res = newVRegF(env); in iselDblExpr_wrk()
3149 HReg src = iselDblExpr(env, e->Iex.Binop.arg2); in iselDblExpr_wrk()
3157 addInstr(env, X86Instr_FpUnary(fpop,src,res)); in iselDblExpr_wrk()
3160 roundToF64(env, res); in iselDblExpr_wrk()
3173 HReg res = newVRegF(env); in iselDblExpr_wrk()
3174 HReg src = iselDblExpr(env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3175 addInstr(env, X86Instr_FpUnary(fpop,src,res)); in iselDblExpr_wrk()
3176 /* No need to do roundToF64(env,res) for Xfp_NEG or Xfp_ABS, in iselDblExpr_wrk()
3185 HReg dst = newVRegF(env); in iselDblExpr_wrk()
3186 HReg ri = iselIntExpr_R(env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3187 addInstr(env, X86Instr_Push(X86RMI_Reg(ri))); in iselDblExpr_wrk()
3188 set_FPU_rounding_default(env); in iselDblExpr_wrk()
3189 addInstr(env, X86Instr_FpLdStI( in iselDblExpr_wrk()
3192 add_to_esp(env, 4); in iselDblExpr_wrk()
3198 HReg dst = newVRegF(env); in iselDblExpr_wrk()
3200 iselInt64Expr( &rHi, &rLo, env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3202 set_FPU_rounding_default(env); in iselDblExpr_wrk()
3203 addInstr(env, X86Instr_Push(X86RMI_Reg(rHi))); in iselDblExpr_wrk()
3204 addInstr(env, X86Instr_Push(X86RMI_Reg(rLo))); in iselDblExpr_wrk()
3205 addInstr(env, X86Instr_FpLdSt( in iselDblExpr_wrk()
3208 add_to_esp(env, 8); in iselDblExpr_wrk()
3213 HReg res = iselFltExpr(env, e->Iex.Unop.arg); in iselDblExpr_wrk()
3224 && typeOfIRExpr(env->type_env,e->Iex.ITE.cond) == Ity_I1) { in iselDblExpr_wrk()
3225 HReg r1 = iselDblExpr(env, e->Iex.ITE.iftrue); in iselDblExpr_wrk()
3226 HReg r0 = iselDblExpr(env, e->Iex.ITE.iffalse); in iselDblExpr_wrk()
3227 HReg dst = newVRegF(env); in iselDblExpr_wrk()
3228 addInstr(env, X86Instr_FpUnary(Xfp_MOV,r1,dst)); in iselDblExpr_wrk()
3229 X86CondCode cc = iselCondCode(env, e->Iex.ITE.cond); in iselDblExpr_wrk()
3230 addInstr(env, X86Instr_FpCMov(cc ^ 1, r0, dst)); in iselDblExpr_wrk()
3244 static HReg iselVecExpr ( ISelEnv* env, const IRExpr* e ) in iselVecExpr() argument
3246 HReg r = iselVecExpr_wrk( env, e ); in iselVecExpr()
3257 static HReg iselVecExpr_wrk ( ISelEnv* env, const IRExpr* e ) in iselVecExpr_wrk() argument
3261 do { if (env->hwcaps == 0/*baseline, no sse*/ \ in iselVecExpr_wrk()
3262 || env->hwcaps == VEX_HWCAPS_X86_MMXEXT /*Integer SSE*/) \ in iselVecExpr_wrk()
3267 do { if (0 == (env->hwcaps & VEX_HWCAPS_X86_SSE2)) \ in iselVecExpr_wrk()
3272 (env->hwcaps & VEX_HWCAPS_X86_SSE2) in iselVecExpr_wrk()
3278 IRType ty = typeOfIRExpr(env->type_env,e); in iselVecExpr_wrk()
3285 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselVecExpr_wrk()
3289 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3290 addInstr(env, X86Instr_SseLdSt( in iselVecExpr_wrk()
3300 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3301 X86AMode* am = iselIntExpr_AMode(env, e->Iex.Load.addr); in iselVecExpr_wrk()
3302 addInstr(env, X86Instr_SseLdSt( True/*load*/, dst, am )); in iselVecExpr_wrk()
3307 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3309 addInstr(env, X86Instr_SseConst(e->Iex.Const.con->Ico.V128, dst)); in iselVecExpr_wrk()
3322 X86AMode* am = iselIntExpr_AMode(env, mi.bindee[0]); in iselVecExpr_wrk()
3323 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3324 addInstr(env, X86Instr_SseLdzLO(8, dst, am)); in iselVecExpr_wrk()
3332 HReg arg = iselVecExpr(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3333 return do_sse_Not128(env, arg); in iselVecExpr_wrk()
3352 HReg arg = iselVecExpr(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3353 HReg tmp = newVRegV(env); in iselVecExpr_wrk()
3354 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3356 addInstr(env, X86Instr_SseReRg(Xsse_XOR, tmp, tmp)); in iselVecExpr_wrk()
3357 addInstr(env, X86Instr_SseReRg(Xsse_CMPEQ32, arg, tmp)); in iselVecExpr_wrk()
3358 tmp = do_sse_Not128(env, tmp); in iselVecExpr_wrk()
3359 addInstr(env, X86Instr_SseShuf(0xB1, tmp, dst)); in iselVecExpr_wrk()
3360 addInstr(env, X86Instr_SseReRg(Xsse_OR, tmp, dst)); in iselVecExpr_wrk()
3375 HReg arg = iselVecExpr(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3376 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3377 HReg r32 = newVRegI(env); in iselVecExpr_wrk()
3378 sub_from_esp(env, 16); in iselVecExpr_wrk()
3379 addInstr(env, X86Instr_SseLdSt(False/*store*/, arg, esp0)); in iselVecExpr_wrk()
3382 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Mem(am), r32)); in iselVecExpr_wrk()
3383 addInstr(env, X86Instr_Unary32(Xun_NEG, r32)); in iselVecExpr_wrk()
3384 addInstr(env, X86Instr_Alu32R(Xalu_SBB, X86RMI_Reg(r32), r32)); in iselVecExpr_wrk()
3385 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(r32), am)); in iselVecExpr_wrk()
3387 addInstr(env, X86Instr_SseLdSt(True/*load*/, dst, esp0)); in iselVecExpr_wrk()
3388 add_to_esp(env, 16); in iselVecExpr_wrk()
3396 HReg vec0 = newVRegV(env); in iselVecExpr_wrk()
3397 HReg vec1 = newVRegV(env); in iselVecExpr_wrk()
3398 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3403 addInstr(env, X86Instr_SseReRg(Xsse_XOR, vec0, vec0)); in iselVecExpr_wrk()
3404 addInstr(env, mk_vMOVsd_RR(vec0, vec1)); in iselVecExpr_wrk()
3405 addInstr(env, X86Instr_Sse32Fx4(Xsse_CMPEQF, vec1, vec1)); in iselVecExpr_wrk()
3408 arg = iselVecExpr(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3410 addInstr(env, mk_vMOVsd_RR(arg, dst)); in iselVecExpr_wrk()
3412 addInstr(env, X86Instr_SseReRg(cmpOp, vec0, dst)); in iselVecExpr_wrk()
3414 addInstr(env, X86Instr_SseReRg(Xsse_XOR, vec1, dst)); in iselVecExpr_wrk()
3422 HReg arg = iselVecExpr(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3423 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3424 addInstr(env, X86Instr_Sse32Fx4(op, arg, dst)); in iselVecExpr_wrk()
3439 HReg arg = iselVecExpr(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3440 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3441 addInstr(env, mk_vMOVsd_RR(arg, dst)); in iselVecExpr_wrk()
3442 addInstr(env, X86Instr_Sse32FLo(op, arg, dst)); in iselVecExpr_wrk()
3455 HReg arg = iselVecExpr(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3456 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3458 addInstr(env, mk_vMOVsd_RR(arg, dst)); in iselVecExpr_wrk()
3459 addInstr(env, X86Instr_Sse64FLo(op, arg, dst)); in iselVecExpr_wrk()
3464 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3466 X86RMI* rmi = iselIntExpr_RMI(env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3467 addInstr(env, X86Instr_Push(rmi)); in iselVecExpr_wrk()
3468 addInstr(env, X86Instr_SseLdzLO(4, dst, esp0)); in iselVecExpr_wrk()
3469 add_to_esp(env, 4); in iselVecExpr_wrk()
3475 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3477 iselInt64Expr(&rHi, &rLo, env, e->Iex.Unop.arg); in iselVecExpr_wrk()
3478 addInstr(env, X86Instr_Push(X86RMI_Reg(rHi))); in iselVecExpr_wrk()
3479 addInstr(env, X86Instr_Push(X86RMI_Reg(rLo))); in iselVecExpr_wrk()
3480 addInstr(env, X86Instr_SseLdzLO(8, dst, esp0)); in iselVecExpr_wrk()
3481 add_to_esp(env, 8); in iselVecExpr_wrk()
3498 HReg arg = iselVecExpr(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3499 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3502 addInstr(env, (e->Iex.Binop.op == Iop_Sqrt64Fx2 in iselVecExpr_wrk()
3509 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3510 HReg srcV = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3511 HReg srcI = iselIntExpr_R(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3513 sub_from_esp(env, 16); in iselVecExpr_wrk()
3514 addInstr(env, X86Instr_SseLdSt(False/*store*/, srcV, esp0)); in iselVecExpr_wrk()
3515 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(srcI), esp0)); in iselVecExpr_wrk()
3516 addInstr(env, X86Instr_SseLdSt(True/*load*/, dst, esp0)); in iselVecExpr_wrk()
3517 add_to_esp(env, 16); in iselVecExpr_wrk()
3522 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3523 HReg srcV = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3527 iselInt64Expr(&srcIhi, &srcIlo, env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3528 sub_from_esp(env, 16); in iselVecExpr_wrk()
3529 addInstr(env, X86Instr_SseLdSt(False/*store*/, srcV, esp0)); in iselVecExpr_wrk()
3530 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(srcIlo), esp0)); in iselVecExpr_wrk()
3531 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(srcIhi), esp4)); in iselVecExpr_wrk()
3532 addInstr(env, X86Instr_SseLdSt(True/*load*/, dst, esp0)); in iselVecExpr_wrk()
3533 add_to_esp(env, 16); in iselVecExpr_wrk()
3543 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3545 sub_from_esp(env, 16); in iselVecExpr_wrk()
3547 iselInt64Expr(&r1, &r0, env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3548 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(r0), esp0)); in iselVecExpr_wrk()
3549 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(r1), esp4)); in iselVecExpr_wrk()
3551 iselInt64Expr(&r3, &r2, env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3552 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(r2), esp8)); in iselVecExpr_wrk()
3553 addInstr(env, X86Instr_Alu32M(Xalu_MOV, X86RI_Reg(r3), esp12)); in iselVecExpr_wrk()
3555 addInstr(env, X86Instr_SseLdSt(True/*load*/, dst, esp0)); in iselVecExpr_wrk()
3556 add_to_esp(env, 16); in iselVecExpr_wrk()
3568 HReg argL = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3569 HReg argR = iselVecExpr(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3570 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3571 addInstr(env, mk_vMOVsd_RR(argL, dst)); in iselVecExpr_wrk()
3572 addInstr(env, X86Instr_Sse32Fx4(op, argR, dst)); in iselVecExpr_wrk()
3584 HReg argL = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3585 HReg argR = iselVecExpr(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3586 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3588 addInstr(env, mk_vMOVsd_RR(argL, dst)); in iselVecExpr_wrk()
3589 addInstr(env, X86Instr_Sse64Fx2(op, argR, dst)); in iselVecExpr_wrk()
3604 HReg argL = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3605 HReg argR = iselVecExpr(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3606 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3607 addInstr(env, mk_vMOVsd_RR(argL, dst)); in iselVecExpr_wrk()
3608 addInstr(env, X86Instr_Sse32FLo(op, argR, dst)); in iselVecExpr_wrk()
3623 HReg argL = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3624 HReg argR = iselVecExpr(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3625 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3627 addInstr(env, mk_vMOVsd_RR(argL, dst)); in iselVecExpr_wrk()
3628 addInstr(env, X86Instr_Sse64FLo(op, argR, dst)); in iselVecExpr_wrk()
3692 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3693 HReg arg2 = iselVecExpr(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3694 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3698 addInstr(env, mk_vMOVsd_RR(arg2, dst)); in iselVecExpr_wrk()
3699 addInstr(env, X86Instr_SseReRg(op, arg1, dst)); in iselVecExpr_wrk()
3701 addInstr(env, mk_vMOVsd_RR(arg1, dst)); in iselVecExpr_wrk()
3702 addInstr(env, X86Instr_SseReRg(op, arg2, dst)); in iselVecExpr_wrk()
3716 HReg greg = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3717 X86RMI* rmi = iselIntExpr_RMI(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3719 HReg ereg = newVRegV(env); in iselVecExpr_wrk()
3720 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3722 addInstr(env, X86Instr_Push(X86RMI_Imm(0))); in iselVecExpr_wrk()
3723 addInstr(env, X86Instr_Push(X86RMI_Imm(0))); in iselVecExpr_wrk()
3724 addInstr(env, X86Instr_Push(X86RMI_Imm(0))); in iselVecExpr_wrk()
3725 addInstr(env, X86Instr_Push(rmi)); in iselVecExpr_wrk()
3726 addInstr(env, X86Instr_SseLdSt(True/*load*/, ereg, esp0)); in iselVecExpr_wrk()
3727 addInstr(env, mk_vMOVsd_RR(greg, dst)); in iselVecExpr_wrk()
3728 addInstr(env, X86Instr_SseReRg(op, ereg, dst)); in iselVecExpr_wrk()
3729 add_to_esp(env, 16); in iselVecExpr_wrk()
3743 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3744 HReg argL = iselVecExpr(env, e->Iex.Binop.arg1); in iselVecExpr_wrk()
3745 HReg argR = iselVecExpr(env, e->Iex.Binop.arg2); in iselVecExpr_wrk()
3746 HReg argp = newVRegI(env); in iselVecExpr_wrk()
3748 sub_from_esp(env, 112); in iselVecExpr_wrk()
3750 addInstr(env, X86Instr_Lea32(X86AMode_IR(48, hregX86_ESP()), in iselVecExpr_wrk()
3753 addInstr(env, X86Instr_Alu32R(Xalu_AND, in iselVecExpr_wrk()
3761 addInstr(env, X86Instr_Lea32(X86AMode_IR(0, argp), in iselVecExpr_wrk()
3763 addInstr(env, X86Instr_Lea32(X86AMode_IR(16, argp), in iselVecExpr_wrk()
3765 addInstr(env, X86Instr_Lea32(X86AMode_IR(32, argp), in iselVecExpr_wrk()
3771 addInstr(env, X86Instr_SseLdSt(False/*!isLoad*/, argL, in iselVecExpr_wrk()
3773 addInstr(env, X86Instr_SseLdSt(False/*!isLoad*/, argR, in iselVecExpr_wrk()
3776 addInstr(env, X86Instr_Call( Xcc_ALWAYS, (Addr32)fn, in iselVecExpr_wrk()
3780 addInstr(env, X86Instr_SseLdSt(True/*isLoad*/, dst, in iselVecExpr_wrk()
3783 add_to_esp(env, 112); in iselVecExpr_wrk()
3803 HReg argL = iselVecExpr(env, triop->arg2); in iselVecExpr_wrk()
3804 HReg argR = iselVecExpr(env, triop->arg3); in iselVecExpr_wrk()
3805 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3806 addInstr(env, mk_vMOVsd_RR(argL, dst)); in iselVecExpr_wrk()
3809 addInstr(env, X86Instr_Sse32Fx4(op, argR, dst)); in iselVecExpr_wrk()
3819 HReg argL = iselVecExpr(env, triop->arg2); in iselVecExpr_wrk()
3820 HReg argR = iselVecExpr(env, triop->arg3); in iselVecExpr_wrk()
3821 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3823 addInstr(env, mk_vMOVsd_RR(argL, dst)); in iselVecExpr_wrk()
3826 addInstr(env, X86Instr_Sse64Fx2(op, argR, dst)); in iselVecExpr_wrk()
3837 HReg r1 = iselVecExpr(env, e->Iex.ITE.iftrue); in iselVecExpr_wrk()
3838 HReg r0 = iselVecExpr(env, e->Iex.ITE.iffalse); in iselVecExpr_wrk()
3839 HReg dst = newVRegV(env); in iselVecExpr_wrk()
3840 addInstr(env, mk_vMOVsd_RR(r1,dst)); in iselVecExpr_wrk()
3841 X86CondCode cc = iselCondCode(env, e->Iex.ITE.cond); in iselVecExpr_wrk()
3842 addInstr(env, X86Instr_SseCMov(cc ^ 1, r0, dst)); in iselVecExpr_wrk()
3848 LibVEX_ppVexHwCaps(VexArchX86,env->hwcaps)); in iselVecExpr_wrk()
3862 static void iselStmt ( ISelEnv* env, IRStmt* stmt ) in iselStmt() argument
3874 IRType tya = typeOfIRExpr(env->type_env, stmt->Ist.Store.addr); in iselStmt()
3875 IRType tyd = typeOfIRExpr(env->type_env, stmt->Ist.Store.data); in iselStmt()
3882 X86AMode* am = iselIntExpr_AMode(env, stmt->Ist.Store.addr); in iselStmt()
3883 X86RI* ri = iselIntExpr_RI(env, stmt->Ist.Store.data); in iselStmt()
3884 addInstr(env, X86Instr_Alu32M(Xalu_MOV,ri,am)); in iselStmt()
3888 X86AMode* am = iselIntExpr_AMode(env, stmt->Ist.Store.addr); in iselStmt()
3889 HReg r = iselIntExpr_R(env, stmt->Ist.Store.data); in iselStmt()
3890 addInstr(env, X86Instr_Store( toUChar(tyd==Ity_I8 ? 1 : 2), in iselStmt()
3895 X86AMode* am = iselIntExpr_AMode(env, stmt->Ist.Store.addr); in iselStmt()
3896 HReg r = iselDblExpr(env, stmt->Ist.Store.data); in iselStmt()
3897 addInstr(env, X86Instr_FpLdSt(False/*store*/, 8, r, am)); in iselStmt()
3901 X86AMode* am = iselIntExpr_AMode(env, stmt->Ist.Store.addr); in iselStmt()
3902 HReg r = iselFltExpr(env, stmt->Ist.Store.data); in iselStmt()
3903 addInstr(env, X86Instr_FpLdSt(False/*store*/, 4, r, am)); in iselStmt()
3908 iselInt64Expr(&vHi, &vLo, env, stmt->Ist.Store.data); in iselStmt()
3909 rA = iselIntExpr_R(env, stmt->Ist.Store.addr); in iselStmt()
3910 addInstr(env, X86Instr_Alu32M( in iselStmt()
3912 addInstr(env, X86Instr_Alu32M( in iselStmt()
3917 X86AMode* am = iselIntExpr_AMode(env, stmt->Ist.Store.addr); in iselStmt()
3918 HReg r = iselVecExpr(env, stmt->Ist.Store.data); in iselStmt()
3919 addInstr(env, X86Instr_SseLdSt(False/*store*/, r, am)); in iselStmt()
3927 IRType ty = typeOfIRExpr(env->type_env, stmt->Ist.Put.data); in iselStmt()
3931 X86RI* ri = iselIntExpr_RI(env, stmt->Ist.Put.data); in iselStmt()
3932 addInstr(env, in iselStmt()
3941 HReg r = iselIntExpr_R(env, stmt->Ist.Put.data); in iselStmt()
3942 addInstr(env, X86Instr_Store( in iselStmt()
3953 iselInt64Expr(&vHi, &vLo, env, stmt->Ist.Put.data); in iselStmt()
3954 addInstr(env, X86Instr_Alu32M( Xalu_MOV, X86RI_Reg(vLo), am )); in iselStmt()
3955 addInstr(env, X86Instr_Alu32M( Xalu_MOV, X86RI_Reg(vHi), am4 )); in iselStmt()
3959 HReg vec = iselVecExpr(env, stmt->Ist.Put.data); in iselStmt()
3961 addInstr(env, X86Instr_SseLdSt(False/*store*/, vec, am)); in iselStmt()
3965 HReg f32 = iselFltExpr(env, stmt->Ist.Put.data); in iselStmt()
3967 set_FPU_rounding_default(env); /* paranoia */ in iselStmt()
3968 addInstr(env, X86Instr_FpLdSt( False/*store*/, 4, f32, am )); in iselStmt()
3972 HReg f64 = iselDblExpr(env, stmt->Ist.Put.data); in iselStmt()
3974 set_FPU_rounding_default(env); /* paranoia */ in iselStmt()
3975 addInstr(env, X86Instr_FpLdSt( False/*store*/, 8, f64, am )); in iselStmt()
3987 env, puti->descr, in iselStmt()
3990 IRType ty = typeOfIRExpr(env->type_env, puti->data); in iselStmt()
3992 HReg val = iselDblExpr(env, puti->data); in iselStmt()
3993 addInstr(env, X86Instr_FpLdSt( False/*store*/, 8, val, am )); in iselStmt()
3997 HReg r = iselIntExpr_R(env, puti->data); in iselStmt()
3998 addInstr(env, X86Instr_Store( 1, r, am )); in iselStmt()
4002 HReg r = iselIntExpr_R(env, puti->data); in iselStmt()
4003 addInstr(env, X86Instr_Alu32M( Xalu_MOV, X86RI_Reg(r), am )); in iselStmt()
4009 iselInt64Expr(&rHi, &rLo, env, puti->data); in iselStmt()
4010 addInstr(env, X86Instr_Alu32M( Xalu_MOV, X86RI_Reg(rLo), am )); in iselStmt()
4011 addInstr(env, X86Instr_Alu32M( Xalu_MOV, X86RI_Reg(rHi), am4 )); in iselStmt()
4020 IRType ty = typeOfIRTemp(env->type_env, tmp); in iselStmt()
4031 X86AMode* am = iselIntExpr_AMode(env, stmt->Ist.WrTmp.data); in iselStmt()
4032 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
4038 addInstr(env, X86Instr_Alu32R(Xalu_MOV, X86RMI_Reg(src), dst)); in iselStmt()
4040 addInstr(env, X86Instr_Lea32(am,dst)); in iselStmt()
4046 X86RMI* rmi = iselIntExpr_RMI(env, stmt->Ist.WrTmp.data); in iselStmt()
4047 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
4048 addInstr(env, X86Instr_Alu32R(Xalu_MOV,rmi,dst)); in iselStmt()
4053 iselInt64Expr(&rHi,&rLo, env, stmt->Ist.WrTmp.data); in iselStmt()
4054 lookupIRTemp64( &dstHi, &dstLo, env, tmp); in iselStmt()
4055 addInstr(env, mk_iMOVsd_RR(rHi,dstHi) ); in iselStmt()
4056 addInstr(env, mk_iMOVsd_RR(rLo,dstLo) ); in iselStmt()
4060 X86CondCode cond = iselCondCode(env, stmt->Ist.WrTmp.data); in iselStmt()
4061 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
4062 addInstr(env, X86Instr_Set32(cond, dst)); in iselStmt()
4066 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
4067 HReg src = iselDblExpr(env, stmt->Ist.WrTmp.data); in iselStmt()
4068 addInstr(env, X86Instr_FpUnary(Xfp_MOV,src,dst)); in iselStmt()
4072 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
4073 HReg src = iselFltExpr(env, stmt->Ist.WrTmp.data); in iselStmt()
4074 addInstr(env, X86Instr_FpUnary(Xfp_MOV,src,dst)); in iselStmt()
4078 HReg dst = lookupIRTemp(env, tmp); in iselStmt()
4079 HReg src = iselVecExpr(env, stmt->Ist.WrTmp.data); in iselStmt()
4080 addInstr(env, mk_vMOVsd_RR(src,dst)); in iselStmt()
4093 retty = typeOfIRTemp(env->type_env, d->tmp); in iselStmt()
4112 doHelperCall( &addToSp, &rloc, env, d->guard, d->cee, retty, d->args ); in iselStmt()
4129 HReg dst = lookupIRTemp(env, d->tmp); in iselStmt()
4130 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(),dst) ); in iselStmt()
4139 lookupIRTemp64( &dstHi, &dstLo, env, d->tmp); in iselStmt()
4140 addInstr(env, mk_iMOVsd_RR(hregX86_EDX(),dstHi) ); in iselStmt()
4141 addInstr(env, mk_iMOVsd_RR(hregX86_EAX(),dstLo) ); in iselStmt()
4151 HReg dst = lookupIRTemp(env, d->tmp); in iselStmt()
4153 addInstr(env, X86Instr_SseLdSt( True/*load*/, dst, am )); in iselStmt()
4154 add_to_esp(env, addToSp); in iselStmt()
4168 addInstr(env, X86Instr_MFence(env->hwcaps)); in iselStmt()
4181 IRType ty = typeOfIRExpr(env->type_env, cas->dataLo); in iselStmt()
4183 X86AMode* am = iselIntExpr_AMode(env, cas->addr); in iselStmt()
4184 HReg rDataLo = iselIntExpr_R(env, cas->dataLo); in iselStmt()
4185 HReg rExpdLo = iselIntExpr_R(env, cas->expdLo); in iselStmt()
4186 HReg rOldLo = lookupIRTemp(env, cas->oldLo); in iselStmt()
4189 addInstr(env, mk_iMOVsd_RR(rExpdLo, rOldLo)); in iselStmt()
4190 addInstr(env, mk_iMOVsd_RR(rExpdLo, hregX86_EAX())); in iselStmt()
4191 addInstr(env, mk_iMOVsd_RR(rDataLo, hregX86_EBX())); in iselStmt()
4198 addInstr(env, X86Instr_ACAS(am, sz)); in iselStmt()
4199 addInstr(env, in iselStmt()
4206 IRType ty = typeOfIRExpr(env->type_env, cas->dataLo); in iselStmt()
4210 X86AMode* am = iselIntExpr_AMode(env, cas->addr); in iselStmt()
4211 HReg rDataHi = iselIntExpr_R(env, cas->dataHi); in iselStmt()
4212 HReg rDataLo = iselIntExpr_R(env, cas->dataLo); in iselStmt()
4213 HReg rExpdHi = iselIntExpr_R(env, cas->expdHi); in iselStmt()
4214 HReg rExpdLo = iselIntExpr_R(env, cas->expdLo); in iselStmt()
4215 HReg rOldHi = lookupIRTemp(env, cas->oldHi); in iselStmt()
4216 HReg rOldLo = lookupIRTemp(env, cas->oldLo); in iselStmt()
4219 addInstr(env, mk_iMOVsd_RR(rExpdHi, rOldHi)); in iselStmt()
4220 addInstr(env, mk_iMOVsd_RR(rExpdLo, rOldLo)); in iselStmt()
4221 addInstr(env, mk_iMOVsd_RR(rExpdHi, hregX86_EDX())); in iselStmt()
4222 addInstr(env, mk_iMOVsd_RR(rExpdLo, hregX86_EAX())); in iselStmt()
4223 addInstr(env, mk_iMOVsd_RR(rDataHi, hregX86_ECX())); in iselStmt()
4224 addInstr(env, mk_iMOVsd_RR(rDataLo, hregX86_EBX())); in iselStmt()
4225 addInstr(env, X86Instr_DACAS(am)); in iselStmt()
4226 addInstr(env, in iselStmt()
4229 addInstr(env, in iselStmt()
4252 X86CondCode cc = iselCondCode(env, stmt->Ist.Exit.guard); in iselStmt()
4258 if (env->chainingAllowed) { in iselStmt()
4263 = ((Addr32)stmt->Ist.Exit.dst->Ico.U32) > env->max_ga; in iselStmt()
4265 addInstr(env, X86Instr_XDirect(stmt->Ist.Exit.dst->Ico.U32, in iselStmt()
4271 HReg r = iselIntExpr_R(env, IRExpr_Const(stmt->Ist.Exit.dst)); in iselStmt()
4272 addInstr(env, X86Instr_XAssisted(r, amEIP, cc, Ijk_Boring)); in iselStmt()
4297 HReg r = iselIntExpr_R(env, IRExpr_Const(stmt->Ist.Exit.dst)); in iselStmt()
4298 addInstr(env, X86Instr_XAssisted(r, amEIP, cc, stmt->Ist.Exit.jk)); in iselStmt()
4321 static void iselNext ( ISelEnv* env, in iselNext() argument
4339 if (env->chainingAllowed) { in iselNext()
4344 = ((Addr32)cdst->Ico.U32) > env->max_ga; in iselNext()
4346 addInstr(env, X86Instr_XDirect(cdst->Ico.U32, in iselNext()
4353 HReg r = iselIntExpr_R(env, next); in iselNext()
4354 addInstr(env, X86Instr_XAssisted(r, amEIP, Xcc_ALWAYS, in iselNext()
4364 HReg r = iselIntExpr_R(env, next); in iselNext()
4366 if (env->chainingAllowed) { in iselNext()
4367 addInstr(env, X86Instr_XIndir(r, amEIP, Xcc_ALWAYS)); in iselNext()
4369 addInstr(env, X86Instr_XAssisted(r, amEIP, Xcc_ALWAYS, in iselNext()
4398 HReg r = iselIntExpr_R(env, next); in iselNext()
4400 addInstr(env, X86Instr_XAssisted(r, amEIP, Xcc_ALWAYS, jk)); in iselNext()
4434 ISelEnv* env; in iselSB_X86() local
4451 env = LibVEX_Alloc_inline(sizeof(ISelEnv)); in iselSB_X86()
4452 env->vreg_ctr = 0; in iselSB_X86()
4455 env->code = newHInstrArray(); in iselSB_X86()
4457 /* Copy BB's type env. */ in iselSB_X86()
4458 env->type_env = bb->tyenv; in iselSB_X86()
4462 env->n_vregmap = bb->tyenv->types_used; in iselSB_X86()
4463 env->vregmap = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_X86()
4464 env->vregmapHI = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_X86()
4467 env->chainingAllowed = chainingAllowed; in iselSB_X86()
4468 env->hwcaps = hwcaps_host; in iselSB_X86()
4469 env->max_ga = max_ga; in iselSB_X86()
4474 for (i = 0; i < env->n_vregmap; i++) { in iselSB_X86()
4489 env->vregmap[i] = hreg; in iselSB_X86()
4490 env->vregmapHI[i] = hregHI; in iselSB_X86()
4492 env->vreg_ctr = j; in iselSB_X86()
4497 addInstr(env, X86Instr_EvCheck(amCounter, amFailAddr)); in iselSB_X86()
4504 addInstr(env, X86Instr_ProfInc()); in iselSB_X86()
4509 iselStmt(env, bb->stmts[i]); in iselSB_X86()
4511 iselNext(env, bb->next, bb->jumpkind, bb->offsIP); in iselSB_X86()
4514 env->code->n_vregs = env->vreg_ctr; in iselSB_X86()
4515 return env->code; in iselSB_X86()