From: Julian Seward Date: Fri, 29 Jun 2012 15:28:24 +0000 (+0000) Subject: Add a new IRConst kind -- V256 -- containing an abbreviated vector X-Git-Tag: svn/VALGRIND_3_8_1^2~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fb6f4729095a3940184d77f7aa430950fc4c30f;p=thirdparty%2Fvalgrind.git Add a new IRConst kind -- V256 -- containing an abbreviated vector immediate with 1 bit per byte, in the style of V128. This is so we can actually write constants of type V256, which is necessary for some Memcheck instrumentation of 256 bit primops. git-svn-id: svn://svn.valgrind.org/vex/trunk@2416 --- diff --git a/VEX/priv/host_amd64_isel.c b/VEX/priv/host_amd64_isel.c index 46d2670211..5607780a75 100644 --- a/VEX/priv/host_amd64_isel.c +++ b/VEX/priv/host_amd64_isel.c @@ -3433,6 +3433,22 @@ static void iselDVecExpr_wrk ( /*OUT*/HReg* rHi, /*OUT*/HReg* rLo, return; } + if (e->tag == Iex_Const) { + vassert(e->Iex.Const.con->tag == Ico_V256); + switch (e->Iex.Const.con->Ico.V256) { + case 0x00000000: { + HReg vHi = generate_zeroes_V128(env); + HReg vLo = newVRegV(env); + addInstr(env, mk_vMOVsd_RR(vHi, vLo)); + *rHi = vHi; + *rLo = vLo; + return; + } + default: + break; /* give up. Until such time as is necessary. */ + } + } + if (e->tag == Iex_Unop) { switch (e->Iex.Unop.op) { diff --git a/VEX/priv/ir_defs.c b/VEX/priv/ir_defs.c index 5d3b8b7ebb..2b8877c246 100644 --- a/VEX/priv/ir_defs.c +++ b/VEX/priv/ir_defs.c @@ -86,6 +86,7 @@ void ppIRConst ( IRConst* con ) break; case Ico_F64i: vex_printf( "F64i{0x%llx}", con->Ico.F64i); break; case Ico_V128: vex_printf( "V128{0x%04x}", (UInt)(con->Ico.V128)); break; + case Ico_V256: vex_printf( "V256{0x%08x}", con->Ico.V256); break; default: vpanic("ppIRConst"); } } @@ -1443,6 +1444,13 @@ IRConst* IRConst_V128 ( UShort con ) c->Ico.V128 = con; return c; } +IRConst* IRConst_V256 ( UInt con ) +{ + IRConst* c = LibVEX_Alloc(sizeof(IRConst)); + c->tag = Ico_V256; + c->Ico.V256 = con; + return c; +} /* Constructors -- IRCallee */ @@ -2920,6 +2928,7 @@ IRType typeOfIRConst ( IRConst* con ) case Ico_F64: return Ity_F64; case Ico_F64i: return Ity_F64; case Ico_V128: return Ity_V128; + case Ico_V256: return Ity_V256; default: vpanic("typeOfIRConst"); } } diff --git a/VEX/pub/libvex_ir.h b/VEX/pub/libvex_ir.h index 7aaef1e5eb..005809c7fc 100644 --- a/VEX/pub/libvex_ir.h +++ b/VEX/pub/libvex_ir.h @@ -272,8 +272,10 @@ typedef Ico_F64, /* 64-bit IEEE754 floating */ Ico_F64i, /* 64-bit unsigned int to be interpreted literally as a IEEE754 double value. */ - Ico_V128 /* 128-bit restricted vector constant, with 1 bit + Ico_V128, /* 128-bit restricted vector constant, with 1 bit (repeated 8 times) for each of the 16 x 1-byte lanes */ + Ico_V256 /* 256-bit restricted vector constant, with 1 bit + (repeated 8 times) for each of the 32 x 1-byte lanes */ } IRConstTag; @@ -295,6 +297,7 @@ typedef Double F64; ULong F64i; UShort V128; /* 16-bit value; see Ico_V128 comment above */ + UInt V256; /* 32-bit value; see Ico_V256 comment above */ } Ico; } IRConst; @@ -310,6 +313,7 @@ extern IRConst* IRConst_F32i ( UInt ); extern IRConst* IRConst_F64 ( Double ); extern IRConst* IRConst_F64i ( ULong ); extern IRConst* IRConst_V128 ( UShort ); +extern IRConst* IRConst_V256 ( UInt ); /* Deep-copy an IRConst */ extern IRConst* deepCopyIRConst ( IRConst* );