|
From: <sv...@va...> - 2006-05-22 12:41:31
|
Author: cerion
Date: 2006-05-22 13:41:19 +0100 (Mon, 22 May 2006)
New Revision: 1623
Log:
ppc backend: handle vector constant of zero.
Modified:
trunk/priv/host-ppc/isel.c
Modified: trunk/priv/host-ppc/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-ppc/isel.c 2006-05-21 15:38:38 UTC (rev 1622)
+++ trunk/priv/host-ppc/isel.c 2006-05-22 12:41:19 UTC (rev 1623)
@@ -976,6 +976,16 @@
/*--- ISEL: vector helpers ---*/
/*---------------------------------------------------------*/
=20
+/* Generate all-zeroes into a new vector register.
+*/
+static HReg generate_zeroes_V128 ( ISelEnv* env )
+{
+ HReg dst =3D newVRegV(env);
+ addInstr(env, PPCInstr_AvBinary(Pav_XOR, dst, dst, dst));
+ return dst;
+}
+
+
/*
Generates code for AvSplat
- takes in IRExpr* of type 8|16|32
@@ -3549,6 +3559,13 @@
} /* switch (e->Iex.Binop.op) */
} /* if (e->tag =3D=3D Iex_Binop) */
=20
+ if (e->tag =3D=3D Iex_Const ) {
+ vassert(e->Iex.Const.con->tag =3D=3D Ico_V128);
+ if (e->Iex.Const.con->Ico.V128 =3D=3D 0x0000) {
+ return generate_zeroes_V128(env);
+ }
+ }
+
vex_printf("iselVecExpr(ppc) (subarch =3D %s): can't reduce\n",
LibVEX_ppVexHwCaps(mode64 ? VexArchPPC64 : VexArchPPC32,
env->hwcaps));
|