From: Julian Seward Date: Wed, 30 Jul 2008 09:56:45 +0000 (+0000) Subject: Add support needed for exp-ptrcheck on ppc32/64. X-Git-Tag: svn/VALGRIND_3_4_1^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29b10fd42a74d6ef45e00fbc717e9e0297de44ff;p=thirdparty%2Fvalgrind.git Add support needed for exp-ptrcheck on ppc32/64. git-svn-id: svn://svn.valgrind.org/vex/trunk@1860 --- diff --git a/VEX/priv/host-ppc/isel.c b/VEX/priv/host-ppc/isel.c index 6911407b1c..d33b27784b 100644 --- a/VEX/priv/host-ppc/isel.c +++ b/VEX/priv/host-ppc/isel.c @@ -1831,6 +1831,29 @@ static HReg iselWordExpr_R_wrk ( ISelEnv* env, IRExpr* e ) } break; + /* ReinterpF32asI32(e) */ + /* Given an IEEE754 float, produce an I32 with the same bit + pattern. */ + case Iop_ReinterpF32asI32: { + /* I believe this generates correct code for both 32- and + 64-bit hosts. */ + PPCAMode *am_addr; + HReg fr_src = iselFltExpr(env, e->Iex.Unop.arg); + HReg r_dst = newVRegI(env); + + sub_from_sp( env, 16 ); // Move SP down 16 bytes + am_addr = PPCAMode_IR( 0, StackFramePtr(mode64) ); + + // store as F32 + addInstr(env, PPCInstr_FpLdSt( False/*store*/, 4, + fr_src, am_addr )); + // load as Ity_I32 + addInstr(env, PPCInstr_Load( 4, r_dst, am_addr, mode64 )); + + add_to_sp( env, 16 ); // Reset SP + return r_dst; + } + default: break; } diff --git a/VEX/pub/libvex_guest_ppc64.h b/VEX/pub/libvex_guest_ppc64.h index d03c01db99..d6ff136069 100644 --- a/VEX/pub/libvex_guest_ppc64.h +++ b/VEX/pub/libvex_guest_ppc64.h @@ -271,7 +271,7 @@ typedef /* Needed for AIX: CIA at the last SC insn. Used when backing up to restart a syscall that has been interrupted by a signal. */ - /* ???? */ ULong guest_CIA_AT_SC; + /* 1392 */ ULong guest_CIA_AT_SC; /* SPRG3, which AIUI is readonly in user space. Needed for threading on AIX. */