]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Valgrind-side changes needed to go with vex r1984 (Implement SSE4
authorJulian Seward <jseward@acm.org>
Fri, 18 Jun 2010 08:18:38 +0000 (08:18 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 18 Jun 2010 08:18:38 +0000 (08:18 +0000)
insns: CMPGTQ PMAXUD PMINUD PMAXSB PMINSB PMULLD)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11181

Makefile.vex.am
memcheck/mc_translate.c
none/tests/amd64/sse4-64.c

index 0996e96a2d992c6d914e605cd36a14c84f02329e..aa1888371b505eac4a138cc8b3c8693d789f086a 100644 (file)
@@ -40,6 +40,7 @@ noinst_HEADERS = \
        priv/guest_arm_defs.h \
        priv/host_generic_regs.h \
        priv/host_generic_simd64.h \
+       priv/host_generic_simd128.h \
        priv/host_x86_defs.h \
        priv/host_amd64_defs.h \
        priv/host_ppc_defs.h \
@@ -90,6 +91,7 @@ LIBVEX_SOURCES_COMMON = \
        priv/guest_arm_toIR.c \
        priv/host_generic_regs.c \
        priv/host_generic_simd64.c \
+       priv/host_generic_simd128.c \
        priv/host_generic_reg_alloc2.c \
        priv/host_x86_defs.c \
        priv/host_x86_isel.c \
index 3531363f6929b7e0548b7393af33ac0bbf37fb4a..5f1eb6d007d74610e0b82eed8030c89d9cfa8634 100644 (file)
@@ -2279,10 +2279,12 @@ IRAtom* expr2vbits_Binop ( MCEnv* mce,
       case Iop_Max32Sx4:
       case Iop_Min32Ux4:
       case Iop_Min32Sx4:
+      case Iop_Mul32x4:
          return binary32Ix4(mce, vatom1, vatom2);
 
       case Iop_Sub64x2:
       case Iop_Add64x2:
+      case Iop_CmpGT64Sx2:
          return binary64Ix2(mce, vatom1, vatom2);
 
       case Iop_QNarrow32Sx4:
index d96f726a681ae846bc053c71f5fba6b0a9481ca1..15b6a036914d263c38e23a73812fffe34c7a7267 100644 (file)
@@ -58,6 +58,14 @@ typedef
    }
    RMArgs;
 
+static void do64HLtoV128 ( /*OUT*/V128* res, ULong wHi, ULong wLo )
+{
+   // try to sidestep strict-aliasing snafus by memcpying explicitly
+   UChar* p = (UChar*)res;
+   memcpy(&p[8], (UChar*)&wHi, 8);
+   memcpy(&p[0], (UChar*)&wLo, 8);
+}
+
 static UChar randUChar ( void )
 {
    static UInt seed = 80021;
@@ -2059,12 +2067,40 @@ void test_POPCNTW ( void )
 }
 
 
+void test_PCMPGTQ ( void )
+{
+   V128 spec[7];
+   do64HLtoV128( &spec[0], 0x0000000000000000ULL, 0xffffffffffffffffULL );
+   do64HLtoV128( &spec[1], 0x0000000000000001ULL, 0xfffffffffffffffeULL );
+   do64HLtoV128( &spec[2], 0x7fffffffffffffffULL, 0x8000000000000001ULL );
+   do64HLtoV128( &spec[3], 0x8000000000000000ULL, 0x8000000000000000ULL );
+   do64HLtoV128( &spec[4], 0x8000000000000001ULL, 0x7fffffffffffffffULL );
+   do64HLtoV128( &spec[5], 0xfffffffffffffffeULL, 0x0000000000000001ULL );
+   do64HLtoV128( &spec[6], 0xffffffffffffffffULL, 0x0000000000000000ULL );
+
+   V128 src, dst;
+   Int i, j;
+   for (i = 0; i < 10; i++) {
+      randV128(&src);
+      randV128(&dst);
+      DO_mandr_r("pcmpgtq", src, dst);
+   }
+   for (i = 0; i < 7; i++) {
+      for (j = 0; j < 7; j++) {
+         memcpy(&src, &spec[i], 16);
+         memcpy(&dst, &spec[j], 16);
+         DO_mandr_r("pcmpgtq", src, dst);
+      }
+   }
+}
+
 
 
 
 int main ( int argc, char** argv )
 {
 #if 1
+   // ------ SSE 4.1 ------
    test_BLENDPD();        // done Apr.01.2010
    test_BLENDPS();        // done Apr.02.2010
    //test_PBLENDW();
@@ -2088,14 +2124,14 @@ int main ( int argc, char** argv )
    //test_PINSRW();         // todo
    //test_PINSRB();         // todo
    //test_PHMINPOSUW();
-   //test_PMAXSB();
+   test_PMAXSB();
    test_PMAXSD();         // done Apr.09.2010
    test_PMAXUD();         // done Apr.16.2010
-   //test_PMAXUW();
-   //test_PMINSB();
+   test_PMAXUW();
+   test_PMINSB();
    test_PMINSD();         // done Apr.09.2010
    test_PMINUD();
-   //test_PMINUW();
+   test_PMINUW();
    test_PMOVSXBW();       // done Apr.02.2010
    test_PMOVSXBD();       // done Mar.30.2010
    test_PMOVSXBQ();       // done Mar.30.2010
@@ -2112,13 +2148,16 @@ int main ( int argc, char** argv )
    test_POPCNTL();
    test_POPCNTQ();
    //test_PMULDQ();
-   //test_PMULLD();
+   test_PMULLD();
    // PTEST
    // ROUNDPD
    // ROUNDPS
    // ROUNDSD
    // ROUNDSS
+   // ------ SSE 4.2 ------
+   test_PCMPGTQ();
 #else
+   test_PMAXSB();
 #endif
 
    return 0;