|
From: <sv...@va...> - 2005-09-09 19:45:38
|
Author: sewardj
Date: 2005-09-09 20:45:36 +0100 (Fri, 09 Sep 2005)
New Revision: 1383
Log:
iselInt64Expr: handle 64-bit Mux0X.
Modified:
trunk/priv/host-ppc32/isel.c
Modified: trunk/priv/host-ppc32/isel.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-ppc32/isel.c 2005-09-09 19:45:02 UTC (rev 1382)
+++ trunk/priv/host-ppc32/isel.c 2005-09-09 19:45:36 UTC (rev 1383)
@@ -1868,26 +1868,33 @@
//.. return;
//.. }
=20
-//.. /* 64-bit Mux0X */
-//.. if (e->tag =3D=3D Iex_Mux0X) {
-//.. HReg e0Lo, e0Hi, eXLo, eXHi, r8;
-//.. HReg tLo =3D newVRegI(env);
-//.. HReg tHi =3D newVRegI(env);
-//.. iselInt64Expr(&e0Hi, &e0Lo, env, e->Iex.Mux0X.expr0);
-//.. iselInt64Expr(&eXHi, &eXLo, env, e->Iex.Mux0X.exprX);
-//.. addInstr(env, mk_iMOVsd_RR(eXHi, tHi));
-//.. addInstr(env, mk_iMOVsd_RR(eXLo, tLo));
-//.. r8 =3D iselIntExpr_R(env, e->Iex.Mux0X.cond);
-//.. addInstr(env, X86Instr_Test32(X86RI_Imm(0xFF), X86RM_Reg(r8))=
);
-//.. /* This assumes the first cmov32 doesn't trash the condition
-//.. codes, so they are still available for the second cmov32 *=
/
-//.. addInstr(env, X86Instr_CMov32(Xcc_Z,X86RM_Reg(e0Hi),tHi));
-//.. addInstr(env, X86Instr_CMov32(Xcc_Z,X86RM_Reg(e0Lo),tLo));
-//.. *rHi =3D tHi;
-//.. *rLo =3D tLo;
-//.. return;
-//.. }
+ /* 64-bit Mux0X */
+ if (e->tag =3D=3D Iex_Mux0X) {
+ HReg e0Lo, e0Hi, eXLo, eXHi;
+ HReg tLo =3D newVRegI(env);
+ HReg tHi =3D newVRegI(env);
=20
+ PPC32CondCode cc =3D mk_PPCCondCode( Pct_TRUE, Pcf_7EQ );
+ HReg r_cond =3D iselIntExpr_R(env, e->Iex.Mux0X.cond);
+ HReg r_tmp =3D newVRegI(env);
+
+ iselInt64Expr(&e0Hi, &e0Lo, env, e->Iex.Mux0X.expr0);
+ iselInt64Expr(&eXHi, &eXLo, env, e->Iex.Mux0X.exprX);
+ addInstr(env, mk_iMOVds_RR(tHi,eXHi));
+ addInstr(env, mk_iMOVds_RR(tLo,eXLo));
+
+ addInstr(env, PPC32Instr_Alu32(Palu_AND,=20
+ r_tmp, r_cond, PPC32RH_Imm(False,0x=
FF)));
+ addInstr(env, PPC32Instr_Cmp32(False/*unsigned*/,=20
+ 7/*cr*/, r_tmp, PPC32RH_Imm(False,0=
)));
+
+ addInstr(env, PPC32Instr_CMov32(cc,tHi,PPC32RI_Reg(e0Hi)));
+ addInstr(env, PPC32Instr_CMov32(cc,tLo,PPC32RI_Reg(e0Lo)));
+ *rHi =3D tHi;
+ *rLo =3D tLo;
+ return;
+ }
+
/* --------- BINARY ops --------- */
if (e->tag =3D=3D Iex_Binop) {
switch (e->Iex.Binop.op) {
|