|
[Valgrind-developers] vex: r2416: Add a new IRConst kind -- V256 --
containing an abbreviated vector
From: <sv...@va...> - 2012-06-29 15:28:38
|
sewardj 2012-06-29 16:28:24 +0100 (Fri, 29 Jun 2012)
New Revision: 2416
Log:
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.
Modified files:
trunk/priv/host_amd64_isel.c
trunk/priv/ir_defs.c
trunk/pub/libvex_ir.h
Modified: trunk/pub/libvex_ir.h (+5 -1)
===================================================================
--- trunk/pub/libvex_ir.h 2012-06-29 15:44:44 +01:00 (rev 2415)
+++ trunk/pub/libvex_ir.h 2012-06-29 16:28:24 +01:00 (rev 2416)
@@ -272,8 +272,10 @@
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 @@
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_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* );
Modified: trunk/priv/ir_defs.c (+9 -0)
===================================================================
--- trunk/priv/ir_defs.c 2012-06-29 15:44:44 +01:00 (rev 2415)
+++ trunk/priv/ir_defs.c 2012-06-29 16:28:24 +01:00 (rev 2416)
@@ -86,6 +86,7 @@
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 @@
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 @@
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");
}
}
Modified: trunk/priv/host_amd64_isel.c (+16 -0)
===================================================================
--- trunk/priv/host_amd64_isel.c 2012-06-29 15:44:44 +01:00 (rev 2415)
+++ trunk/priv/host_amd64_isel.c 2012-06-29 16:28:24 +01:00 (rev 2416)
@@ -3433,6 +3433,22 @@
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) {
|