]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a new IRConst kind -- V256 -- containing an abbreviated vector
authorJulian Seward <jseward@acm.org>
Fri, 29 Jun 2012 15:28:24 +0000 (15:28 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 29 Jun 2012 15:28:24 +0000 (15:28 +0000)
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

VEX/priv/host_amd64_isel.c
VEX/priv/ir_defs.c
VEX/pub/libvex_ir.h

index 46d267021168fcb13d86f5caefa9a82a31a077b6..5607780a75927a800c05428510c53dcd28dc15eb 100644 (file)
@@ -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) {
 
index 5d3b8b7ebb70ad59dbbbc3782810bb9af41eae2e..2b8877c246f0d44f3341bd1683e7d225c077379a 100644 (file)
@@ -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");
    }
 }
index 7aaef1e5eb73154b678af2ed47ab933dec4202cd..005809c7fc14cadcc318f8f6909016954f04ba9d 100644 (file)
@@ -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* );