|
From: <sv...@va...> - 2005-05-09 18:15:26
|
Author: sewardj
Date: 2005-05-09 19:15:21 +0100 (Mon, 09 May 2005)
New Revision: 1174
Modified:
trunk/priv/host-amd64/isel.c
Log:
Handle primops created by memchecking MMX code.
Modified: trunk/priv/host-amd64/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-amd64/isel.c 2005-05-09 17:52:56 UTC (rev 1173)
+++ trunk/priv/host-amd64/isel.c 2005-05-09 18:15:21 UTC (rev 1174)
@@ -764,7 +764,10 @@
/* DO NOT CALL THIS DIRECTLY ! */
static HReg iselIntExpr_R_wrk ( ISelEnv* env, IRExpr* e )
{
+ /* Used for unary/binary SIMD64 ops. */
+ HWord fn =3D 0;
Bool second_is_UInt;
+
MatchInfo mi;
DECLARE_PATTERN(p_8Uto64);
DECLARE_PATTERN(p_1Uto8_64to1);
@@ -807,7 +810,6 @@
case Iex_Binop: {
AMD64AluOp aluOp;
AMD64ShiftOp shOp;
- HWord fn =3D 0; /* helper fn for most SIMD64 stuff */
=20
//..=20
//.. /* Pattern: Sub32(0,x) */
@@ -1484,6 +1486,32 @@
default:=20
break;
}
+
+ /* Deal with unary 64-bit SIMD ops. */
+ switch (e->Iex.Unop.op) {
+ case Iop_CmpNEZ32x2:
+ fn =3D (HWord)h_generic_calc_CmpNEZ32x2; break;
+ case Iop_CmpNEZ16x4:
+ fn =3D (HWord)h_generic_calc_CmpNEZ16x4; break;
+ case Iop_CmpNEZ8x8:
+ fn =3D (HWord)h_generic_calc_CmpNEZ8x8; break;
+ default:
+ fn =3D (HWord)0; break;
+ }
+ if (fn !=3D (HWord)0) {
+ /* Note: the following assumes all helpers are of
+ signature=20
+ ULong fn ( ULong ), and they are
+ not marked as regparm functions.=20
+ */
+ HReg dst =3D newVRegI(env);
+ HReg arg =3D iselIntExpr_R(env, e->Iex.Unop.arg);
+ addInstr(env, mk_iMOVsd_RR(arg, hregAMD64_RDI()) );
+ addInstr(env, AMD64Instr_Call( Acc_ALWAYS, (ULong)fn, 1 ));
+ addInstr(env, mk_iMOVsd_RR(hregAMD64_RAX(), dst));
+ return dst;
+ }
+
break;
}
=20
@@ -2522,33 +2550,6 @@
//.. return;
//.. }
//..=20
-//.. case Iop_CmpNEZ32x2:
-//.. fn =3D (HWord)h_generic_calc_CmpNEZ32x2; goto unish;
-//.. case Iop_CmpNEZ16x4:
-//.. fn =3D (HWord)h_generic_calc_CmpNEZ16x4; goto unish;
-//.. case Iop_CmpNEZ8x8:
-//.. fn =3D (HWord)h_generic_calc_CmpNEZ8x8; goto unish;
-//.. unish: {
-//.. /* Note: the following assumes all helpers are of
-//.. signature=20
-//.. ULong fn ( ULong ), and they are
-//.. not marked as regparm functions.=20
-//.. */
-//.. HReg xLo, xHi;
-//.. HReg tLo =3D newVRegI(env);
-//.. HReg tHi =3D newVRegI(env);
-//.. iselInt64Expr(&xHi, &xLo, env, e->Iex.Unop.arg);
-//.. addInstr(env, X86Instr_Push(X86RMI_Reg(xHi)));
-//.. addInstr(env, X86Instr_Push(X86RMI_Reg(xLo)));
-//.. addInstr(env, X86Instr_Call( Xcc_ALWAYS, (UInt)fn, 0 ))=
;
-//.. add_to_esp(env, 2*4);
-//.. addInstr(env, mk_iMOVsd_RR(hregX86_EDX(), tHi));
-//.. addInstr(env, mk_iMOVsd_RR(hregX86_EAX(), tLo));
-//.. *rHi =3D tHi;
-//.. *rLo =3D tLo;
-//.. return;
-//.. }
-//..=20
//.. default:=20
//.. break;
//.. }
|