Lines Matching full:env

61   GPR11      if mode64: not used - calls by ptr / env ptr for some langs
302 static HReg lookupIRTemp ( ISelEnv* env, IRTemp tmp ) in lookupIRTemp() argument
305 vassert(tmp < env->n_vregmap); in lookupIRTemp()
306 return env->vregmapLo[tmp]; in lookupIRTemp()
310 ISelEnv* env, IRTemp tmp ) in lookupIRTempPair() argument
313 vassert(tmp < env->n_vregmap); in lookupIRTempPair()
314 vassert(! hregIsInvalid(env->vregmapMedLo[tmp])); in lookupIRTempPair()
315 *vrLO = env->vregmapLo[tmp]; in lookupIRTempPair()
316 *vrHI = env->vregmapMedLo[tmp]; in lookupIRTempPair()
321 HReg* vrLo, ISelEnv* env, IRTemp tmp ) in lookupIRTempQuad() argument
323 vassert(!env->mode64); in lookupIRTempQuad()
325 vassert(tmp < env->n_vregmap); in lookupIRTempQuad()
326 vassert(! hregIsInvalid(env->vregmapMedLo[tmp])); in lookupIRTempQuad()
327 *vrHi = env->vregmapHi[tmp]; in lookupIRTempQuad()
328 *vrMedHi = env->vregmapMedHi[tmp]; in lookupIRTempQuad()
329 *vrMedLo = env->vregmapMedLo[tmp]; in lookupIRTempQuad()
330 *vrLo = env->vregmapLo[tmp]; in lookupIRTempQuad()
333 static void addInstr ( ISelEnv* env, PPCInstr* instr ) in addInstr() argument
335 addHInstr(env->code, instr); in addInstr()
337 ppPPCInstr(instr, env->mode64); in addInstr()
342 static HReg newVRegI ( ISelEnv* env ) in newVRegI() argument
345 = mkHReg(True/*vreg*/, HRcGPR(env->mode64), 0/*enc*/, env->vreg_ctr); in newVRegI()
346 env->vreg_ctr++; in newVRegI()
350 static HReg newVRegF ( ISelEnv* env ) in newVRegF() argument
352 HReg reg = mkHReg(True/*vreg*/, HRcFlt64, 0/*enc*/, env->vreg_ctr); in newVRegF()
353 env->vreg_ctr++; in newVRegF()
357 static HReg newVRegV ( ISelEnv* env ) in newVRegV() argument
359 HReg reg = mkHReg(True/*vreg*/, HRcVec128, 0/*enc*/, env->vreg_ctr); in newVRegV()
360 env->vreg_ctr++; in newVRegV()
382 static HReg iselWordExpr_R_wrk ( ISelEnv* env, IRExpr* e,
384 static HReg iselWordExpr_R ( ISelEnv* env, IRExpr* e,
396 static PPCRH* iselWordExpr_RH_wrk ( ISelEnv* env,
399 static PPCRH* iselWordExpr_RH ( ISelEnv* env,
405 static PPCRI* iselWordExpr_RI_wrk ( ISelEnv* env, IRExpr* e,
407 static PPCRI* iselWordExpr_RI ( ISelEnv* env, IRExpr* e,
413 static PPCRH* iselWordExpr_RH5u_wrk ( ISelEnv* env, IRExpr* e,
415 static PPCRH* iselWordExpr_RH5u ( ISelEnv* env, IRExpr* e,
421 static PPCRH* iselWordExpr_RH6u_wrk ( ISelEnv* env, IRExpr* e,
423 static PPCRH* iselWordExpr_RH6u ( ISelEnv* env, IRExpr* e,
437 static PPCAMode* iselWordExpr_AMode_wrk ( ISelEnv* env, IRExpr* e,
440 static PPCAMode* iselWordExpr_AMode ( ISelEnv* env, IRExpr* e,
446 ISelEnv* env, IRExpr* e,
450 ISelEnv* env, IRExpr* e,
456 ISelEnv* env, IRExpr* e,
459 ISelEnv* env, IRExpr* e,
464 ISelEnv* env, IRExpr* e,
468 ISelEnv* env, IRExpr* e,
471 static PPCCondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e,
473 static PPCCondCode iselCondCode ( ISelEnv* env, IRExpr* e,
476 static HReg iselDblExpr_wrk ( ISelEnv* env, IRExpr* e,
478 static HReg iselDblExpr ( ISelEnv* env, IRExpr* e,
481 static HReg iselFltExpr_wrk ( ISelEnv* env, IRExpr* e,
483 static HReg iselFltExpr ( ISelEnv* env, IRExpr* e,
486 static HReg iselVecExpr_wrk ( ISelEnv* env, IRExpr* e,
488 static HReg iselVecExpr ( ISelEnv* env, IRExpr* e,
492 static HReg iselDfp32Expr_wrk ( ISelEnv* env, IRExpr* e,
494 static HReg iselDfp32Expr ( ISelEnv* env, IRExpr* e,
496 static HReg iselDfp64Expr_wrk ( ISelEnv* env, IRExpr* e,
498 static HReg iselDfp64Expr ( ISelEnv* env, IRExpr* e,
502 static void iselDfp128Expr_wrk ( HReg* rHi, HReg* rLo, ISelEnv* env,
504 static void iselDfp128Expr ( HReg* rHi, HReg* rLo, ISelEnv* env,
523 static void add_to_sp ( ISelEnv* env, UInt n ) in add_to_sp() argument
525 HReg sp = StackFramePtr(env->mode64); in add_to_sp()
527 addInstr(env, PPCInstr_Alu( Palu_ADD, sp, sp, in add_to_sp()
531 static void sub_from_sp ( ISelEnv* env, UInt n ) in sub_from_sp() argument
533 HReg sp = StackFramePtr(env->mode64); in sub_from_sp()
535 addInstr(env, PPCInstr_Alu( Palu_SUB, sp, sp, in sub_from_sp()
545 static HReg get_sp_aligned16 ( ISelEnv* env ) in get_sp_aligned16() argument
547 HReg r = newVRegI(env); in get_sp_aligned16()
548 HReg align16 = newVRegI(env); in get_sp_aligned16()
549 addInstr(env, mk_iMOVds_RR(r, StackFramePtr(env->mode64))); in get_sp_aligned16()
551 addInstr(env, PPCInstr_Alu( Palu_ADD, r, r, in get_sp_aligned16()
554 addInstr(env, in get_sp_aligned16()
555 PPCInstr_LI(align16, 0xFFFFFFFFFFFFFFF0ULL, env->mode64)); in get_sp_aligned16()
556 addInstr(env, PPCInstr_Alu(Palu_AND, r,r, PPCRH_Reg(align16))); in get_sp_aligned16()
563 static HReg mk_LoadRR32toFPR ( ISelEnv* env, in mk_LoadRR32toFPR() argument
566 HReg fr_dst = newVRegF(env); in mk_LoadRR32toFPR()
569 vassert(!env->mode64); in mk_LoadRR32toFPR()
573 sub_from_sp( env, 16 ); // Move SP down 16 bytes in mk_LoadRR32toFPR()
574 am_addr0 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in mk_LoadRR32toFPR()
575 am_addr1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in mk_LoadRR32toFPR()
578 addInstr(env, PPCInstr_Store( 4, am_addr0, r_srcHi, env->mode64 )); in mk_LoadRR32toFPR()
579 addInstr(env, PPCInstr_Store( 4, am_addr1, r_srcLo, env->mode64 )); in mk_LoadRR32toFPR()
582 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fr_dst, am_addr0)); in mk_LoadRR32toFPR()
584 add_to_sp( env, 16 ); // Reset SP in mk_LoadRR32toFPR()
589 static HReg mk_LoadR64toFPR ( ISelEnv* env, HReg r_src ) in mk_LoadR64toFPR() argument
591 HReg fr_dst = newVRegF(env); in mk_LoadR64toFPR()
594 vassert(env->mode64); in mk_LoadR64toFPR()
597 sub_from_sp( env, 16 ); // Move SP down 16 bytes in mk_LoadR64toFPR()
598 am_addr0 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in mk_LoadR64toFPR()
601 addInstr(env, PPCInstr_Store( 8, am_addr0, r_src, env->mode64 )); in mk_LoadR64toFPR()
604 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fr_dst, am_addr0)); in mk_LoadR64toFPR()
606 add_to_sp( env, 16 ); // Reset SP in mk_LoadR64toFPR()
614 static PPCAMode* advance4 ( ISelEnv* env, PPCAMode* am ) in advance4() argument
631 PPCAMode* genGuestArrayOffset ( ISelEnv* env, IRRegArray* descr, in genGuestArrayOffset() argument
664 roff = iselWordExpr_R(env, off, IEndianess); in genGuestArrayOffset()
665 rtmp = newVRegI(env); in genGuestArrayOffset()
666 addInstr(env, PPCInstr_Alu( in genGuestArrayOffset()
670 addInstr(env, PPCInstr_Alu( in genGuestArrayOffset()
674 addInstr(env, PPCInstr_Shft( in genGuestArrayOffset()
676 env->mode64 ? False : True/*F:64-bit, T:32-bit shift*/, in genGuestArrayOffset()
679 addInstr(env, PPCInstr_Alu( in genGuestArrayOffset()
684 PPCAMode_RR( GuestStatePtr(env->mode64), rtmp ); in genGuestArrayOffset()
719 ISelEnv* env, in doHelperCall() argument
730 Bool mode64 = env->mode64; in doHelperCall()
883 addInstr(env, mk_iMOVds_RR( argregs[argreg], in doHelperCall()
888 IRType ty = typeOfIRExpr(env->type_env, arg); in doHelperCall()
893 addInstr(env, in doHelperCall()
895 iselWordExpr_R(env, arg, in doHelperCall()
903 iselInt64Expr(&rHi,&rLo, env, arg, IEndianess); in doHelperCall()
905 addInstr(env, mk_iMOVds_RR( argregs[argreg++], rHi )); in doHelperCall()
907 addInstr(env, mk_iMOVds_RR( argregs[argreg], rLo)); in doHelperCall()
911 addInstr(env, mk_iMOVds_RR( argregs[argreg], in doHelperCall()
912 iselWordExpr_R(env, arg, in doHelperCall()
938 r_vecRetAddr = newVRegI(env); in doHelperCall()
939 sub_from_sp(env, 512); in doHelperCall()
940 addInstr(env, mk_iMOVds_RR( r_vecRetAddr, StackFramePtr(mode64) )); in doHelperCall()
941 sub_from_sp(env, 512); in doHelperCall()
945 r_vecRetAddr = newVRegI(env); in doHelperCall()
946 sub_from_sp(env, 512); in doHelperCall()
947 addInstr(env, mk_iMOVds_RR( r_vecRetAddr, StackFramePtr(mode64) )); in doHelperCall()
948 sub_from_sp(env, 512); in doHelperCall()
956 tmpregs[argreg] = newVRegI(env); in doHelperCall()
957 addInstr(env, mk_iMOVds_RR( tmpregs[argreg], in doHelperCall()
969 IRType ty = typeOfIRExpr(env->type_env, arg); in doHelperCall()
973 tmpregs[argreg] = iselWordExpr_R(env, arg, IEndianess); in doHelperCall()
980 iselInt64Expr(&rHi,&rLo, env, arg, IEndianess); in doHelperCall()
985 tmpregs[argreg] = iselWordExpr_R(env, arg, IEndianess); in doHelperCall()
1002 cc = iselCondCode( env, guard, IEndianess ); in doHelperCall()
1013 addInstr( env, mk_iMOVds_RR( argregs[i], tmpregs[i] ) ); in doHelperCall()
1064 addInstr(env, PPCInstr_Call( cc, target, argiregs, *retloc )); in doHelperCall()
1074 //void set_FPU_rounding_default ( ISelEnv* env )
1076 // HReg fr_src = newVRegF(env);
1077 // HReg r_src = newVRegI(env);
1084 // addInstr(env, PPCInstr_LI(r_src, 0x0, env->mode64));
1085 // if (env->mode64) {
1086 // fr_src = mk_LoadR64toFPR( env, r_src ); // 1*I64 -> F64
1088 // fr_src = mk_LoadRR32toFPR( env, r_src, r_src ); // 2*I32 -> F64
1090 // addInstr(env, PPCInstr_FpLdFPSCR( fr_src ));
1094 static HReg roundModeIRtoPPC ( ISelEnv* env, HReg r_rmIR ) in roundModeIRtoPPC() argument
1109 HReg r_rmPPC = newVRegI(env); in roundModeIRtoPPC()
1110 HReg r_tmp1 = newVRegI(env); in roundModeIRtoPPC()
1111 HReg r_tmp2 = newVRegI(env); in roundModeIRtoPPC()
1113 vassert(hregClass(r_rmIR) == HRcGPR(env->mode64)); in roundModeIRtoPPC()
1121 addInstr(env, PPCInstr_Shft(Pshft_SHL, True/*32bit shift*/, in roundModeIRtoPPC()
1124 addInstr( env, PPCInstr_Alu( Palu_AND, in roundModeIRtoPPC()
1127 addInstr( env, PPCInstr_Alu( Palu_XOR, in roundModeIRtoPPC()
1147 env->previous_rm.) If 'mode' is a single IR temporary 't' and
1148 env->previous_rm is also just 't', then the setting is skipped.
1164 void _set_FPU_rounding_mode ( ISelEnv* env, IRExpr* mode, Bool dfp_rm, in _set_FPU_rounding_mode() argument
1167 HReg fr_src = newVRegF(env); in _set_FPU_rounding_mode()
1170 vassert(typeOfIRExpr(env->type_env,mode) == Ity_I32); in _set_FPU_rounding_mode()
1173 if (env->previous_rm in _set_FPU_rounding_mode()
1174 && env->previous_rm->tag == Iex_RdTmp in _set_FPU_rounding_mode()
1176 && env->previous_rm->Iex.RdTmp.tmp == mode->Iex.RdTmp.tmp) { in _set_FPU_rounding_mode()
1178 vassert(typeOfIRExpr(env->type_env, env->previous_rm) == Ity_I32); in _set_FPU_rounding_mode()
1183 env->previous_rm = mode; in _set_FPU_rounding_mode()
1189 r_src = roundModeIRtoPPC( env, iselWordExpr_R(env, mode, IEndianess) ); in _set_FPU_rounding_mode()
1192 if (env->mode64) { in _set_FPU_rounding_mode()
1194 HReg r_tmp1 = newVRegI( env ); in _set_FPU_rounding_mode()
1195 addInstr( env, in _set_FPU_rounding_mode()
1198 fr_src = mk_LoadR64toFPR( env, r_tmp1 ); in _set_FPU_rounding_mode()
1200 fr_src = mk_LoadR64toFPR( env, r_src ); // 1*I64 -> F64 in _set_FPU_rounding_mode()
1204 HReg r_zero = newVRegI( env ); in _set_FPU_rounding_mode()
1205 addInstr( env, PPCInstr_LI( r_zero, 0, env->mode64 ) ); in _set_FPU_rounding_mode()
1206 fr_src = mk_LoadRR32toFPR( env, r_src, r_zero ); in _set_FPU_rounding_mode()
1208 fr_src = mk_LoadRR32toFPR( env, r_src, r_src ); // 2*I32 -> F64 in _set_FPU_rounding_mode()
1213 addInstr(env, PPCInstr_FpLdFPSCR( fr_src, dfp_rm )); in _set_FPU_rounding_mode()
1216 static void set_FPU_rounding_mode ( ISelEnv* env, IRExpr* mode, in set_FPU_rounding_mode() argument
1219 _set_FPU_rounding_mode(env, mode, False, IEndianess); in set_FPU_rounding_mode()
1222 static void set_FPU_DFP_rounding_mode ( ISelEnv* env, IRExpr* mode, in set_FPU_DFP_rounding_mode() argument
1225 _set_FPU_rounding_mode(env, mode, True, IEndianess); in set_FPU_DFP_rounding_mode()
1235 static HReg generate_zeroes_V128 ( ISelEnv* env ) in generate_zeroes_V128() argument
1237 HReg dst = newVRegV(env); in generate_zeroes_V128()
1238 addInstr(env, PPCInstr_AvBinary(Pav_XOR, dst, dst, dst)); in generate_zeroes_V128()
1244 static HReg generate_ones_V128 ( ISelEnv* env ) in generate_ones_V128() argument
1246 HReg dst = newVRegV(env); in generate_ones_V128()
1248 addInstr(env, PPCInstr_AvSplat(8, dst, src)); in generate_ones_V128()
1260 static HReg mk_AvDuplicateRI( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in mk_AvDuplicateRI() argument
1263 HReg dst = newVRegV(env); in mk_AvDuplicateRI()
1264 PPCRI* ri = iselWordExpr_RI(env, e, IEndianess); in mk_AvDuplicateRI()
1265 IRType ty = typeOfIRExpr(env->type_env,e); in mk_AvDuplicateRI()
1277 HReg v1 = newVRegV(env); in mk_AvDuplicateRI()
1278 HReg v2 = newVRegV(env); in mk_AvDuplicateRI()
1279 addInstr(env, PPCInstr_AvSplat(sz, v1, PPCVI5s_Imm(-16))); in mk_AvDuplicateRI()
1280 addInstr(env, PPCInstr_AvSplat(sz, v2, PPCVI5s_Imm(simm6-16))); in mk_AvDuplicateRI()
1281 addInstr(env, in mk_AvDuplicateRI()
1288 HReg v1 = newVRegV(env); in mk_AvDuplicateRI()
1289 HReg v2 = newVRegV(env); in mk_AvDuplicateRI()
1290 addInstr(env, PPCInstr_AvSplat(sz, v1, PPCVI5s_Imm(-16))); in mk_AvDuplicateRI()
1291 addInstr(env, PPCInstr_AvSplat(sz, v2, PPCVI5s_Imm(simm6+16))); in mk_AvDuplicateRI()
1292 addInstr(env, in mk_AvDuplicateRI()
1299 addInstr(env, PPCInstr_AvSplat(sz, dst, PPCVI5s_Imm(simm6))); in mk_AvDuplicateRI()
1304 r_src = newVRegI(env); in mk_AvDuplicateRI()
1305 addInstr(env, PPCInstr_LI(r_src, (Long)simm32, env->mode64)); in mk_AvDuplicateRI()
1316 sub_from_sp( env, 32 ); // Move SP down in mk_AvDuplicateRI()
1318 r_aligned16 = get_sp_aligned16( env ); in mk_AvDuplicateRI()
1326 addInstr(env, PPCInstr_Store( num_bytes_to_store, am_offset, r_src, env->mode64 )); in mk_AvDuplicateRI()
1330 addInstr(env, PPCInstr_AvLdSt( True/*ld*/, 16, dst, am_offset_zero ) ); in mk_AvDuplicateRI()
1331 add_to_sp( env, 32 ); // Reset SP in mk_AvDuplicateRI()
1339 static HReg isNan ( ISelEnv* env, HReg vSrc, IREndness IEndianess ) in isNan() argument
1345 zeros = mk_AvDuplicateRI(env, mkU32(0), IEndianess); in isNan()
1346 msk_exp = mk_AvDuplicateRI(env, mkU32(0x7F800000), IEndianess); in isNan()
1347 msk_mnt = mk_AvDuplicateRI(env, mkU32(0x7FFFFF), IEndianess); in isNan()
1348 expt = newVRegV(env); in isNan()
1349 mnts = newVRegV(env); in isNan()
1350 vIsNan = newVRegV(env); in isNan()
1355 addInstr(env, PPCInstr_AvBinary(Pav_AND, expt, vSrc, msk_exp)); in isNan()
1356 addInstr(env, PPCInstr_AvBin32x4(Pav_CMPEQU, expt, expt, msk_exp)); in isNan()
1357 addInstr(env, PPCInstr_AvBinary(Pav_AND, mnts, vSrc, msk_mnt)); in isNan()
1358 addInstr(env, PPCInstr_AvBin32x4(Pav_CMPGTU, mnts, mnts, zeros)); in isNan()
1359 addInstr(env, PPCInstr_AvBinary(Pav_AND, vIsNan, expt, mnts)); in isNan()
1383 static HReg iselWordExpr_R ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselWordExpr_R() argument
1385 HReg r = iselWordExpr_R_wrk(env, e, IEndianess); in iselWordExpr_R()
1391 vassert(hregClass(r) == HRcGPR(env->mode64)); in iselWordExpr_R()
1397 static HReg iselWordExpr_R_wrk ( ISelEnv* env, IRExpr* e, in iselWordExpr_R_wrk() argument
1400 Bool mode64 = env->mode64; in iselWordExpr_R_wrk()
1404 IRType ty = typeOfIRExpr(env->type_env,e); in iselWordExpr_R_wrk()
1412 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselWordExpr_R_wrk()
1420 r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1421 am_addr = iselWordExpr_AMode( env, e->Iex.Load.addr, ty/*of xfer*/, in iselWordExpr_R_wrk()
1423 addInstr(env, PPCInstr_Load( toUChar(sizeofIRType(ty)), in iselWordExpr_R_wrk()
1452 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1453 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1458 ri_srcR = iselWordExpr_RH(env, True/*signed*/, in iselWordExpr_R_wrk()
1462 ri_srcR = iselWordExpr_RH(env, False/*signed*/, in iselWordExpr_R_wrk()
1468 addInstr(env, PPCInstr_Alu(aluOp, r_dst, r_srcL, ri_srcR)); in iselWordExpr_R_wrk()
1485 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1486 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1492 ri_srcR = iselWordExpr_RH5u(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1494 ri_srcR = iselWordExpr_RH6u(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1504 HReg tmp = newVRegI(env); in iselWordExpr_R_wrk()
1505 addInstr(env, PPCInstr_Shft(Pshft_SHL, in iselWordExpr_R_wrk()
1508 addInstr(env, PPCInstr_Shft(shftOp, in iselWordExpr_R_wrk()
1519 addInstr(env, PPCInstr_Shft(shftOp, False/*64bit shift*/, in iselWordExpr_R_wrk()
1522 addInstr(env, PPCInstr_Shft(shftOp, True/*32bit shift*/, in iselWordExpr_R_wrk()
1534 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1535 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1536 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1537 addInstr( env, in iselWordExpr_R_wrk()
1552 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1553 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1554 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1556 addInstr( env, in iselWordExpr_R_wrk()
1574 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1575 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1576 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1577 addInstr(env, PPCInstr_MulL(syned, False/*lo32*/, sz32, in iselWordExpr_R_wrk()
1586 HReg tLo = newVRegI(env); in iselWordExpr_R_wrk()
1587 HReg tHi = newVRegI(env); in iselWordExpr_R_wrk()
1588 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1590 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1591 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1592 addInstr(env, PPCInstr_MulL(False/*signedness irrelevant*/, in iselWordExpr_R_wrk()
1595 addInstr(env, PPCInstr_MulL(syned, in iselWordExpr_R_wrk()
1598 addInstr(env, PPCInstr_Shft(Pshft_SHL, False/*64bit shift*/, in iselWordExpr_R_wrk()
1600 addInstr(env, PPCInstr_Alu(Palu_OR, in iselWordExpr_R_wrk()
1609 HReg dst = newVRegI(env); in iselWordExpr_R_wrk()
1610 HReg srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1611 PPCRH* srcR = iselWordExpr_RH(env, syned, e->Iex.Binop.arg2, in iselWordExpr_R_wrk()
1613 addInstr(env, PPCInstr_Cmp(syned, True/*32bit cmp*/, in iselWordExpr_R_wrk()
1615 addInstr(env, PPCInstr_MfCR(dst)); in iselWordExpr_R_wrk()
1616 addInstr(env, PPCInstr_Alu(Palu_AND, dst, dst, in iselWordExpr_R_wrk()
1624 HReg dst = newVRegI(env); in iselWordExpr_R_wrk()
1625 HReg srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1626 PPCRH* srcR = iselWordExpr_RH(env, syned, e->Iex.Binop.arg2, in iselWordExpr_R_wrk()
1629 addInstr(env, PPCInstr_Cmp(syned, False/*64bit cmp*/, in iselWordExpr_R_wrk()
1631 addInstr(env, PPCInstr_MfCR(dst)); in iselWordExpr_R_wrk()
1632 addInstr(env, PPCInstr_Alu(Palu_AND, dst, dst, in iselWordExpr_R_wrk()
1638 HReg r1 = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1639 HReg r2 = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1640 HReg rdst = newVRegI(env); in iselWordExpr_R_wrk()
1642 addInstr(env, mk_iMOVds_RR(rdst, r1)); in iselWordExpr_R_wrk()
1643 addInstr(env, PPCInstr_Cmp(False/*unsigned*/, True/*32bit cmp*/, in iselWordExpr_R_wrk()
1645 addInstr(env, PPCInstr_CMov(cc, rdst, PPCRI_Reg(r2))); in iselWordExpr_R_wrk()
1650 HReg r_Hi = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1651 HReg r_Lo = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1652 HReg r_Tmp = newVRegI(env); in iselWordExpr_R_wrk()
1653 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1654 HReg msk = newVRegI(env); in iselWordExpr_R_wrk()
1657 addInstr(env, PPCInstr_Shft(Pshft_SHL, False/*64bit shift*/, in iselWordExpr_R_wrk()
1659 addInstr(env, PPCInstr_LI(msk, 0xFFFFFFFF, mode64)); in iselWordExpr_R_wrk()
1660 addInstr(env, PPCInstr_Alu( Palu_AND, r_Tmp, r_Lo, in iselWordExpr_R_wrk()
1662 addInstr(env, PPCInstr_Alu( Palu_OR, r_dst, r_dst, in iselWordExpr_R_wrk()
1675 HReg r_ccPPC = newVRegI(env); in iselWordExpr_R_wrk()
1676 HReg r_ccIR = newVRegI(env); in iselWordExpr_R_wrk()
1677 HReg r_ccIR_b0 = newVRegI(env); in iselWordExpr_R_wrk()
1678 HReg r_ccIR_b2 = newVRegI(env); in iselWordExpr_R_wrk()
1679 HReg r_ccIR_b6 = newVRegI(env); in iselWordExpr_R_wrk()
1682 fr_srcL = iselDblExpr(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1683 fr_srcR = iselDblExpr(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1684 addInstr(env, PPCInstr_FpCmp(r_ccPPC, fr_srcL, fr_srcR)); in iselWordExpr_R_wrk()
1687 fr_srcL = iselDfp64Expr(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_R_wrk()
1688 fr_srcR = iselDfp64Expr(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1689 addInstr(env, PPCInstr_Dfp64Cmp(r_ccPPC, fr_srcL, fr_srcR)); in iselWordExpr_R_wrk()
1692 iselDfp128Expr(&fr_srcL, &fr_srcL_lo, env, e->Iex.Binop.arg1, in iselWordExpr_R_wrk()
1694 iselDfp128Expr(&fr_srcR, &fr_srcR_lo, env, e->Iex.Binop.arg2, in iselWordExpr_R_wrk()
1696 addInstr(env, PPCInstr_Dfp128Cmp(r_ccPPC, fr_srcL, fr_srcL_lo, in iselWordExpr_R_wrk()
1712 addInstr(env, PPCInstr_Shft(Pshft_SHR, True/*32bit shift*/, in iselWordExpr_R_wrk()
1715 addInstr(env, PPCInstr_Alu(Palu_OR, r_ccIR_b0, in iselWordExpr_R_wrk()
1717 addInstr(env, PPCInstr_Alu(Palu_AND, r_ccIR_b0, in iselWordExpr_R_wrk()
1721 addInstr(env, PPCInstr_Shft(Pshft_SHL, True/*32bit shift*/, in iselWordExpr_R_wrk()
1724 addInstr(env, PPCInstr_Alu(Palu_AND, r_ccIR_b2, in iselWordExpr_R_wrk()
1728 addInstr(env, PPCInstr_Shft(Pshft_SHR, True/*32bit shift*/, in iselWordExpr_R_wrk()
1731 addInstr(env, PPCInstr_Alu(Palu_OR, r_ccIR_b6, in iselWordExpr_R_wrk()
1733 addInstr(env, PPCInstr_Shft(Pshft_SHL, True/*32bit shift*/, in iselWordExpr_R_wrk()
1736 addInstr(env, PPCInstr_Alu(Palu_AND, r_ccIR_b6, in iselWordExpr_R_wrk()
1740 addInstr(env, PPCInstr_Alu(Palu_OR, r_ccIR, in iselWordExpr_R_wrk()
1742 addInstr(env, PPCInstr_Alu(Palu_OR, r_ccIR, in iselWordExpr_R_wrk()
1750 HReg r1 = StackFramePtr(env->mode64); in iselWordExpr_R_wrk()
1752 HReg fsrc = iselDblExpr(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1753 HReg ftmp = newVRegF(env); in iselWordExpr_R_wrk()
1754 HReg idst = newVRegI(env); in iselWordExpr_R_wrk()
1757 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselWordExpr_R_wrk()
1759 sub_from_sp( env, 16 ); in iselWordExpr_R_wrk()
1760 addInstr(env, PPCInstr_FpCftI(False/*F->I*/, True/*int32*/, in iselWordExpr_R_wrk()
1765 addInstr(env, PPCInstr_FpSTFIW(r1, ftmp)); in iselWordExpr_R_wrk()
1766 addInstr(env, PPCInstr_Load(4, idst, zero_r1, mode64)); in iselWordExpr_R_wrk()
1770 addInstr(env, PPCInstr_Unary(Pun_EXTSW, idst, idst)); in iselWordExpr_R_wrk()
1772 add_to_sp( env, 16 ); in iselWordExpr_R_wrk()
1775 //set_FPU_rounding_default( env ); in iselWordExpr_R_wrk()
1781 HReg r1 = StackFramePtr(env->mode64); in iselWordExpr_R_wrk()
1783 HReg fsrc = iselDblExpr(env, e->Iex.Binop.arg2, in iselWordExpr_R_wrk()
1785 HReg idst = newVRegI(env); in iselWordExpr_R_wrk()
1786 HReg ftmp = newVRegF(env); in iselWordExpr_R_wrk()
1789 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselWordExpr_R_wrk()
1791 sub_from_sp( env, 16 ); in iselWordExpr_R_wrk()
1792 addInstr(env, PPCInstr_FpCftI(False/*F->I*/, False/*int64*/, in iselWordExpr_R_wrk()
1796 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, ftmp, zero_r1)); in iselWordExpr_R_wrk()
1797 addInstr(env, PPCInstr_Load(8, idst, zero_r1, True/*mode64*/)); in iselWordExpr_R_wrk()
1798 add_to_sp( env, 16 ); in iselWordExpr_R_wrk()
1801 //set_FPU_rounding_default( env ); in iselWordExpr_R_wrk()
1807 HReg r1 = StackFramePtr(env->mode64); in iselWordExpr_R_wrk()
1809 HReg fr_src = iselDfp64Expr(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_R_wrk()
1810 HReg idst = newVRegI(env); in iselWordExpr_R_wrk()
1811 HReg ftmp = newVRegF(env); in iselWordExpr_R_wrk()
1814 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselWordExpr_R_wrk()
1815 addInstr(env, PPCInstr_Dfp64Unary(Pfp_DCTFIX, ftmp, fr_src)); in iselWordExpr_R_wrk()
1816 sub_from_sp( env, 16 ); in iselWordExpr_R_wrk()
1817 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, ftmp, zero_r1)); in iselWordExpr_R_wrk()
1818 addInstr(env, PPCInstr_Load(8, idst, zero_r1, mode64)); in iselWordExpr_R_wrk()
1820 add_to_sp( env, 16 ); in iselWordExpr_R_wrk()
1823 //set_FPU_rounding_default( env ); in iselWordExpr_R_wrk()
1829 HReg r_srcHi = newVRegF(env); in iselWordExpr_R_wrk()
1830 HReg r_srcLo = newVRegF(env); in iselWordExpr_R_wrk()
1831 HReg idst = newVRegI(env); in iselWordExpr_R_wrk()
1832 HReg ftmp = newVRegF(env); in iselWordExpr_R_wrk()
1833 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselWordExpr_R_wrk()
1835 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselWordExpr_R_wrk()
1836 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Binop.arg2, in iselWordExpr_R_wrk()
1838 addInstr(env, PPCInstr_DfpD128toD64(fpop, ftmp, r_srcHi, r_srcLo)); in iselWordExpr_R_wrk()
1841 sub_from_sp( env, 16 ); in iselWordExpr_R_wrk()
1842 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, ftmp, zero_r1)); in iselWordExpr_R_wrk()
1843 addInstr(env, PPCInstr_Load(8, idst, zero_r1, True/*mode64*/)); in iselWordExpr_R_wrk()
1844 add_to_sp( env, 16 ); in iselWordExpr_R_wrk()
1859 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1860 HReg r_src = iselWordExpr_R(env, expr32, IEndianess); in iselWordExpr_R_wrk()
1861 addInstr(env, PPCInstr_Alu(Palu_AND, r_dst, in iselWordExpr_R_wrk()
1873 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1875 = iselWordExpr_AMode( env, mi.bindee[0], Ity_I16/*xfer*/, in iselWordExpr_R_wrk()
1877 addInstr(env, PPCInstr_Load(2,r_dst,amode, mode64)); in iselWordExpr_R_wrk()
1888 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1889 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1892 addInstr(env, PPCInstr_Alu(Palu_AND,r_dst,r_src, in iselWordExpr_R_wrk()
1897 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1898 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1900 addInstr(env, in iselWordExpr_R_wrk()
1903 addInstr(env, in iselWordExpr_R_wrk()
1911 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1912 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1914 addInstr(env, in iselWordExpr_R_wrk()
1917 addInstr(env, in iselWordExpr_R_wrk()
1924 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1925 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1928 addInstr(env, in iselWordExpr_R_wrk()
1931 addInstr(env, in iselWordExpr_R_wrk()
1937 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1938 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1942 addInstr(env, in iselWordExpr_R_wrk()
1952 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1953 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1954 addInstr(env, PPCInstr_Unary(Pun_NOT,r_dst,r_src)); in iselWordExpr_R_wrk()
1960 iselInt64Expr(&rHi,&rLo, env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1963 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1964 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1965 addInstr(env, in iselWordExpr_R_wrk()
1974 iselInt64Expr(&rHi,&rLo, env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1978 return iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1983 return iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1989 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
1990 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
1992 addInstr(env, in iselWordExpr_R_wrk()
2000 iselInt128Expr(&rHi,&rLo, env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2007 iselInt128Expr(&rHi,&rLo, env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2015 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2016 PPCCondCode cond = iselCondCode(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2017 addInstr(env, PPCInstr_Set(cond,r_dst)); in iselWordExpr_R_wrk()
2025 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2026 PPCCondCode cond = iselCondCode(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2027 addInstr(env, PPCInstr_Set(cond,r_dst)); in iselWordExpr_R_wrk()
2028 addInstr(env, in iselWordExpr_R_wrk()
2031 addInstr(env, in iselWordExpr_R_wrk()
2039 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2040 PPCCondCode cond = iselCondCode(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2041 addInstr(env, PPCInstr_Set(cond,r_dst)); in iselWordExpr_R_wrk()
2042 addInstr(env, PPCInstr_Shft(Pshft_SHL, False/*64bit shift*/, in iselWordExpr_R_wrk()
2044 addInstr(env, PPCInstr_Shft(Pshft_SAR, False/*64bit shift*/, in iselWordExpr_R_wrk()
2057 r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2058 r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2059 addInstr(env, PPCInstr_Unary(op_clz,r_dst,r_src)); in iselWordExpr_R_wrk()
2070 r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2071 r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2072 addInstr(env, PPCInstr_Unary(Pun_NEG,r_dst,r_src)); in iselWordExpr_R_wrk()
2073 addInstr(env, PPCInstr_Alu(Palu_OR, r_dst, r_dst, PPCRH_Reg(r_src))); in iselWordExpr_R_wrk()
2078 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2079 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2080 addInstr(env, PPCInstr_Unary(Pun_NEG,r_dst,r_src)); in iselWordExpr_R_wrk()
2081 addInstr(env, PPCInstr_Alu(Palu_OR, r_dst, r_dst, PPCRH_Reg(r_src))); in iselWordExpr_R_wrk()
2082 addInstr(env, PPCInstr_Shft(Pshft_SAR, True/*32bit shift*/, in iselWordExpr_R_wrk()
2088 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2089 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2091 addInstr(env, PPCInstr_Unary(Pun_NEG,r_dst,r_src)); in iselWordExpr_R_wrk()
2092 addInstr(env, PPCInstr_Alu(Palu_OR, r_dst, r_dst, PPCRH_Reg(r_src))); in iselWordExpr_R_wrk()
2093 addInstr(env, PPCInstr_Shft(Pshft_SAR, False/*64bit shift*/, in iselWordExpr_R_wrk()
2100 HReg dst = newVRegI(env); in iselWordExpr_R_wrk()
2101 HReg vec = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2103 sub_from_sp( env, 32 ); // Move SP down 32 bytes in iselWordExpr_R_wrk()
2106 r_aligned16 = get_sp_aligned16( env ); in iselWordExpr_R_wrk()
2122 addInstr(env, in iselWordExpr_R_wrk()
2124 addInstr(env, in iselWordExpr_R_wrk()
2127 add_to_sp( env, 32 ); // Reset SP in iselWordExpr_R_wrk()
2135 HReg dst = newVRegI(env); in iselWordExpr_R_wrk()
2136 HReg vec = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2138 sub_from_sp( env, 32 ); // Move SP down 32 bytes in iselWordExpr_R_wrk()
2141 r_aligned16 = get_sp_aligned16( env ); in iselWordExpr_R_wrk()
2146 addInstr(env, in iselWordExpr_R_wrk()
2159 addInstr(env, in iselWordExpr_R_wrk()
2165 add_to_sp( env, 32 ); // Reset SP in iselWordExpr_R_wrk()
2174 return iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2182 HReg fr_src = iselDblExpr(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2183 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2185 sub_from_sp( env, 16 ); // Move SP down 16 bytes in iselWordExpr_R_wrk()
2189 addInstr(env, PPCInstr_FpLdSt( False/*store*/, 8, in iselWordExpr_R_wrk()
2192 addInstr(env, PPCInstr_Load( 8, r_dst, am_addr, mode64 )); in iselWordExpr_R_wrk()
2194 add_to_sp( env, 16 ); // Reset SP in iselWordExpr_R_wrk()
2206 HReg fr_src = iselFltExpr(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2207 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2209 sub_from_sp( env, 16 ); // Move SP down 16 bytes in iselWordExpr_R_wrk()
2213 addInstr(env, PPCInstr_FpLdSt( False/*store*/, 4, in iselWordExpr_R_wrk()
2216 addInstr(env, PPCInstr_Load( 4, r_dst, am_addr, mode64 )); in iselWordExpr_R_wrk()
2218 add_to_sp( env, 16 ); // Reset SP in iselWordExpr_R_wrk()
2226 HReg fr_src = iselDfp64Expr(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2227 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2229 sub_from_sp( env, 16 ); // Move SP down 16 bytes in iselWordExpr_R_wrk()
2233 addInstr(env, PPCInstr_FpLdSt( False/*store*/, 8, in iselWordExpr_R_wrk()
2236 addInstr(env, PPCInstr_Load( 8, r_dst, am_addr, mode64 )); in iselWordExpr_R_wrk()
2237 add_to_sp( env, 16 ); // Reset SP in iselWordExpr_R_wrk()
2249 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2257 addInstr(env, mk_iMOVds_RR( argregs[argreg++], in iselWordExpr_R_wrk()
2258 iselWordExpr_R(env, e->Iex.Unop.arg, in iselWordExpr_R_wrk()
2263 addInstr(env, PPCInstr_Call( cc, (Addr)h_calc_BCDtoDPB, in iselWordExpr_R_wrk()
2269 addInstr(env, PPCInstr_Call( cc, (Addr64)(fdescr[0]), in iselWordExpr_R_wrk()
2274 addInstr(env, mk_iMOVds_RR(r_dst, argregs[0])); in iselWordExpr_R_wrk()
2285 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2293 addInstr(env, mk_iMOVds_RR( argregs[argreg++], in iselWordExpr_R_wrk()
2294 iselWordExpr_R(env, e->Iex.Unop.arg, in iselWordExpr_R_wrk()
2300 addInstr(env, PPCInstr_Call( cc, (Addr)h_calc_DPBtoBCD, in iselWordExpr_R_wrk()
2306 addInstr(env, PPCInstr_Call( cc, (Addr64)(fdescr[0]), in iselWordExpr_R_wrk()
2311 addInstr(env, mk_iMOVds_RR(r_dst, argregs[0])); in iselWordExpr_R_wrk()
2322 HReg fr_dst = newVRegI(env); in iselWordExpr_R_wrk()
2323 HReg fr_src = iselDfp64Expr(env, e->Iex.Unop.arg, IEndianess); in iselWordExpr_R_wrk()
2324 HReg tmp = newVRegF(env); in iselWordExpr_R_wrk()
2325 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselWordExpr_R_wrk()
2326 addInstr(env, PPCInstr_Dfp64Unary(Pfp_DXEX, tmp, fr_src)); in iselWordExpr_R_wrk()
2329 sub_from_sp( env, 16 ); in iselWordExpr_R_wrk()
2330 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, tmp, zero_r1)); in iselWordExpr_R_wrk()
2331 addInstr(env, PPCInstr_Load(8, fr_dst, zero_r1, env->mode64)); in iselWordExpr_R_wrk()
2332 add_to_sp( env, 16 ); in iselWordExpr_R_wrk()
2336 HReg fr_dst = newVRegI(env); in iselWordExpr_R_wrk()
2339 HReg tmp = newVRegF(env); in iselWordExpr_R_wrk()
2340 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselWordExpr_R_wrk()
2342 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Unop.arg, in iselWordExpr_R_wrk()
2344 addInstr(env, PPCInstr_ExtractExpD128(Pfp_DXEXQ, tmp, in iselWordExpr_R_wrk()
2347 sub_from_sp( env, 16 ); in iselWordExpr_R_wrk()
2348 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, tmp, zero_r1)); in iselWordExpr_R_wrk()
2349 addInstr(env, PPCInstr_Load(8, fr_dst, zero_r1, env->mode64)); in iselWordExpr_R_wrk()
2350 add_to_sp( env, 16 ); in iselWordExpr_R_wrk()
2364 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2367 addInstr(env, PPCInstr_Load( toUChar(sizeofIRType(ty)), in iselWordExpr_R_wrk()
2376 = genGuestArrayOffset( env, e->Iex.GetI.descr, in iselWordExpr_R_wrk()
2379 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2381 addInstr(env, PPCInstr_Load( toUChar(8), in iselWordExpr_R_wrk()
2386 addInstr(env, PPCInstr_Load( toUChar(4), in iselWordExpr_R_wrk()
2405 doHelperCall( &addToSp, &rloc, env, NULL/*guard*/, in iselWordExpr_R_wrk()
2413 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2414 addInstr(env, mk_iMOVds_RR(r_dst, hregPPC_GPR3(mode64))); in iselWordExpr_R_wrk()
2422 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2432 addInstr(env, PPCInstr_LI(r_dst, (ULong)l, mode64)); in iselWordExpr_R_wrk()
2440 typeOfIRExpr(env->type_env,e->Iex.ITE.cond) == Ity_I1) { in iselWordExpr_R_wrk()
2441 PPCRI* r1 = iselWordExpr_RI(env, e->Iex.ITE.iftrue, IEndianess); in iselWordExpr_R_wrk()
2442 HReg r0 = iselWordExpr_R(env, e->Iex.ITE.iffalse, IEndianess); in iselWordExpr_R_wrk()
2443 HReg r_dst = newVRegI(env); in iselWordExpr_R_wrk()
2444 addInstr(env, mk_iMOVds_RR(r_dst,r0)); in iselWordExpr_R_wrk()
2445 PPCCondCode cc = iselCondCode(env, e->Iex.ITE.cond, IEndianess); in iselWordExpr_R_wrk()
2446 addInstr(env, PPCInstr_CMov(cc, r_dst, r1)); in iselWordExpr_R_wrk()
2500 static Bool sane_AMode ( ISelEnv* env, PPCAMode* am ) in sane_AMode() argument
2502 Bool mode64 = env->mode64; in sane_AMode()
2521 PPCAMode* iselWordExpr_AMode ( ISelEnv* env, IRExpr* e, IRType xferTy, in iselWordExpr_AMode() argument
2524 PPCAMode* am = iselWordExpr_AMode_wrk(env, e, xferTy, IEndianess); in iselWordExpr_AMode()
2525 vassert(sane_AMode(env, am)); in iselWordExpr_AMode()
2530 static PPCAMode* iselWordExpr_AMode_wrk ( ISelEnv* env, IRExpr* e, in iselWordExpr_AMode_wrk() argument
2533 IRType ty = typeOfIRExpr(env->type_env,e); in iselWordExpr_AMode_wrk()
2535 if (env->mode64) { in iselWordExpr_AMode_wrk()
2559 iselWordExpr_R(env, e->Iex.Binop.arg1, in iselWordExpr_AMode_wrk()
2566 HReg r_base = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_AMode_wrk()
2567 HReg r_idx = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_AMode_wrk()
2583 iselWordExpr_R(env, e->Iex.Binop.arg1, in iselWordExpr_AMode_wrk()
2590 HReg r_base = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselWordExpr_AMode_wrk()
2591 HReg r_idx = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselWordExpr_AMode_wrk()
2599 return PPCAMode_IR( 0, iselWordExpr_R(env,e,IEndianess) ); in iselWordExpr_AMode_wrk()
2612 static PPCRH* iselWordExpr_RH ( ISelEnv* env, Bool syned, IRExpr* e, in iselWordExpr_RH() argument
2615 PPCRH* ri = iselWordExpr_RH_wrk(env, syned, e, IEndianess); in iselWordExpr_RH()
2624 vassert(hregClass(ri->Prh.Reg.reg) == HRcGPR(env->mode64)); in iselWordExpr_RH()
2633 static PPCRH* iselWordExpr_RH_wrk ( ISelEnv* env, Bool syned, IRExpr* e, in iselWordExpr_RH_wrk() argument
2638 IRType ty = typeOfIRExpr(env->type_env,e); in iselWordExpr_RH_wrk()
2640 ty == Ity_I32 || ((ty == Ity_I64) && env->mode64)); in iselWordExpr_RH_wrk()
2648 case Ico_U64: vassert(env->mode64); in iselWordExpr_RH_wrk()
2667 return PPCRH_Reg( iselWordExpr_R ( env, e, IEndianess ) ); in iselWordExpr_RH_wrk()
2677 static PPCRI* iselWordExpr_RI ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselWordExpr_RI() argument
2679 PPCRI* ri = iselWordExpr_RI_wrk(env, e, IEndianess); in iselWordExpr_RI()
2685 vassert(hregClass(ri->Pri.Reg) == HRcGPR(env->mode64)); in iselWordExpr_RI()
2694 static PPCRI* iselWordExpr_RI_wrk ( ISelEnv* env, IRExpr* e, in iselWordExpr_RI_wrk() argument
2698 IRType ty = typeOfIRExpr(env->type_env,e); in iselWordExpr_RI_wrk()
2700 ty == Ity_I32 || ((ty == Ity_I64) && env->mode64)); in iselWordExpr_RI_wrk()
2706 case Ico_U64: vassert(env->mode64); in iselWordExpr_RI_wrk()
2717 return PPCRI_Reg( iselWordExpr_R ( env, e, IEndianess ) ); in iselWordExpr_RI_wrk()
2727 static PPCRH* iselWordExpr_RH5u ( ISelEnv* env, IRExpr* e, in iselWordExpr_RH5u() argument
2731 vassert(!env->mode64); in iselWordExpr_RH5u()
2732 ri = iselWordExpr_RH5u_wrk(env, e, IEndianess); in iselWordExpr_RH5u()
2740 vassert(hregClass(ri->Prh.Reg.reg) == HRcGPR(env->mode64)); in iselWordExpr_RH5u()
2749 static PPCRH* iselWordExpr_RH5u_wrk ( ISelEnv* env, IRExpr* e, in iselWordExpr_RH5u_wrk() argument
2752 IRType ty = typeOfIRExpr(env->type_env,e); in iselWordExpr_RH5u_wrk()
2764 return PPCRH_Reg( iselWordExpr_R ( env, e, IEndianess ) ); in iselWordExpr_RH5u_wrk()
2774 static PPCRH* iselWordExpr_RH6u ( ISelEnv* env, IRExpr* e, in iselWordExpr_RH6u() argument
2778 vassert(env->mode64); in iselWordExpr_RH6u()
2779 ri = iselWordExpr_RH6u_wrk(env, e, IEndianess); in iselWordExpr_RH6u()
2787 vassert(hregClass(ri->Prh.Reg.reg) == HRcGPR(env->mode64)); in iselWordExpr_RH6u()
2796 static PPCRH* iselWordExpr_RH6u_wrk ( ISelEnv* env, IRExpr* e, in iselWordExpr_RH6u_wrk() argument
2799 IRType ty = typeOfIRExpr(env->type_env,e); in iselWordExpr_RH6u_wrk()
2811 return PPCRH_Reg( iselWordExpr_R ( env, e, IEndianess ) ); in iselWordExpr_RH6u_wrk()
2821 static PPCCondCode iselCondCode ( ISelEnv* env, IRExpr* e, in iselCondCode() argument
2825 return iselCondCode_wrk(env,e, IEndianess); in iselCondCode()
2829 static PPCCondCode iselCondCode_wrk ( ISelEnv* env, IRExpr* e, in iselCondCode_wrk() argument
2833 vassert(typeOfIRExpr(env->type_env,e) == Ity_I1); in iselCondCode_wrk()
2838 HReg r_zero = newVRegI(env); in iselCondCode_wrk()
2839 addInstr(env, PPCInstr_LI(r_zero, 0, env->mode64)); in iselCondCode_wrk()
2840 addInstr(env, PPCInstr_Cmp(False/*unsigned*/, True/*32bit cmp*/, in iselCondCode_wrk()
2848 PPCCondCode cond = iselCondCode(env, e->Iex.Unop.arg, IEndianess); in iselCondCode_wrk()
2858 HReg src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselCondCode_wrk()
2859 HReg tmp = newVRegI(env); in iselCondCode_wrk()
2861 addInstr(env, PPCInstr_Alu(Palu_AND, tmp, in iselCondCode_wrk()
2863 addInstr(env, PPCInstr_Cmp(False/*unsigned*/, True/*32bit cmp*/, in iselCondCode_wrk()
2875 HReg arg = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselCondCode_wrk()
2876 HReg tmp = newVRegI(env); in iselCondCode_wrk()
2877 addInstr(env, PPCInstr_Alu(Palu_AND, tmp, arg, in iselCondCode_wrk()
2879 addInstr(env, PPCInstr_Cmp(False/*unsigned*/, True/*32bit cmp*/, in iselCondCode_wrk()
2889 HReg r1 = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselCondCode_wrk()
2890 addInstr(env, PPCInstr_Cmp(False/*unsigned*/, True/*32bit cmp*/, in iselCondCode_wrk()
2907 HReg r1 = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselCondCode_wrk()
2908 PPCRH* ri2 = iselWordExpr_RH(env, syned, e->Iex.Binop.arg2, IEndianess); in iselCondCode_wrk()
2909 addInstr(env, PPCInstr_Cmp(syned, True/*32bit cmp*/, in iselCondCode_wrk()
2928 if (!env->mode64) { in iselCondCode_wrk()
2930 HReg tmp = newVRegI(env); in iselCondCode_wrk()
2931 iselInt64Expr( &hi, &lo, env, e->Iex.Unop.arg, IEndianess ); in iselCondCode_wrk()
2932 addInstr(env, PPCInstr_Alu(Palu_OR, tmp, lo, PPCRH_Reg(hi))); in iselCondCode_wrk()
2933 addInstr(env, PPCInstr_Cmp(False/*sign*/, True/*32bit cmp*/, in iselCondCode_wrk()
2937 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselCondCode_wrk()
2938 addInstr(env, PPCInstr_Cmp(False/*sign*/, False/*64bit cmp*/, in iselCondCode_wrk()
2956 HReg r1 = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselCondCode_wrk()
2957 PPCRH* ri2 = iselWordExpr_RH(env, syned, e->Iex.Binop.arg2, IEndianess); in iselCondCode_wrk()
2958 vassert(env->mode64); in iselCondCode_wrk()
2959 addInstr(env, PPCInstr_Cmp(syned, False/*64bit cmp*/, in iselCondCode_wrk()
2979 HReg arg = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselCondCode_wrk()
2980 HReg tmp = newVRegI(env); in iselCondCode_wrk()
2981 addInstr(env, PPCInstr_Alu(Palu_AND, tmp, arg, in iselCondCode_wrk()
2983 addInstr(env, PPCInstr_Cmp(False/*unsigned*/, True/*32bit cmp*/, in iselCondCode_wrk()
2990 HReg r_src = lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselCondCode_wrk()
2991 HReg src_masked = newVRegI(env); in iselCondCode_wrk()
2992 addInstr(env, in iselCondCode_wrk()
2995 addInstr(env, in iselCondCode_wrk()
3018 ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselInt128Expr() argument
3020 vassert(env->mode64); in iselInt128Expr()
3021 iselInt128Expr_wrk(rHi, rLo, env, e, IEndianess); in iselInt128Expr()
3025 vassert(hregClass(*rHi) == HRcGPR(env->mode64)); in iselInt128Expr()
3027 vassert(hregClass(*rLo) == HRcGPR(env->mode64)); in iselInt128Expr()
3033 ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselInt128Expr_wrk() argument
3036 vassert(typeOfIRExpr(env->type_env,e) == Ity_I128); in iselInt128Expr_wrk()
3040 lookupIRTempPair( rHi, rLo, env, e->Iex.RdTmp.tmp); in iselInt128Expr_wrk()
3050 HReg tLo = newVRegI(env); in iselInt128Expr_wrk()
3051 HReg tHi = newVRegI(env); in iselInt128Expr_wrk()
3053 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselInt128Expr_wrk()
3054 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselInt128Expr_wrk()
3055 addInstr(env, PPCInstr_MulL(False/*signedness irrelevant*/, in iselInt128Expr_wrk()
3058 addInstr(env, PPCInstr_MulL(syned, in iselInt128Expr_wrk()
3068 *rHi = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselInt128Expr_wrk()
3069 *rLo = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselInt128Expr_wrk()
3097 HReg* rLo, ISelEnv* env, IRExpr* e, in iselInt128Expr_to_32x4() argument
3100 vassert(!env->mode64); in iselInt128Expr_to_32x4()
3101 iselInt128Expr_to_32x4_wrk(rHi, rMedHi, rMedLo, rLo, env, e, IEndianess); in iselInt128Expr_to_32x4()
3117 ISelEnv* env, IRExpr* e, in iselInt128Expr_to_32x4_wrk() argument
3121 vassert(typeOfIRExpr(env->type_env,e) == Ity_I128); in iselInt128Expr_to_32x4_wrk()
3125 lookupIRTempQuad( rHi, rMedHi, rMedLo, rLo, env, e->Iex.RdTmp.tmp); in iselInt128Expr_to_32x4_wrk()
3134 iselInt64Expr(rHi, rMedHi, env, e->Iex.Binop.arg1, IEndianess); in iselInt128Expr_to_32x4_wrk()
3135 iselInt64Expr(rMedLo, rLo, env, e->Iex.Binop.arg2, IEndianess); in iselInt128Expr_to_32x4_wrk()
3155 ISelEnv* env, IRExpr* e, in iselInt64Expr() argument
3158 vassert(!env->mode64); in iselInt64Expr()
3159 iselInt64Expr_wrk(rHi, rLo, env, e, IEndianess); in iselInt64Expr()
3171 ISelEnv* env, IRExpr* e, in iselInt64Expr_wrk() argument
3175 vassert(typeOfIRExpr(env->type_env,e) == Ity_I64); in iselInt64Expr_wrk()
3179 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3180 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3181 HReg r_addr = iselWordExpr_R(env, e->Iex.Load.addr, IEndianess); in iselInt64Expr_wrk()
3182 vassert(!env->mode64); in iselInt64Expr_wrk()
3183 addInstr(env, PPCInstr_Load( 4/*byte-load*/, in iselInt64Expr_wrk()
3186 addInstr(env, PPCInstr_Load( 4/*byte-load*/, in iselInt64Expr_wrk()
3199 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3200 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3202 addInstr(env, PPCInstr_LI(tHi, (Long)(Int)wHi, False/*mode32*/)); in iselInt64Expr_wrk()
3203 addInstr(env, PPCInstr_LI(tLo, (Long)(Int)wLo, False/*mode32*/)); in iselInt64Expr_wrk()
3211 lookupIRTempPair( rHi, rLo, env, e->Iex.RdTmp.tmp); in iselInt64Expr_wrk()
3219 PPCAMode* am_addr4 = advance4(env, am_addr); in iselInt64Expr_wrk()
3220 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3221 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3222 addInstr(env, PPCInstr_Load( 4, tHi, am_addr, False/*mode32*/ )); in iselInt64Expr_wrk()
3223 addInstr(env, PPCInstr_Load( 4, tLo, am_addr4, False/*mode32*/ )); in iselInt64Expr_wrk()
3232 iselInt64Expr(&eXHi, &eXLo, env, e->Iex.ITE.iftrue, IEndianess); in iselInt64Expr_wrk()
3233 iselInt64Expr(&e0Hi, &e0Lo, env, e->Iex.ITE.iffalse, IEndianess); in iselInt64Expr_wrk()
3234 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3235 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3236 addInstr(env, mk_iMOVds_RR(tHi,e0Hi)); in iselInt64Expr_wrk()
3237 addInstr(env, mk_iMOVds_RR(tLo,e0Lo)); in iselInt64Expr_wrk()
3238 PPCCondCode cc = iselCondCode(env, e->Iex.ITE.cond, IEndianess); in iselInt64Expr_wrk()
3239 addInstr(env, PPCInstr_CMov(cc,tHi,PPCRI_Reg(eXHi))); in iselInt64Expr_wrk()
3240 addInstr(env, PPCInstr_CMov(cc,tLo,PPCRI_Reg(eXLo))); in iselInt64Expr_wrk()
3253 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3254 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3256 HReg r_srcL = iselWordExpr_R(env, e->Iex.Binop.arg1, in iselInt64Expr_wrk()
3258 HReg r_srcR = iselWordExpr_R(env, e->Iex.Binop.arg2, in iselInt64Expr_wrk()
3260 addInstr(env, PPCInstr_MulL(False/*signedness irrelevant*/, in iselInt64Expr_wrk()
3263 addInstr(env, PPCInstr_MulL(syned, in iselInt64Expr_wrk()
3276 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3277 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3280 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1, IEndianess); in iselInt64Expr_wrk()
3281 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2, IEndianess); in iselInt64Expr_wrk()
3282 addInstr(env, PPCInstr_Alu(op, tHi, xHi, PPCRH_Reg(yHi))); in iselInt64Expr_wrk()
3283 addInstr(env, PPCInstr_Alu(op, tLo, xLo, PPCRH_Reg(yLo))); in iselInt64Expr_wrk()
3292 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3293 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3294 iselInt64Expr(&xHi, &xLo, env, e->Iex.Binop.arg1, IEndianess); in iselInt64Expr_wrk()
3295 iselInt64Expr(&yHi, &yLo, env, e->Iex.Binop.arg2, IEndianess); in iselInt64Expr_wrk()
3296 addInstr(env, PPCInstr_AddSubC( True/*add*/, True /*set carry*/, in iselInt64Expr_wrk()
3298 addInstr(env, PPCInstr_AddSubC( True/*add*/, False/*read carry*/, in iselInt64Expr_wrk()
3307 *rHi = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselInt64Expr_wrk()
3308 *rLo = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselInt64Expr_wrk()
3313 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3314 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3315 HReg r1 = StackFramePtr(env->mode64); in iselInt64Expr_wrk()
3318 HReg fsrc = iselDblExpr(env, e->Iex.Binop.arg2, in iselInt64Expr_wrk()
3320 HReg ftmp = newVRegF(env); in iselInt64Expr_wrk()
3322 vassert(!env->mode64); in iselInt64Expr_wrk()
3324 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselInt64Expr_wrk()
3326 sub_from_sp( env, 16 ); in iselInt64Expr_wrk()
3327 addInstr(env, PPCInstr_FpCftI(False/*F->I*/, False/*int64*/, in iselInt64Expr_wrk()
3330 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, ftmp, zero_r1)); in iselInt64Expr_wrk()
3331 addInstr(env, PPCInstr_Load(4, tHi, zero_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3332 addInstr(env, PPCInstr_Load(4, tLo, four_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3333 add_to_sp( env, 16 ); in iselInt64Expr_wrk()
3336 //set_FPU_rounding_default( env ); in iselInt64Expr_wrk()
3342 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3343 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3344 HReg r1 = StackFramePtr(env->mode64); in iselInt64Expr_wrk()
3347 HReg fr_src = iselDfp64Expr(env, e->Iex.Binop.arg2, IEndianess); in iselInt64Expr_wrk()
3348 HReg tmp = newVRegF(env); in iselInt64Expr_wrk()
3350 vassert(!env->mode64); in iselInt64Expr_wrk()
3351 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselInt64Expr_wrk()
3352 addInstr(env, PPCInstr_Dfp64Unary(Pfp_DCTFIX, tmp, fr_src)); in iselInt64Expr_wrk()
3354 sub_from_sp( env, 16 ); in iselInt64Expr_wrk()
3355 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, tmp, zero_r1)); in iselInt64Expr_wrk()
3356 addInstr(env, PPCInstr_Load(4, tHi, zero_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3357 addInstr(env, PPCInstr_Load(4, tLo, four_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3358 add_to_sp( env, 16 ); in iselInt64Expr_wrk()
3365 HReg r_srcHi = newVRegF(env); in iselInt64Expr_wrk()
3366 HReg r_srcLo = newVRegF(env); in iselInt64Expr_wrk()
3367 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3368 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3369 HReg ftmp = newVRegF(env); in iselInt64Expr_wrk()
3370 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselInt64Expr_wrk()
3371 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselInt64Expr_wrk()
3373 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselInt64Expr_wrk()
3374 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Binop.arg2, in iselInt64Expr_wrk()
3376 addInstr(env, PPCInstr_DfpD128toD64(fpop, ftmp, r_srcHi, r_srcLo)); in iselInt64Expr_wrk()
3379 sub_from_sp( env, 16 ); in iselInt64Expr_wrk()
3380 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, ftmp, zero_r1)); in iselInt64Expr_wrk()
3381 addInstr(env, PPCInstr_Load(4, tHi, zero_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3382 addInstr(env, PPCInstr_Load(4, tLo, four_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3383 add_to_sp( env, 16 ); in iselInt64Expr_wrk()
3401 HReg tmp1 = newVRegI(env); in iselInt64Expr_wrk()
3402 HReg tmp2 = newVRegI(env); in iselInt64Expr_wrk()
3403 iselInt64Expr(&argHi, &argLo, env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3405 addInstr(env, PPCInstr_Alu(Palu_OR, tmp1, argHi, PPCRH_Reg(argLo))); in iselInt64Expr_wrk()
3407 addInstr(env, PPCInstr_Unary(Pun_NEG,tmp2,tmp1)); in iselInt64Expr_wrk()
3408 addInstr(env, PPCInstr_Alu(Palu_OR, tmp2, tmp2, PPCRH_Reg(tmp1))); in iselInt64Expr_wrk()
3409 addInstr(env, PPCInstr_Shft(Pshft_SAR, True/*32bit shift*/, in iselInt64Expr_wrk()
3419 HReg zero32 = newVRegI(env); in iselInt64Expr_wrk()
3420 HReg resHi = newVRegI(env); in iselInt64Expr_wrk()
3421 HReg resLo = newVRegI(env); in iselInt64Expr_wrk()
3422 iselInt64Expr(&argHi, &argLo, env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3423 vassert(env->mode64 == False); in iselInt64Expr_wrk()
3424 addInstr(env, PPCInstr_LI(zero32, 0, env->mode64)); in iselInt64Expr_wrk()
3426 addInstr(env, PPCInstr_AddSubC( False/*sub*/, True/*set carry*/, in iselInt64Expr_wrk()
3428 addInstr(env, PPCInstr_AddSubC( False/*sub*/, False/*read carry*/, in iselInt64Expr_wrk()
3431 addInstr(env, PPCInstr_Alu(Palu_OR, resLo, resLo, PPCRH_Reg(argLo))); in iselInt64Expr_wrk()
3432 addInstr(env, PPCInstr_Alu(Palu_OR, resHi, resHi, PPCRH_Reg(argHi))); in iselInt64Expr_wrk()
3440 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3441 HReg src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3442 addInstr(env, PPCInstr_Shft(Pshft_SAR, True/*32bit shift*/, in iselInt64Expr_wrk()
3449 HReg tmp = newVRegF(env); in iselInt64Expr_wrk()
3450 HReg fr_src = iselDfp64Expr(env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3451 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3452 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3453 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselInt64Expr_wrk()
3454 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselInt64Expr_wrk()
3456 addInstr(env, PPCInstr_Dfp64Unary(Pfp_DXEX, tmp, fr_src)); in iselInt64Expr_wrk()
3459 sub_from_sp( env, 16 ); in iselInt64Expr_wrk()
3460 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, tmp, zero_r1)); in iselInt64Expr_wrk()
3461 addInstr(env, PPCInstr_Load(4, tHi, zero_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3462 addInstr(env, PPCInstr_Load(4, tLo, four_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3463 add_to_sp( env, 16 ); in iselInt64Expr_wrk()
3471 HReg tmp = newVRegF(env); in iselInt64Expr_wrk()
3472 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3473 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3474 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselInt64Expr_wrk()
3475 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselInt64Expr_wrk()
3477 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3478 addInstr(env, PPCInstr_ExtractExpD128(Pfp_DXEXQ, tmp, in iselInt64Expr_wrk()
3482 sub_from_sp( env, 16 ); in iselInt64Expr_wrk()
3483 addInstr(env, PPCInstr_FpLdSt(False/*store*/, 8, tmp, zero_r1)); in iselInt64Expr_wrk()
3484 addInstr(env, PPCInstr_Load(4, tHi, zero_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3485 addInstr(env, PPCInstr_Load(4, tLo, four_r1, False/*mode32*/)); in iselInt64Expr_wrk()
3486 add_to_sp( env, 16 ); in iselInt64Expr_wrk()
3494 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3495 HReg tLo = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3496 addInstr(env, PPCInstr_LI(tHi, 0, False/*mode32*/)); in iselInt64Expr_wrk()
3511 env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3526 env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3537 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3538 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3539 HReg vec = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3541 sub_from_sp( env, 32 ); // Move SP down 32 bytes in iselInt64Expr_wrk()
3544 r_aligned16 = get_sp_aligned16( env ); in iselInt64Expr_wrk()
3550 addInstr(env, in iselInt64Expr_wrk()
3554 addInstr(env, in iselInt64Expr_wrk()
3556 addInstr(env, in iselInt64Expr_wrk()
3559 add_to_sp( env, 32 ); // Reset SP in iselInt64Expr_wrk()
3567 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3568 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3569 PPCCondCode cond = iselCondCode(env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3570 addInstr(env, PPCInstr_Set(cond,tLo)); in iselInt64Expr_wrk()
3571 addInstr(env, PPCInstr_Shft(Pshft_SHL, True/*32bit shift*/, in iselInt64Expr_wrk()
3573 addInstr(env, PPCInstr_Shft(Pshft_SAR, True/*32bit shift*/, in iselInt64Expr_wrk()
3575 addInstr(env, mk_iMOVds_RR(tHi, tLo)); in iselInt64Expr_wrk()
3583 HReg tmpLo = newVRegI(env); in iselInt64Expr_wrk()
3584 HReg tmpHi = newVRegI(env); in iselInt64Expr_wrk()
3585 iselInt64Expr(&xHi, &xLo, env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3586 addInstr(env, PPCInstr_Unary(Pun_NOT,tmpLo,xLo)); in iselInt64Expr_wrk()
3587 addInstr(env, PPCInstr_Unary(Pun_NOT,tmpHi,xHi)); in iselInt64Expr_wrk()
3598 HReg fr_src = iselDblExpr(env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3599 HReg r_dstLo = newVRegI(env); in iselInt64Expr_wrk()
3600 HReg r_dstHi = newVRegI(env); in iselInt64Expr_wrk()
3602 sub_from_sp( env, 16 ); // Move SP down 16 bytes in iselInt64Expr_wrk()
3607 addInstr(env, PPCInstr_FpLdSt( False/*store*/, 8, in iselInt64Expr_wrk()
3611 addInstr(env, PPCInstr_Load( 4, r_dstHi, in iselInt64Expr_wrk()
3613 addInstr(env, PPCInstr_Load( 4, r_dstLo, in iselInt64Expr_wrk()
3618 add_to_sp( env, 16 ); // Reset SP in iselInt64Expr_wrk()
3623 HReg fr_src = iselDfp64Expr(env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3625 HReg r_dstLo = newVRegI(env); in iselInt64Expr_wrk()
3626 HReg r_dstHi = newVRegI(env); in iselInt64Expr_wrk()
3629 sub_from_sp( env, 16 ); // Move SP down 16 bytes in iselInt64Expr_wrk()
3634 addInstr(env, PPCInstr_FpLdSt( False/*store*/, 8, in iselInt64Expr_wrk()
3638 addInstr(env, PPCInstr_Load( 4, r_dstHi, in iselInt64Expr_wrk()
3640 addInstr(env, PPCInstr_Load( 4, r_dstLo, in iselInt64Expr_wrk()
3645 add_to_sp( env, 16 ); // Reset SP in iselInt64Expr_wrk()
3655 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3656 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3659 Bool mode64 = env->mode64; in iselInt64Expr_wrk()
3667 iselInt64Expr( &tmpHi, &tmpLo, env, e->Iex.Unop.arg, IEndianess ); in iselInt64Expr_wrk()
3670 addInstr( env, mk_iMOVds_RR( argregs[argreg++], tmpHi ) ); in iselInt64Expr_wrk()
3673 addInstr( env, mk_iMOVds_RR( argregs[argreg], tmpLo ) ); in iselInt64Expr_wrk()
3678 addInstr( env, PPCInstr_Call( cc, (Addr)h_calc_BCDtoDPB, in iselInt64Expr_wrk()
3685 addInstr( env, PPCInstr_Call( cc, target, in iselInt64Expr_wrk()
3690 addInstr( env, mk_iMOVds_RR( tHi, argregs[argreg-1] ) ); in iselInt64Expr_wrk()
3691 addInstr( env, mk_iMOVds_RR( tLo, argregs[argreg] ) ); in iselInt64Expr_wrk()
3703 HReg tLo = newVRegI(env); in iselInt64Expr_wrk()
3704 HReg tHi = newVRegI(env); in iselInt64Expr_wrk()
3707 Bool mode64 = env->mode64; in iselInt64Expr_wrk()
3715 iselInt64Expr(&tmpHi, &tmpLo, env, e->Iex.Unop.arg, IEndianess); in iselInt64Expr_wrk()
3718 addInstr(env, mk_iMOVds_RR( argregs[argreg++], tmpHi )); in iselInt64Expr_wrk()
3721 addInstr(env, mk_iMOVds_RR( argregs[argreg], tmpLo)); in iselInt64Expr_wrk()
3726 addInstr(env, PPCInstr_Call( cc, (Addr)h_calc_DPBtoBCD, in iselInt64Expr_wrk()
3733 addInstr(env, PPCInstr_Call( cc, target, argiregs, in iselInt64Expr_wrk()
3737 addInstr(env, mk_iMOVds_RR(tHi, argregs[argreg-1])); in iselInt64Expr_wrk()
3738 addInstr(env, mk_iMOVds_RR(tLo, argregs[argreg])); in iselInt64Expr_wrk()
3763 static HReg iselFltExpr ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselFltExpr() argument
3765 HReg r = iselFltExpr_wrk( env, e, IEndianess ); in iselFltExpr()
3775 static HReg iselFltExpr_wrk ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselFltExpr_wrk() argument
3777 Bool mode64 = env->mode64; in iselFltExpr_wrk()
3779 IRType ty = typeOfIRExpr(env->type_env,e); in iselFltExpr_wrk()
3783 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselFltExpr_wrk()
3788 HReg r_dst = newVRegF(env); in iselFltExpr_wrk()
3790 am_addr = iselWordExpr_AMode(env, e->Iex.Load.addr, Ity_F32/*xfer*/, in iselFltExpr_wrk()
3792 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 4, r_dst, am_addr)); in iselFltExpr_wrk()
3797 HReg r_dst = newVRegF(env); in iselFltExpr_wrk()
3799 GuestStatePtr(env->mode64) ); in iselFltExpr_wrk()
3800 addInstr(env, PPCInstr_FpLdSt( True/*load*/, 4, r_dst, am_addr )); in iselFltExpr_wrk()
3833 HReg fsrc = iselDblExpr(env, e->Iex.Unop.arg, IEndianess); in iselFltExpr_wrk()
3834 HReg fdst = newVRegF(env); in iselFltExpr_wrk()
3835 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselFltExpr_wrk()
3837 sub_from_sp( env, 16 ); in iselFltExpr_wrk()
3839 addInstr(env, PPCInstr_FpLdSt( False/*store*/, 4, in iselFltExpr_wrk()
3842 addInstr(env, PPCInstr_FpLdSt( True/*load*/, 4, in iselFltExpr_wrk()
3844 add_to_sp( env, 16 ); in iselFltExpr_wrk()
3850 HReg fdst = newVRegF(env); in iselFltExpr_wrk()
3851 HReg isrc = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselFltExpr_wrk()
3852 HReg r1 = StackFramePtr(env->mode64); in iselFltExpr_wrk()
3856 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselFltExpr_wrk()
3858 sub_from_sp( env, 16 ); in iselFltExpr_wrk()
3860 addInstr(env, PPCInstr_Store(8, zero_r1, isrc, True/*mode64*/)); in iselFltExpr_wrk()
3861 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fdst, zero_r1)); in iselFltExpr_wrk()
3862 addInstr(env, PPCInstr_FpCftI(True/*I->F*/, False/*int64*/, in iselFltExpr_wrk()
3866 add_to_sp( env, 16 ); in iselFltExpr_wrk()
3869 //set_FPU_rounding_default( env ); in iselFltExpr_wrk()
3873 HReg fdst = newVRegF(env); in iselFltExpr_wrk()
3875 HReg r1 = StackFramePtr(env->mode64); in iselFltExpr_wrk()
3879 iselInt64Expr(&isrcHi, &isrcLo, env, e->Iex.Binop.arg2, IEndianess); in iselFltExpr_wrk()
3882 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselFltExpr_wrk()
3884 sub_from_sp( env, 16 ); in iselFltExpr_wrk()
3886 addInstr(env, PPCInstr_Store(4, zero_r1, isrcHi, False/*mode32*/)); in iselFltExpr_wrk()
3887 addInstr(env, PPCInstr_Store(4, four_r1, isrcLo, False/*mode32*/)); in iselFltExpr_wrk()
3888 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fdst, zero_r1)); in iselFltExpr_wrk()
3889 addInstr(env, PPCInstr_FpCftI(True/*I->F*/, False/*int64*/, in iselFltExpr_wrk()
3893 add_to_sp( env, 16 ); in iselFltExpr_wrk()
3896 //set_FPU_rounding_default( env ); in iselFltExpr_wrk()
3935 static HReg iselDblExpr ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselDblExpr() argument
3937 HReg r = iselDblExpr_wrk( env, e, IEndianess ); in iselDblExpr()
3947 static HReg iselDblExpr_wrk ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselDblExpr_wrk() argument
3949 Bool mode64 = env->mode64; in iselDblExpr_wrk()
3950 IRType ty = typeOfIRExpr(env->type_env,e); in iselDblExpr_wrk()
3955 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselDblExpr_wrk()
3976 HReg r_srcHi = newVRegI(env); in iselDblExpr_wrk()
3977 HReg r_srcLo = newVRegI(env); in iselDblExpr_wrk()
3978 addInstr(env, PPCInstr_LI(r_srcHi, u.u32x2[0], mode64)); in iselDblExpr_wrk()
3979 addInstr(env, PPCInstr_LI(r_srcLo, u.u32x2[1], mode64)); in iselDblExpr_wrk()
3980 return mk_LoadRR32toFPR( env, r_srcHi, r_srcLo ); in iselDblExpr_wrk()
3982 HReg r_src = newVRegI(env); in iselDblExpr_wrk()
3983 addInstr(env, PPCInstr_LI(r_src, u.u64, mode64)); in iselDblExpr_wrk()
3984 return mk_LoadR64toFPR( env, r_src ); // 1*I64 -> F64 in iselDblExpr_wrk()
3990 HReg r_dst = newVRegF(env); in iselDblExpr_wrk()
3993 am_addr = iselWordExpr_AMode(env, e->Iex.Load.addr, Ity_F64/*xfer*/, in iselDblExpr_wrk()
3995 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, r_dst, am_addr)); in iselDblExpr_wrk()
4001 HReg r_dst = newVRegF(env); in iselDblExpr_wrk()
4004 addInstr(env, PPCInstr_FpLdSt( True/*load*/, 8, r_dst, am_addr )); in iselDblExpr_wrk()
4019 HReg r_dst = newVRegF(env); in iselDblExpr_wrk()
4020 HReg r_srcML = iselDblExpr(env, e->Iex.Qop.details->arg2, in iselDblExpr_wrk()
4022 HReg r_srcMR = iselDblExpr(env, e->Iex.Qop.details->arg3, in iselDblExpr_wrk()
4024 HReg r_srcAcc = iselDblExpr(env, e->Iex.Qop.details->arg4, in iselDblExpr_wrk()
4026 set_FPU_rounding_mode( env, e->Iex.Qop.details->arg1, IEndianess ); in iselDblExpr_wrk()
4027 addInstr(env, PPCInstr_FpMulAcc(fpop, r_dst, in iselDblExpr_wrk()
4048 HReg r_dst = newVRegF(env); in iselDblExpr_wrk()
4049 HReg r_srcL = iselDblExpr(env, triop->arg2, IEndianess); in iselDblExpr_wrk()
4050 HReg r_srcR = iselDblExpr(env, triop->arg3, IEndianess); in iselDblExpr_wrk()
4051 set_FPU_rounding_mode( env, triop->arg1, IEndianess ); in iselDblExpr_wrk()
4052 addInstr(env, PPCInstr_FpBinary(fpop, r_dst, r_srcL, r_srcR)); in iselDblExpr_wrk()
4064 HReg fr_dst = newVRegF(env); in iselDblExpr_wrk()
4065 HReg fr_src = iselDblExpr(env, e->Iex.Binop.arg2, IEndianess); in iselDblExpr_wrk()
4066 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDblExpr_wrk()
4067 addInstr(env, PPCInstr_FpUnary(fpop, fr_dst, fr_src)); in iselDblExpr_wrk()
4075 HReg r_dst = newVRegF(env); in iselDblExpr_wrk()
4076 HReg r_src = iselDblExpr(env, e->Iex.Binop.arg2, IEndianess); in iselDblExpr_wrk()
4077 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDblExpr_wrk()
4078 addInstr(env, PPCInstr_FpRSP(r_dst, r_src)); in iselDblExpr_wrk()
4079 //set_FPU_rounding_default( env ); in iselDblExpr_wrk()
4085 HReg fdst = newVRegF(env); in iselDblExpr_wrk()
4086 HReg isrc = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselDblExpr_wrk()
4087 HReg r1 = StackFramePtr(env->mode64); in iselDblExpr_wrk()
4091 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDblExpr_wrk()
4093 sub_from_sp( env, 16 ); in iselDblExpr_wrk()
4095 addInstr(env, PPCInstr_Store(8, zero_r1, isrc, True/*mode64*/)); in iselDblExpr_wrk()
4096 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fdst, zero_r1)); in iselDblExpr_wrk()
4097 addInstr(env, PPCInstr_FpCftI(True/*I->F*/, False/*int64*/, in iselDblExpr_wrk()
4102 add_to_sp( env, 16 ); in iselDblExpr_wrk()
4105 //set_FPU_rounding_default( env ); in iselDblExpr_wrk()
4109 HReg fdst = newVRegF(env); in iselDblExpr_wrk()
4111 HReg r1 = StackFramePtr(env->mode64); in iselDblExpr_wrk()
4115 iselInt64Expr(&isrcHi, &isrcLo, env, e->Iex.Binop.arg2, in iselDblExpr_wrk()
4119 set_FPU_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDblExpr_wrk()
4121 sub_from_sp( env, 16 ); in iselDblExpr_wrk()
4123 addInstr(env, PPCInstr_Store(4, zero_r1, isrcHi, False/*mode32*/)); in iselDblExpr_wrk()
4124 addInstr(env, PPCInstr_Store(4, four_r1, isrcLo, False/*mode32*/)); in iselDblExpr_wrk()
4125 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fdst, zero_r1)); in iselDblExpr_wrk()
4126 addInstr(env, PPCInstr_FpCftI(True/*I->F*/, False/*int64*/, in iselDblExpr_wrk()
4131 add_to_sp( env, 16 ); in iselDblExpr_wrk()
4134 //set_FPU_rounding_default( env ); in iselDblExpr_wrk()
4154 HReg fr_dst = newVRegF(env); in iselDblExpr_wrk()
4155 HReg fr_src = iselDblExpr(env, e->Iex.Unop.arg, IEndianess); in iselDblExpr_wrk()
4156 addInstr(env, PPCInstr_FpUnary(fpop, fr_dst, fr_src)); in iselDblExpr_wrk()
4168 iselInt64Expr( &r_srcHi, &r_srcLo, env, e->Iex.Unop.arg, in iselDblExpr_wrk()
4170 return mk_LoadRR32toFPR( env, r_srcHi, r_srcLo ); in iselDblExpr_wrk()
4172 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselDblExpr_wrk()
4173 return mk_LoadR64toFPR( env, r_src ); in iselDblExpr_wrk()
4182 HReg src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselDblExpr_wrk()
4183 HReg fr_dst = newVRegF(env); in iselDblExpr_wrk()
4186 sub_from_sp( env, 16 ); // Move SP down 16 bytes in iselDblExpr_wrk()
4187 am_addr = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselDblExpr_wrk()
4190 addInstr(env, PPCInstr_Store( 4, am_addr, src, env->mode64 )); in iselDblExpr_wrk()
4194 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 4, fr_dst, am_addr)); in iselDblExpr_wrk()
4196 add_to_sp( env, 16 ); // Reset SP in iselDblExpr_wrk()
4202 HReg res = iselFltExpr(env, e->Iex.Unop.arg, IEndianess); in iselDblExpr_wrk()
4213 && typeOfIRExpr(env->type_env,e->Iex.ITE.cond) == Ity_I1) { in iselDblExpr_wrk()
4214 HReg fr1 = iselDblExpr(env, e->Iex.ITE.iftrue, IEndianess); in iselDblExpr_wrk()
4215 HReg fr0 = iselDblExpr(env, e->Iex.ITE.iffalse, IEndianess); in iselDblExpr_wrk()
4216 HReg fr_dst = newVRegF(env); in iselDblExpr_wrk()
4217 addInstr(env, PPCInstr_FpUnary( Pfp_MOV, fr_dst, fr0 )); in iselDblExpr_wrk()
4218 PPCCondCode cc = iselCondCode(env, e->Iex.ITE.cond, IEndianess); in iselDblExpr_wrk()
4219 addInstr(env, PPCInstr_FpCMov( cc, fr_dst, fr1 )); in iselDblExpr_wrk()
4229 static HReg iselDfp32Expr(ISelEnv* env, IRExpr* e, IREndness IEndianess) in iselDfp32Expr() argument
4231 HReg r = iselDfp32Expr_wrk( env, e, IEndianess ); in iselDfp32Expr()
4238 static HReg iselDfp32Expr_wrk(ISelEnv* env, IRExpr* e, IREndness IEndianess) in iselDfp32Expr_wrk() argument
4240 Bool mode64 = env->mode64; in iselDfp32Expr_wrk()
4241 IRType ty = typeOfIRExpr( env->type_env, e ); in iselDfp32Expr_wrk()
4248 HReg r_dst = newVRegF( env ); in iselDfp32Expr_wrk()
4251 addInstr( env, PPCInstr_FpLdSt( True/*load*/, 8, r_dst, am_addr ) ); in iselDfp32Expr_wrk()
4258 HReg r_dst = newVRegF(env); in iselDfp32Expr_wrk()
4260 am_addr = iselWordExpr_AMode(env, e->Iex.Load.addr, Ity_D32/*xfer*/, in iselDfp32Expr_wrk()
4262 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 4, r_dst, am_addr)); in iselDfp32Expr_wrk()
4269 HReg fr_dst = newVRegF(env); in iselDfp32Expr_wrk()
4270 HReg fr_src = iselDfp64Expr(env, e->Iex.Binop.arg2, IEndianess); in iselDfp32Expr_wrk()
4271 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDfp32Expr_wrk()
4272 addInstr(env, PPCInstr_Dfp64Unary(Pfp_DRSP, fr_dst, fr_src)); in iselDfp32Expr_wrk()
4281 static HReg iselDfp64Expr(ISelEnv* env, IRExpr* e, IREndness IEndianess) in iselDfp64Expr() argument
4283 HReg r = iselDfp64Expr_wrk( env, e, IEndianess ); in iselDfp64Expr()
4290 static HReg iselDfp64Expr_wrk(ISelEnv* env, IRExpr* e, IREndness IEndianess) in iselDfp64Expr_wrk() argument
4292 Bool mode64 = env->mode64; in iselDfp64Expr_wrk()
4293 IRType ty = typeOfIRExpr( env->type_env, e ); in iselDfp64Expr_wrk()
4300 return lookupIRTemp( env, e->Iex.RdTmp.tmp ); in iselDfp64Expr_wrk()
4305 HReg r_dst = newVRegF( env ); in iselDfp64Expr_wrk()
4308 addInstr( env, PPCInstr_FpLdSt( True/*load*/, 8, r_dst, am_addr ) ); in iselDfp64Expr_wrk()
4314 HReg r_dst = newVRegF(env); in iselDfp64Expr_wrk()
4316 am_addr = iselWordExpr_AMode(env, e->Iex.Load.addr, Ity_D64/*xfer*/, in iselDfp64Expr_wrk()
4318 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, r_dst, am_addr)); in iselDfp64Expr_wrk()
4324 HReg r_dst = newVRegF( env ); in iselDfp64Expr_wrk()
4329 HReg fr_dst = newVRegF(env); in iselDfp64Expr_wrk()
4336 iselInt64Expr( &r_srcHi, &r_srcLo, env, e->Iex.Unop.arg, in iselDfp64Expr_wrk()
4338 return mk_LoadRR32toFPR( env, r_srcHi, r_srcLo ); in iselDfp64Expr_wrk()
4340 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselDfp64Expr_wrk()
4341 return mk_LoadR64toFPR( env, r_src ); in iselDfp64Expr_wrk()
4345 HReg fr_src = iselDfp32Expr(env, e->Iex.Unop.arg, IEndianess); in iselDfp64Expr_wrk()
4346 addInstr(env, PPCInstr_Dfp64Unary(Pfp_DCTDP, fr_dst, fr_src)); in iselDfp64Expr_wrk()
4350 iselDfp128Expr( &r_dstHi, &r_dstLo, env, e->Iex.Unop.arg, in iselDfp64Expr_wrk()
4354 iselDfp128Expr( &r_dstHi, &r_dstLo, env, e->Iex.Unop.arg, in iselDfp64Expr_wrk()
4358 HReg fr_srcL = iselDblExpr(env, e->Iex.Binop.arg1, IEndianess); in iselDfp64Expr_wrk()
4359 HReg fr_srcR = iselDblExpr(env, e->Iex.Binop.arg2, IEndianess); in iselDfp64Expr_wrk()
4361 addInstr(env, PPCInstr_Dfp64Binary(Pfp_DIEX, fr_dst, fr_srcL, in iselDfp64Expr_wrk()
4373 HReg fr_dst = newVRegF(env); in iselDfp64Expr_wrk()
4383 HReg r_srcHi = newVRegF(env); in iselDfp64Expr_wrk()
4384 HReg r_srcLo = newVRegF(env); in iselDfp64Expr_wrk()
4386 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDfp64Expr_wrk()
4387 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Binop.arg2, in iselDfp64Expr_wrk()
4389 addInstr(env, PPCInstr_DfpD128toD64(fpop, fr_dst, r_srcHi, r_srcLo)); in iselDfp64Expr_wrk()
4393 HReg fr_src = newVRegF(env); in iselDfp64Expr_wrk()
4394 PPCRI* r_rmc = iselWordExpr_RI(env, e->Iex.Binop.arg1, IEndianess); in iselDfp64Expr_wrk()
4401 fr_src = iselDfp64Expr(env, e->Iex.Binop.arg2, IEndianess); in iselDfp64Expr_wrk()
4402 addInstr(env, PPCInstr_DfpRound(fr_dst, fr_src, r_rmc)); in iselDfp64Expr_wrk()
4406 HReg fr_src = iselDfp64Expr(env, e->Iex.Binop.arg2, IEndianess); in iselDfp64Expr_wrk()
4407 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDfp64Expr_wrk()
4408 addInstr(env, PPCInstr_Dfp64Unary(fpop, fr_dst, fr_src)); in iselDfp64Expr_wrk()
4412 HReg fr_src = newVRegF(env); in iselDfp64Expr_wrk()
4413 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselDfp64Expr_wrk()
4415 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDfp64Expr_wrk()
4416 sub_from_sp( env, 16 ); in iselDfp64Expr_wrk()
4420 HReg tmp = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselDfp64Expr_wrk()
4422 addInstr(env, PPCInstr_Store(8, zero_r1, tmp, True/*mode64*/)); in iselDfp64Expr_wrk()
4425 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselDfp64Expr_wrk()
4427 iselInt64Expr(&tmpHi, &tmpLo, env, e->Iex.Binop.arg2, in iselDfp64Expr_wrk()
4429 addInstr(env, PPCInstr_Store(4, zero_r1, tmpHi, False/*mode32*/)); in iselDfp64Expr_wrk()
4430 addInstr(env, PPCInstr_Store(4, four_r1, tmpLo, False/*mode32*/)); in iselDfp64Expr_wrk()
4433 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fr_src, zero_r1)); in iselDfp64Expr_wrk()
4434 addInstr(env, PPCInstr_Dfp64Unary(fpop, fr_dst, fr_src)); in iselDfp64Expr_wrk()
4435 add_to_sp( env, 16 ); in iselDfp64Expr_wrk()
4446 HReg fr_src = iselDfp64Expr(env, e->Iex.Binop.arg1, IEndianess); in iselDfp64Expr_wrk()
4447 PPCRI* shift = iselWordExpr_RI(env, e->Iex.Binop.arg2, IEndianess); in iselDfp64Expr_wrk()
4452 addInstr(env, PPCInstr_DfpShift(fpop, fr_dst, fr_src, shift)); in iselDfp64Expr_wrk()
4463 HReg fr_srcL = newVRegF(env); in iselDfp64Expr_wrk()
4464 HReg fr_srcR = iselDfp64Expr(env, e->Iex.Binop.arg2, IEndianess); in iselDfp64Expr_wrk()
4465 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselDfp64Expr_wrk()
4466 sub_from_sp( env, 16 ); in iselDfp64Expr_wrk()
4468 if (env->mode64) { in iselDfp64Expr_wrk()
4470 HReg tmp = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselDfp64Expr_wrk()
4472 addInstr(env, PPCInstr_Store(8, zero_r1, tmp, True/*mode64*/)); in iselDfp64Expr_wrk()
4477 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselDfp64Expr_wrk()
4479 iselInt64Expr(&tmpHi, &tmpLo, env, e->Iex.Binop.arg1, in iselDfp64Expr_wrk()
4481 addInstr(env, PPCInstr_Store(4, zero_r1, tmpHi, False/*!mode64*/)); in iselDfp64Expr_wrk()
4482 addInstr(env, PPCInstr_Store(4, four_r1, tmpLo, False/*!mode64*/)); in iselDfp64Expr_wrk()
4484 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fr_srcL, zero_r1)); in iselDfp64Expr_wrk()
4485 addInstr(env, PPCInstr_Dfp64Binary(fpop, fr_dst, fr_srcL, in iselDfp64Expr_wrk()
4487 add_to_sp( env, 16 ); in iselDfp64Expr_wrk()
4513 HReg r_dst = newVRegF( env ); in iselDfp64Expr_wrk()
4514 HReg r_srcL = iselDfp64Expr( env, triop->arg2, IEndianess ); in iselDfp64Expr_wrk()
4515 HReg r_srcR = iselDfp64Expr( env, triop->arg3, IEndianess ); in iselDfp64Expr_wrk()
4517 set_FPU_DFP_rounding_mode( env, triop->arg1, IEndianess ); in iselDfp64Expr_wrk()
4518 addInstr( env, PPCInstr_Dfp64Binary( fpop, r_dst, r_srcL, r_srcR ) ); in iselDfp64Expr_wrk()
4528 HReg r_dst = newVRegF(env); in iselDfp64Expr_wrk()
4529 HReg r_srcL = iselDfp64Expr(env, triop->arg2, IEndianess); in iselDfp64Expr_wrk()
4530 HReg r_srcR = iselDfp64Expr(env, triop->arg3, IEndianess); in iselDfp64Expr_wrk()
4531 PPCRI* rmc = iselWordExpr_RI(env, triop->arg1, IEndianess); in iselDfp64Expr_wrk()
4532 addInstr(env, PPCInstr_DfpQuantize(fpop, r_dst, r_srcL, r_srcR, in iselDfp64Expr_wrk()
4537 HReg r_dst = newVRegF(env); in iselDfp64Expr_wrk()
4538 HReg r_srcL = newVRegF(env); in iselDfp64Expr_wrk()
4539 HReg r_srcR = iselDfp64Expr(env, triop->arg3, IEndianess); in iselDfp64Expr_wrk()
4540 PPCRI* rmc = iselWordExpr_RI(env, triop->arg1, IEndianess); in iselDfp64Expr_wrk()
4541 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselDfp64Expr_wrk()
4542 HReg i8_val = iselWordExpr_R(env, triop->arg2, IEndianess); in iselDfp64Expr_wrk()
4545 sub_from_sp( env, 16 ); in iselDfp64Expr_wrk()
4547 addInstr(env, PPCInstr_Store(8, zero_r1, i8_val, True/*mode64*/)); in iselDfp64Expr_wrk()
4549 addInstr(env, PPCInstr_Store(4, zero_r1, i8_val, False/*mode32*/)); in iselDfp64Expr_wrk()
4551 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, r_srcL, zero_r1)); in iselDfp64Expr_wrk()
4552 add_to_sp( env, 16 ); in iselDfp64Expr_wrk()
4555 addInstr(env, PPCInstr_DfpQuantize(fpop, r_dst, r_srcL, r_srcR, rmc)); in iselDfp64Expr_wrk()
4564 static void iselDfp128Expr(HReg* rHi, HReg* rLo, ISelEnv* env, IRExpr* e, in iselDfp128Expr() argument
4567 iselDfp128Expr_wrk( rHi, rLo, env, e, IEndianess ); in iselDfp128Expr()
4573 static void iselDfp128Expr_wrk(HReg* rHi, HReg *rLo, ISelEnv* env, IRExpr* e, in iselDfp128Expr_wrk() argument
4577 vassert( typeOfIRExpr(env->type_env,e) == Ity_D128 ); in iselDfp128Expr_wrk()
4581 lookupIRTempPair( rHi, rLo, env, e->Iex.RdTmp.tmp ); in iselDfp128Expr_wrk()
4586 HReg r_dstHi = newVRegF(env); in iselDfp128Expr_wrk()
4587 HReg r_dstLo = newVRegF(env); in iselDfp128Expr_wrk()
4590 HReg fr_src = newVRegF(env); in iselDfp128Expr_wrk()
4591 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselDfp128Expr_wrk()
4594 if (env->mode64) { in iselDfp128Expr_wrk()
4595 HReg tmp = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselDfp128Expr_wrk()
4596 addInstr(env, PPCInstr_Store(8, zero_r1, tmp, True/*mode64*/)); in iselDfp128Expr_wrk()
4599 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselDfp128Expr_wrk()
4601 iselInt64Expr(&tmpHi, &tmpLo, env, e->Iex.Unop.arg, in iselDfp128Expr_wrk()
4603 addInstr(env, PPCInstr_Store(4, zero_r1, tmpHi, False/*mode32*/)); in iselDfp128Expr_wrk()
4604 addInstr(env, PPCInstr_Store(4, four_r1, tmpLo, False/*mode32*/)); in iselDfp128Expr_wrk()
4607 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, fr_src, zero_r1)); in iselDfp128Expr_wrk()
4608 addInstr(env, PPCInstr_DfpI64StoD128(Pfp_DCFFIXQ, r_dstHi, r_dstLo, in iselDfp128Expr_wrk()
4613 HReg r_src = iselDfp64Expr(env, e->Iex.Unop.arg, IEndianess); in iselDfp128Expr_wrk()
4619 addInstr(env, PPCInstr_Dfp128Unary(Pfp_DCTQPQ, r_dstHi, r_dstLo, in iselDfp128Expr_wrk()
4634 r_srcHi = iselDfp64Expr( env, e->Iex.Binop.arg1, IEndianess ); in iselDfp128Expr_wrk()
4635 r_srcLo = iselDfp64Expr( env, e->Iex.Binop.arg2, IEndianess ); in iselDfp128Expr_wrk()
4642 HReg fr_dst = newVRegF(env); in iselDfp128Expr_wrk()
4644 set_FPU_DFP_rounding_mode( env, e->Iex.Binop.arg1, IEndianess ); in iselDfp128Expr_wrk()
4645 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Binop.arg2, in iselDfp128Expr_wrk()
4647 addInstr(env, PPCInstr_DfpD128toD64(fpop, fr_dst, r_srcHi, r_srcLo)); in iselDfp128Expr_wrk()
4658 HReg fr_dst_hi = newVRegF(env); in iselDfp128Expr_wrk()
4659 HReg fr_dst_lo = newVRegF(env); in iselDfp128Expr_wrk()
4660 PPCRI* shift = iselWordExpr_RI(env, e->Iex.Binop.arg2, IEndianess); in iselDfp128Expr_wrk()
4663 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Binop.arg1, in iselDfp128Expr_wrk()
4669 addInstr(env, PPCInstr_DfpShift128(fpop, fr_dst_hi, fr_dst_lo, in iselDfp128Expr_wrk()
4677 HReg r_dstHi = newVRegF(env); in iselDfp128Expr_wrk()
4678 HReg r_dstLo = newVRegF(env); in iselDfp128Expr_wrk()
4679 PPCRI* r_rmc = iselWordExpr_RI(env, e->Iex.Binop.arg1, IEndianess); in iselDfp128Expr_wrk()
4682 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Binop.arg2, in iselDfp128Expr_wrk()
4685 addInstr(env, PPCInstr_DfpRound128(r_dstHi, r_dstLo, in iselDfp128Expr_wrk()
4692 HReg r_dstHi = newVRegF(env); in iselDfp128Expr_wrk()
4693 HReg r_dstLo = newVRegF(env); in iselDfp128Expr_wrk()
4694 HReg r_srcL = newVRegF(env); in iselDfp128Expr_wrk()
4695 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselDfp128Expr_wrk()
4696 r_srcHi = newVRegF(env); in iselDfp128Expr_wrk()
4697 r_srcLo = newVRegF(env); in iselDfp128Expr_wrk()
4699 iselDfp128Expr(&r_srcHi, &r_srcLo, env, e->Iex.Binop.arg2, in iselDfp128Expr_wrk()
4703 if (env->mode64) { in iselDfp128Expr_wrk()
4704 HReg tmp = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselDfp128Expr_wrk()
4705 addInstr(env, PPCInstr_Store(8, zero_r1, tmp, True/*mode64*/)); in iselDfp128Expr_wrk()
4708 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselDfp128Expr_wrk()
4710 iselInt64Expr(&tmpHi, &tmpLo, env, e->Iex.Unop.arg, in iselDfp128Expr_wrk()
4712 addInstr(env, PPCInstr_Store(4, zero_r1, tmpHi, False/*mode32*/)); in iselDfp128Expr_wrk()
4713 addInstr(env, PPCInstr_Store(4, four_r1, tmpLo, False/*mode32*/)); in iselDfp128Expr_wrk()
4716 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, r_srcL, zero_r1)); in iselDfp128Expr_wrk()
4717 addInstr(env, PPCInstr_InsertExpD128(Pfp_DIEXQ, in iselDfp128Expr_wrk()
4734 HReg r_dstHi = newVRegF(env); in iselDfp128Expr_wrk()
4735 HReg r_dstLo = newVRegF(env); in iselDfp128Expr_wrk()
4755 HReg r_srcRHi = newVRegV( env ); in iselDfp128Expr_wrk()
4756 HReg r_srcRLo = newVRegV( env ); in iselDfp128Expr_wrk()
4759 iselDfp128Expr( &r_dstHi, &r_dstLo, env, triop->arg2, IEndianess ); in iselDfp128Expr_wrk()
4760 iselDfp128Expr( &r_srcRHi, &r_srcRLo, env, triop->arg3, IEndianess ); in iselDfp128Expr_wrk()
4761 set_FPU_DFP_rounding_mode( env, triop->arg1, IEndianess ); in iselDfp128Expr_wrk()
4762 addInstr( env, in iselDfp128Expr_wrk()
4775 HReg r_srcHi = newVRegF(env); in iselDfp128Expr_wrk()
4776 HReg r_srcLo = newVRegF(env); in iselDfp128Expr_wrk()
4777 PPCRI* rmc = iselWordExpr_RI(env, triop->arg1, IEndianess); in iselDfp128Expr_wrk()
4780 iselDfp128Expr(&r_dstHi, &r_dstLo, env, triop->arg2, IEndianess); in iselDfp128Expr_wrk()
4781 iselDfp128Expr(&r_srcHi, &r_srcLo, env, triop->arg3, IEndianess); in iselDfp128Expr_wrk()
4784 addInstr(env, PPCInstr_DfpQuantize128(fpop, r_dstHi, r_dstLo, in iselDfp128Expr_wrk()
4791 HReg r_srcHi = newVRegF(env); in iselDfp128Expr_wrk()
4792 HReg r_srcLo = newVRegF(env); in iselDfp128Expr_wrk()
4793 PPCRI* rmc = iselWordExpr_RI(env, triop->arg1, IEndianess); in iselDfp128Expr_wrk()
4794 PPCAMode* zero_r1 = PPCAMode_IR( 0, StackFramePtr(env->mode64) ); in iselDfp128Expr_wrk()
4795 PPCAMode* four_r1 = PPCAMode_IR( 4, StackFramePtr(env->mode64) ); in iselDfp128Expr_wrk()
4796 HReg i8_val = iselWordExpr_R(env, triop->arg2, IEndianess); in iselDfp128Expr_wrk()
4797 HReg r_zero = newVRegI( env ); in iselDfp128Expr_wrk()
4799 iselDfp128Expr(&r_srcHi, &r_srcLo, env, triop->arg3, IEndianess); in iselDfp128Expr_wrk()
4807 sub_from_sp( env, 16 ); in iselDfp128Expr_wrk()
4809 if (env->mode64) in iselDfp128Expr_wrk()
4810 addInstr(env, PPCInstr_Store(4, four_r1, i8_val, True/*mode64*/)); in iselDfp128Expr_wrk()
4812 addInstr(env, PPCInstr_Store(4, four_r1, i8_val, False/*mode32*/)); in iselDfp128Expr_wrk()
4817 addInstr( env, PPCInstr_LI( r_zero, 0, env->mode64 ) ); in iselDfp128Expr_wrk()
4818 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, r_dstHi, zero_r1)); in iselDfp128Expr_wrk()
4819 addInstr(env, PPCInstr_FpLdSt(True/*load*/, 8, r_dstLo, zero_r1)); in iselDfp128Expr_wrk()
4821 add_to_sp( env, 16 ); in iselDfp128Expr_wrk()
4824 addInstr(env, PPCInstr_DfpQuantize128(fpop, r_dstHi, r_dstLo, in iselDfp128Expr_wrk()
4841 static HReg iselVecExpr ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselVecExpr() argument
4843 HReg r = iselVecExpr_wrk( env, e, IEndianess ); in iselVecExpr()
4853 static HReg iselVecExpr_wrk ( ISelEnv* env, IRExpr* e, IREndness IEndianess ) in iselVecExpr_wrk() argument
4855 Bool mode64 = env->mode64; in iselVecExpr_wrk()
4858 IRType ty = typeOfIRExpr(env->type_env,e); in iselVecExpr_wrk()
4863 return lookupIRTemp(env, e->Iex.RdTmp.tmp); in iselVecExpr_wrk()
4869 HReg dst = newVRegV(env); in iselVecExpr_wrk()
4870 addInstr(env, in iselVecExpr_wrk()
4891 HReg Vhi = newVRegV(env); in iselVecExpr_wrk()
4892 HReg Vlo = newVRegV(env); in iselVecExpr_wrk()
4893 HReg Vp = newVRegV(env); in iselVecExpr_wrk()
4894 HReg v_dst = newVRegV(env); in iselVecExpr_wrk()
4896 HReg rB_plus_15 = newVRegI(env); in iselVecExpr_wrk()
4899 rB = iselWordExpr_R( env, e->Iex.Load.addr, IEndianess ); in iselVecExpr_wrk()
4902 addInstr(env, PPCInstr_AvLdSt( True/*load*/, 16, Vhi, in iselVecExpr_wrk()
4907 addInstr(env, PPCInstr_AvSh( False/*right shift*/, Vp, in iselVecExpr_wrk()
4911 addInstr(env, PPCInstr_AvSh( True/*left shift*/, Vp, in iselVecExpr_wrk()
4915 addInstr(env, PPCInstr_Alu( Palu_ADD, rB_plus_15, in iselVecExpr_wrk()
4919 addInstr(env, PPCInstr_AvLdSt( True/*load*/, 16, Vlo, in iselVecExpr_wrk()
4924 addInstr(env, PPCInstr_AvPerm( v_dst, Vlo, Vhi, Vp )); in iselVecExpr_wrk()
4927 addInstr(env, PPCInstr_AvPerm( v_dst, Vhi, Vlo, Vp )); in iselVecExpr_wrk()
4936 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
4937 HReg dst = newVRegV(env); in iselVecExpr_wrk()
4938 addInstr(env, PPCInstr_AvUnary(Pav_NOT, dst, arg)); in iselVecExpr_wrk()
4943 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
4944 HReg zero = newVRegV(env); in iselVecExpr_wrk()
4945 HReg dst = newVRegV(env); in iselVecExpr_wrk()
4946 addInstr(env, PPCInstr_AvBinary(Pav_XOR, zero, zero, zero)); in iselVecExpr_wrk()
4947 addInstr(env, PPCInstr_AvBin8x16(Pav_CMPEQU, dst, arg, zero)); in iselVecExpr_wrk()
4948 addInstr(env, PPCInstr_AvUnary(Pav_NOT, dst, dst)); in iselVecExpr_wrk()
4953 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
4954 HReg zero = newVRegV(env); in iselVecExpr_wrk()
4955 HReg dst = newVRegV(env); in iselVecExpr_wrk()
4956 addInstr(env, PPCInstr_AvBinary(Pav_XOR, zero, zero, zero)); in iselVecExpr_wrk()
4957 addInstr(env, PPCInstr_AvBin16x8(Pav_CMPEQU, dst, arg, zero)); in iselVecExpr_wrk()
4958 addInstr(env, PPCInstr_AvUnary(Pav_NOT, dst, dst)); in iselVecExpr_wrk()
4963 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
4964 HReg zero = newVRegV(env); in iselVecExpr_wrk()
4965 HReg dst = newVRegV(env); in iselVecExpr_wrk()
4966 addInstr(env, PPCInstr_AvBinary(Pav_XOR, zero, zero, zero)); in iselVecExpr_wrk()
4967 addInstr(env, PPCInstr_AvBin32x4(Pav_CMPEQU, dst, arg, zero)); in iselVecExpr_wrk()
4968 addInstr(env, PPCInstr_AvUnary(Pav_NOT, dst, dst)); in iselVecExpr_wrk()
4973 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
4974 HReg zero = newVRegV(env); in iselVecExpr_wrk()
4975 HReg dst = newVRegV(env); in iselVecExpr_wrk()
4976 addInstr(env, PPCInstr_AvBinary(Pav_XOR, zero, zero, zero)); in iselVecExpr_wrk()
4977 addInstr(env, PPCInstr_AvBin64x2(Pav_CMPEQU, dst, arg, zero)); in iselVecExpr_wrk()
4978 addInstr(env, PPCInstr_AvUnary(Pav_NOT, dst, dst)); in iselVecExpr_wrk()
4994 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
4995 HReg dst = newVRegV(env); in iselVecExpr_wrk()
4996 addInstr(env, PPCInstr_AvUn32Fx4(fpop, dst, arg)); in iselVecExpr_wrk()
5002 HReg r_src = iselWordExpr_R(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
5003 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5005 sub_from_sp( env, 32 ); // Move SP down in iselVecExpr_wrk()
5008 r_aligned16 = get_sp_aligned16( env ); in iselVecExpr_wrk()
5015 r_zeros = newVRegI(env); in iselVecExpr_wrk()
5016 addInstr(env, PPCInstr_LI(r_zeros, 0x0, mode64)); in iselVecExpr_wrk()
5018 addInstr(env, PPCInstr_Store( 4, am_off0, r_src, mode64 )); in iselVecExpr_wrk()
5020 addInstr(env, PPCInstr_Store( 4, am_off0, r_zeros, mode64 )); in iselVecExpr_wrk()
5021 addInstr(env, PPCInstr_Store( 4, am_off4, r_zeros, mode64 )); in iselVecExpr_wrk()
5022 addInstr(env, PPCInstr_Store( 4, am_off8, r_zeros, mode64 )); in iselVecExpr_wrk()
5026 addInstr(env, PPCInstr_Store( 4, am_off12, r_zeros, mode64 )); in iselVecExpr_wrk()
5028 addInstr(env, PPCInstr_Store( 4, am_off12, r_src, mode64 )); in iselVecExpr_wrk()
5032 addInstr(env, PPCInstr_AvLdSt( True/*ld*/, 4, dst, am_off0 )); in iselVecExpr_wrk()
5034 addInstr(env, PPCInstr_AvLdSt( True/*ld*/, 4, dst, am_off12 )); in iselVecExpr_wrk()
5036 add_to_sp( env, 32 ); // Reset SP in iselVecExpr_wrk()
5043 return mk_AvDuplicateRI(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
5047 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
5048 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5049 addInstr(env, PPCInstr_AvCipherV128Unary(op, dst, arg)); in iselVecExpr_wrk()
5060 HReg arg = iselVecExpr(env, e->Iex.Unop.arg, IEndianess); in iselVecExpr_wrk()
5061 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5062 addInstr(env, PPCInstr_AvUnary(op, dst, arg)); in iselVecExpr_wrk()
5078 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5080 sub_from_sp( env, 32 ); // Move SP down in iselVecExpr_wrk()
5083 r_aligned16 = get_sp_aligned16( env ); in iselVecExpr_wrk()
5090 iselInt64Expr(&r1, &r0, env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5091 addInstr(env, PPCInstr_Store( 4, am_off12, r0, mode64 )); in iselVecExpr_wrk()
5092 addInstr(env, PPCInstr_Store( 4, am_off8, r1, mode64 )); in iselVecExpr_wrk()
5094 iselInt64Expr(&r3, &r2, env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5095 addInstr(env, PPCInstr_Store( 4, am_off4, r2, mode64 )); in iselVecExpr_wrk()
5096 addInstr(env, PPCInstr_Store( 4, am_off0, r3, mode64 )); in iselVecExpr_wrk()
5099 addInstr(env, PPCInstr_AvLdSt(True/*ld*/, 16, dst, am_off0)); in iselVecExpr_wrk()
5101 add_to_sp( env, 32 ); // Reset SP in iselVecExpr_wrk()
5104 HReg rHi = iselWordExpr_R(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5105 HReg rLo = iselWordExpr_R(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5106 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5110 sub_from_sp( env, 32 ); // Move SP down in iselVecExpr_wrk()
5113 r_aligned16 = get_sp_aligned16( env ); in iselVecExpr_wrk()
5119 addInstr(env, PPCInstr_Store( 8, am_off0, rLo, mode64 )); in iselVecExpr_wrk()
5120 addInstr(env, PPCInstr_Store( 8, am_off8, rHi, mode64 )); in iselVecExpr_wrk()
5122 addInstr(env, PPCInstr_Store( 8, am_off0, rHi, mode64 )); in iselVecExpr_wrk()
5123 addInstr(env, PPCInstr_Store( 8, am_off8, rLo, mode64 )); in iselVecExpr_wrk()
5126 addInstr(env, PPCInstr_AvLdSt(True/*ld*/, 16, dst, am_off0)); in iselVecExpr_wrk()
5128 add_to_sp( env, 32 ); // Reset SP in iselVecExpr_wrk()
5140 HReg argL = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5141 HReg argR = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5142 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5143 addInstr(env, PPCInstr_AvBin32Fx4(fpop, dst, argL, argR)); in iselVecExpr_wrk()
5148 HReg argL = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5149 HReg argR = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5150 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5156 HReg isNanLR = newVRegV(env); in iselVecExpr_wrk()
5157 HReg isNanL = isNan(env, argL, IEndianess); in iselVecExpr_wrk()
5158 HReg isNanR = isNan(env, argR, IEndianess); in iselVecExpr_wrk()
5159 addInstr(env, PPCInstr_AvBinary(Pav_OR, isNanLR, in iselVecExpr_wrk()
5162 addInstr(env, PPCInstr_AvBin32Fx4(Pavfp_CMPGTF, dst, in iselVecExpr_wrk()
5164 addInstr(env, PPCInstr_AvBinary(Pav_OR, dst, dst, isNanLR)); in iselVecExpr_wrk()
5165 addInstr(env, PPCInstr_AvUnary(Pav_NOT, dst, dst)); in iselVecExpr_wrk()
5173 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5174 HReg arg2 = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5175 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5176 addInstr(env, PPCInstr_AvBinary(op, dst, arg1, arg2)); in iselVecExpr_wrk()
5205 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5206 HReg arg2 = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5207 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5208 addInstr(env, PPCInstr_AvBin8x16(op, dst, arg1, arg2)); in iselVecExpr_wrk()
5240 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5241 HReg arg2 = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5242 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5243 addInstr(env, PPCInstr_AvBin16x8(op, dst, arg1, arg2)); in iselVecExpr_wrk()
5278 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5279 HReg arg2 = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5280 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5281 addInstr(env, PPCInstr_AvBin32x4(op, dst, arg1, arg2)); in iselVecExpr_wrk()
5305 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5306 HReg arg2 = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5307 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5308 addInstr(env, PPCInstr_AvBin64x2(op, dst, arg1, arg2)); in iselVecExpr_wrk()
5315 HReg r_src = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5316 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5317 HReg v_shft = mk_AvDuplicateRI(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5318 addInstr(env, PPCInstr_AvBin8x16(op, dst, r_src, v_shft)); in iselVecExpr_wrk()
5326 HReg r_src = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5327 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5328 HReg v_shft = mk_AvDuplicateRI(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5329 addInstr(env, PPCInstr_AvBin16x8(op, dst, r_src, v_shft)); in iselVecExpr_wrk()
5337 HReg r_src = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5338 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5339 HReg v_shft = mk_AvDuplicateRI(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5340 addInstr(env, PPCInstr_AvBin32x4(op, dst, r_src, v_shft)); in iselVecExpr_wrk()
5348 HReg r_src = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5349 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5350 HReg v_shft = mk_AvDuplicateRI(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5351 addInstr(env, PPCInstr_AvBin64x2(op, dst, r_src, v_shft)); in iselVecExpr_wrk()
5358 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5359 HReg r_src = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5360 HReg v_shft = mk_AvDuplicateRI(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5362 addInstr(env, PPCInstr_AvBinary(op, dst, r_src, v_shft)); in iselVecExpr_wrk()
5367 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5368 HReg v_src = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5369 HReg v_ctl = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5370 addInstr(env, PPCInstr_AvPerm(dst, v_src, v_src, v_ctl)); in iselVecExpr_wrk()
5379 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5380 HReg arg2 = iselVecExpr(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5381 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5382 addInstr(env, PPCInstr_AvCipherV128Binary(op, dst, arg1, arg2)); in iselVecExpr_wrk()
5389 HReg arg1 = iselVecExpr(env, e->Iex.Binop.arg1, IEndianess); in iselVecExpr_wrk()
5390 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5391 PPCRI* s_field = iselWordExpr_RI(env, e->Iex.Binop.arg2, IEndianess); in iselVecExpr_wrk()
5392 addInstr(env, PPCInstr_AvHashV128Binary(op, dst, arg1, s_field)); in iselVecExpr_wrk()
5406 HReg arg1 = iselVecExpr(env, triop->arg1, IEndianess); in iselVecExpr_wrk()
5407 HReg arg2 = iselVecExpr(env, triop->arg2, IEndianess); in iselVecExpr_wrk()
5408 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5409 PPCRI* ps = iselWordExpr_RI(env, triop->arg3, IEndianess); in iselVecExpr_wrk()
5410 addInstr(env, PPCInstr_AvBCDV128Trinary(op, dst, arg1, arg2, ps)); in iselVecExpr_wrk()
5419 HReg argL = iselVecExpr(env, triop->arg2, IEndianess); in iselVecExpr_wrk()
5420 HReg argR = iselVecExpr(env, triop->arg3, IEndianess); in iselVecExpr_wrk()
5421 HReg dst = newVRegV(env); in iselVecExpr_wrk()
5428 set_FPU_rounding_mode(env, triop->arg1, IEndianess); in iselVecExpr_wrk()
5429 addInstr(env, PPCInstr_AvBin32Fx4(fpop, dst, argL, argR)); in iselVecExpr_wrk()
5442 return generate_zeroes_V128(env); in iselVecExpr_wrk()
5445 return generate_ones_V128(env); in iselVecExpr_wrk()
5451 env->hwcaps)); in iselVecExpr_wrk()
5461 static void iselStmt ( ISelEnv* env, IRStmt* stmt, IREndness IEndianess ) in iselStmt() argument
5463 Bool mode64 = env->mode64; in iselStmt()
5474 IRType tya = typeOfIRExpr(env->type_env, stmt->Ist.Store.addr); in iselStmt()
5475 IRType tyd = typeOfIRExpr(env->type_env, stmt->Ist.Store.data); in iselStmt()
5488 = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/, in iselStmt()
5490 HReg r_src = iselWordExpr_R(env, stmt->Ist.Store.data, IEndianess); in iselStmt()
5491 addInstr(env, PPCInstr_Store( toUChar(sizeofIRType(tyd)), in iselStmt()
5497 = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/, in iselStmt()
5499 HReg fr_src = iselDblExpr(env, stmt->Ist.Store.data, IEndianess); in iselStmt()
5500 addInstr(env, in iselStmt()
5506 = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/, in iselStmt()
5508 HReg fr_src = iselFltExpr(env, stmt->Ist.Store.data, IEndianess); in iselStmt()
5509 addInstr(env, in iselStmt()
5515 = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/, in iselStmt()
5517 HReg fr_src = iselDfp64Expr(env, stmt->Ist.Store.data, IEndianess); in iselStmt()
5518 addInstr(env, in iselStmt()
5524 = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/, in iselStmt()
5526 HReg fr_src = iselDfp32Expr(env, stmt->Ist.Store.data, IEndianess); in iselStmt()
5527 addInstr(env, in iselStmt()
5533 = iselWordExpr_AMode(env, stmt->Ist.Store.addr, tyd/*of xfer*/, in iselStmt()
5535 HReg v_src = iselVecExpr(env, stmt->Ist.Store.data, IEndianess); in iselStmt()
5536 addInstr(env, in iselStmt()
5545 HReg r_addr = iselWordExpr_R(env, stmt->Ist.Store.addr, IEndianess); in iselStmt()
5546 iselInt64Expr( &rHi32, &rLo32, env, stmt->Ist.Store.data, in iselStmt()
5548 addInstr(env, PPCInstr_Store( 4/*byte-store*/, in iselStmt()
5552 addInstr(env, PPCInstr_Store( 4/*byte-store*/, in iselStmt()
5563 IRType ty = typeOfIRExpr(env->type_env, stmt->Ist.Put.data); in iselStmt()
5566 HReg r_src = iselWordExpr_R(env, stmt->Ist.Put.data, IEndianess); in iselStmt()
5569 addInstr(env, PPCInstr_Store( toUChar(sizeofIRType(ty)), in iselStmt()
5577 PPCAMode* am_addr4 = advance4(env, am_addr); in iselStmt()
5578 iselInt64Expr(&rHi,&rLo, env, stmt->Ist.Put.data, IEndianess); in iselStmt()
5579 addInstr(env, PPCInstr_Store( 4, am_addr, rHi, mode64 )); in iselStmt()
5580 addInstr(env, PPCInstr_Store( 4, am_addr4, rLo, mode64 )); in iselStmt()
5586 HReg v_src = iselVecExpr(env, stmt->Ist.Put.data, IEndianess); in iselStmt()
5589 addInstr(env, in iselStmt()
5594 HReg fr_src = iselDblExpr(env, stmt->Ist.Put.data, IEndianess); in iselStmt()
5597 addInstr(env, PPCInstr_FpLdSt( False/*store*/, 8, in iselStmt()
5603 HReg fr_src = iselDfp32Expr( env, stmt->Ist.Put.data, IEndianess ); in iselStmt()
5606 addInstr( env, PPCInstr_FpLdSt( False/*store*/, 8, in iselStmt()
5611 HReg fr_src = iselDfp64Expr( env, stmt->Ist.Put.data, IEndianess ); in iselStmt()
5614 addInstr( env, PPCInstr_FpLdSt( False/*store*/, 8, fr_src, am_addr ) ); in iselStmt()
5626 env, puti->descr, in iselStmt()
5629 IRType ty = typeOfIRExpr(env->type_env, puti->data); in iselStmt()
5631 HReg r_src = iselWordExpr_R(env, puti->data, IEndianess); in iselStmt()
5632 addInstr(env, PPCInstr_Store( toUChar(8), in iselStmt()
5637 HReg r_src = iselWordExpr_R(env, puti->data, IEndianess); in iselStmt()
5638 addInstr(env, PPCInstr_Store( toUChar(4), in iselStmt()
5648 IRType ty = typeOfIRTemp(env->type_env, tmp); in iselStmt()
5651 HReg r_dst = lookupIRTemp(env, tmp); in iselStmt()
5652 HReg r_src = iselWordExpr_R(env, stmt->Ist.WrTmp.data, IEndianess); in iselStmt()
5653 addInstr(env, mk_iMOVds_RR( r_dst, r_src )); in iselStmt()
5659 iselInt64Expr(&r_srcHi,&r_srcLo, env, stmt->Ist.WrTmp.data, in iselStmt()
5661 lookupIRTempPair( &r_dstHi, &r_dstLo, env, tmp); in iselStmt()
5662 addInstr(env, mk_iMOVds_RR(r_dstHi, r_srcHi) ); in iselStmt()
5663 addInstr(env, mk_iMOVds_RR(r_dstLo, r_srcLo) ); in iselStmt()
5668 iselInt128Expr(&r_srcHi,&r_srcLo, env, stmt->Ist.WrTmp.data, in iselStmt()
5670 lookupIRTempPair( &r_dstHi, &r_dstLo, env, tmp); in iselStmt()
5671 addInstr(env, mk_iMOVds_RR(r_dstHi, r_srcHi) ); in iselStmt()
5672 addInstr(env, mk_iMOVds_RR(r_dstLo, r_srcLo) ); in iselStmt()
5681 env, stmt->Ist.WrTmp.data, IEndianess); in iselStmt()
5684 &r_dstLo, env, tmp); in iselStmt()
5686 addInstr(env, mk_iMOVds_RR(r_dstHi, r_srcHi) ); in iselStmt()
5687 addInstr(env, mk_iMOVds_RR(r_dstMedHi, r_srcMedHi) ); in iselStmt()
5688 addInstr(env, mk_iMOVds_RR(r_dstMedLo, r_srcMedLo) ); in iselStmt()
5689 addInstr(env, mk_iMOVds_RR(r_dstLo, r_srcLo) ); in iselStmt()
5693 PPCCondCode cond = iselCondCode(env, stmt->Ist.WrTmp.data, in iselStmt()
5695 HReg r_dst = lookupIRTemp(env, tmp); in iselStmt()
5696 addInstr(env, PPCInstr_Set(cond, r_dst)); in iselStmt()
5700 HReg fr_dst = lookupIRTemp(env, tmp); in iselStmt()
5701 HReg fr_src = iselDblExpr(env, stmt->Ist.WrTmp.data, IEndianess); in iselStmt()
5702 addInstr(env, PPCInstr_FpUnary(Pfp_MOV, fr_dst, fr_src)); in iselStmt()
5706 HReg fr_dst = lookupIRTemp(env, tmp); in iselStmt()
5707 HReg fr_src = iselFltExpr(env, stmt->Ist.WrTmp.data, IEndianess); in iselStmt()
5708 addInstr(env, PPCInstr_FpUnary(Pfp_MOV, fr_dst, fr_src)); in iselStmt()
5712 HReg fr_dst = lookupIRTemp(env, tmp); in iselStmt()
5713 HReg fr_src = iselDfp32Expr(env, stmt->Ist.WrTmp.data, IEndianess); in iselStmt()
5714 addInstr(env, PPCInstr_Dfp64Unary(Pfp_MOV, fr_dst, fr_src)); in iselStmt()
5718 HReg v_dst = lookupIRTemp(env, tmp); in iselStmt()
5719 HReg v_src = iselVecExpr(env, stmt->Ist.WrTmp.data, IEndianess); in iselStmt()
5720 addInstr(env, PPCInstr_AvUnary(Pav_MOV, v_dst, v_src)); in iselStmt()
5724 HReg fr_dst = lookupIRTemp( env, tmp ); in iselStmt()
5725 HReg fr_src = iselDfp64Expr( env, stmt->Ist.WrTmp.data, IEndianess ); in iselStmt()
5726 addInstr( env, PPCInstr_Dfp64Unary( Pfp_MOV, fr_dst, fr_src ) ); in iselStmt()
5731 // lookupDfp128IRTempPair( &fr_dstHi, &fr_dstLo, env, tmp ); in iselStmt()
5732 lookupIRTempPair( &fr_dstHi, &fr_dstLo, env, tmp ); in iselStmt()
5733 iselDfp128Expr( &fr_srcHi, &fr_srcLo, env, stmt->Ist.WrTmp.data, in iselStmt()
5735 addInstr( env, PPCInstr_Dfp64Unary( Pfp_MOV, fr_dstHi, fr_srcHi ) ); in iselStmt()
5736 addInstr( env, PPCInstr_Dfp64Unary( Pfp_MOV, fr_dstLo, fr_srcLo ) ); in iselStmt()
5745 IRType tyRes = typeOfIRTemp(env->type_env, res); in iselStmt()
5746 IRType tyAddr = typeOfIRExpr(env->type_env, stmt->Ist.LLSC.addr); in iselStmt()
5757 HReg r_addr = iselWordExpr_R( env, stmt->Ist.LLSC.addr, IEndianess ); in iselStmt()
5758 HReg r_dst = lookupIRTemp(env, res); in iselStmt()
5760 addInstr(env, PPCInstr_LoadL( 1, r_dst, r_addr, mode64 )); in iselStmt()
5764 addInstr(env, PPCInstr_LoadL( 2, r_dst, r_addr, mode64 )); in iselStmt()
5768 addInstr(env, PPCInstr_LoadL( 4, r_dst, r_addr, mode64 )); in iselStmt()
5772 addInstr(env, PPCInstr_LoadL( 8, r_dst, r_addr, mode64 )); in iselStmt()
5778 HReg r_res = lookupIRTemp(env, res); /* :: Ity_I1 */ in iselStmt()
5779 HReg r_a = iselWordExpr_R(env, stmt->Ist.LLSC.addr, IEndianess); in iselStmt()
5780 HReg r_src = iselWordExpr_R(env, stmt->Ist.LLSC.storedata, in iselStmt()
5782 HReg r_tmp = newVRegI(env); in iselStmt()
5783 IRType tyData = typeOfIRExpr(env->type_env, in iselStmt()
5799 addInstr(env, PPCInstr_StoreC( size, in iselStmt()
5801 addInstr(env, PPCInstr_MfCR( r_tmp )); in iselStmt()
5802 addInstr(env, PPCInstr_Shft( in iselStmt()
5804 env->mode64 ? False : True in iselStmt()
5812 addInstr(env, PPCInstr_Alu( in iselStmt()
5831 retty = typeOfIRTemp(env->type_env, d->tmp); in iselStmt()
5854 doHelperCall( &addToSp, &rloc, env, d->guard, d->cee, retty, d->args, in iselStmt()
5870 HReg r_dst = lookupIRTemp(env, d->tmp); in iselStmt()
5871 addInstr(env, mk_iMOVds_RR(r_dst, hregPPC_GPR3(mode64))); in iselStmt()
5880 HReg r_dst = lookupIRTemp(env, d->tmp); in iselStmt()
5881 addInstr(env, mk_iMOVds_RR(r_dst, hregPPC_GPR3(mode64))); in iselStmt()
5889 lookupIRTempPair( &r_dstHi, &r_dstLo, env, d->tmp); in iselStmt()
5890 addInstr(env, mk_iMOVds_RR(r_dstHi, hregPPC_GPR3(mode64))); in iselStmt()
5891 addInstr(env, mk_iMOVds_RR(r_dstLo, hregPPC_GPR4(mode64))); in iselStmt()
5903 HReg dst = lookupIRTemp(env, d->tmp); in iselStmt()
5905 addInstr(env, PPCInstr_AvLdSt( True/*load*/, 16, dst, am )); in iselStmt()
5906 add_to_sp(env, addToSp); in iselStmt()
5919 addInstr(env, PPCInstr_MFence()); in iselStmt()
5950 PPCCondCode cc = iselCondCode(env, stmt->Ist.Exit.guard, IEndianess); in iselStmt()
5958 if (env->chainingAllowed) { in iselStmt()
5964 ? (((Addr64)stmt->Ist.Exit.dst->Ico.U64) > (Addr64)env->max_ga) in iselStmt()
5965 : (((Addr32)stmt->Ist.Exit.dst->Ico.U32) > (Addr32)env->max_ga); in iselStmt()
5967 addInstr(env, PPCInstr_XDirect( in iselStmt()
5975 HReg r = iselWordExpr_R(env, IRExpr_Const(stmt->Ist.Exit.dst), in iselStmt()
5977 addInstr(env, PPCInstr_XAssisted(r, amCIA, cc, Ijk_Boring)); in iselStmt()
5995 HReg r = iselWordExpr_R(env, IRExpr_Const(stmt->Ist.Exit.dst), in iselStmt()
5997 addInstr(env, PPCInstr_XAssisted(r, amCIA, cc, in iselStmt()
6021 static void iselNext ( ISelEnv* env, in iselNext() argument
6038 vassert(cdst->tag == (env->mode64 ? Ico_U64 :Ico_U32)); in iselNext()
6041 PPCAMode* amCIA = PPCAMode_IR(offsIP, hregPPC_GPR31(env->mode64)); in iselNext()
6042 if (env->chainingAllowed) { in iselNext()
6047 = env->mode64 in iselNext()
6048 ? (((Addr64)cdst->Ico.U64) > (Addr64)env->max_ga) in iselNext()
6049 : (((Addr32)cdst->Ico.U32) > (Addr32)env->max_ga); in iselNext()
6051 addInstr(env, PPCInstr_XDirect( in iselNext()
6052 env->mode64 ? (Addr64)cdst->Ico.U64 in iselNext()
6059 HReg r = iselWordExpr_R(env, next, IEndianess); in iselNext()
6060 addInstr(env, PPCInstr_XAssisted(r, amCIA, always, in iselNext()
6070 HReg r = iselWordExpr_R(env, next, IEndianess); in iselNext()
6071 PPCAMode* amCIA = PPCAMode_IR(offsIP, hregPPC_GPR31(env->mode64)); in iselNext()
6072 if (env->chainingAllowed) { in iselNext()
6073 addInstr(env, PPCInstr_XIndir(r, amCIA, always)); in iselNext()
6075 addInstr(env, PPCInstr_XAssisted(r, amCIA, always, in iselNext()
6097 HReg r = iselWordExpr_R(env, next, IEndianess); in iselNext()
6098 PPCAMode* amCIA = PPCAMode_IR(offsIP, hregPPC_GPR31(env->mode64)); in iselNext()
6099 addInstr(env, PPCInstr_XAssisted(r, amCIA, always, jk)); in iselNext()
6133 ISelEnv* env; in iselSB_PPC() local
6169 env = LibVEX_Alloc_inline(sizeof(ISelEnv)); in iselSB_PPC()
6170 env->vreg_ctr = 0; in iselSB_PPC()
6173 env->mode64 = mode64; in iselSB_PPC()
6176 env->code = newHInstrArray(); in iselSB_PPC()
6178 /* Copy BB's type env. */ in iselSB_PPC()
6179 env->type_env = bb->tyenv; in iselSB_PPC()
6187 env->n_vregmap = bb->tyenv->types_used; in iselSB_PPC()
6188 env->vregmapLo = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_PPC()
6189 env->vregmapMedLo = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_PPC()
6191 env->vregmapMedHi = NULL; in iselSB_PPC()
6192 env->vregmapHi = NULL; in iselSB_PPC()
6194 env->vregmapMedHi = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_PPC()
6195 env->vregmapHi = LibVEX_Alloc_inline(env->n_vregmap * sizeof(HReg)); in iselSB_PPC()
6199 env->chainingAllowed = chainingAllowed; in iselSB_PPC()
6200 env->max_ga = max_ga; in iselSB_PPC()
6201 env->hwcaps = hwcaps_host; in iselSB_PPC()
6202 env->previous_rm = NULL; in iselSB_PPC()
6203 env->vbi = vbi; in iselSB_PPC()
6208 for (i = 0; i < env->n_vregmap; i++) { in iselSB_PPC()
6259 env->vregmapLo[i] = hregLo; in iselSB_PPC()
6260 env->vregmapMedLo[i] = hregMedLo; in iselSB_PPC()
6262 env->vregmapMedHi[i] = hregMedHi; in iselSB_PPC()
6263 env->vregmapHi[i] = hregHi; in iselSB_PPC()
6266 env->vreg_ctr = j; in iselSB_PPC()
6271 addInstr(env, PPCInstr_EvCheck(amCounter, amFailAddr)); in iselSB_PPC()
6278 addInstr(env, PPCInstr_ProfInc()); in iselSB_PPC()
6283 iselStmt(env, bb->stmts[i], IEndianess); in iselSB_PPC()
6285 iselNext(env, bb->next, bb->jumpkind, bb->offsIP, IEndianess); in iselSB_PPC()
6288 env->code->n_vregs = env->vreg_ctr; in iselSB_PPC()
6289 return env->code; in iselSB_PPC()