]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a feature check flag for AVX.
authorJulian Seward <jseward@acm.org>
Thu, 26 Apr 2012 14:16:52 +0000 (14:16 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 26 Apr 2012 14:16:52 +0000 (14:16 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2316

VEX/priv/host_amd64_isel.c
VEX/priv/main_main.c
VEX/pub/libvex.h

index 8cc0d3c0635c814535ecafdd01927475a4eca974..cbd30b8e6e83ce9cef08b7c752822e9e115057ae 100644 (file)
@@ -4327,7 +4327,8 @@ HInstrArray* iselSB_AMD64 ( IRSB* bb,
    vassert(0 == (hwcaps_host
                  & ~(VEX_HWCAPS_AMD64_SSE3
                      | VEX_HWCAPS_AMD64_CX16
-                     | VEX_HWCAPS_AMD64_LZCNT)));
+                     | VEX_HWCAPS_AMD64_LZCNT
+                     | VEX_HWCAPS_AMD64_AVX)));
 
    /* Make up an initial environment to use. */
    env = LibVEX_Alloc(sizeof(ISelEnv));
index c73c5d291af5451fa5324e5183126d00632d09f2..4d11a671d9da167c1c7cbbf4c5ff55ebf0f51622 100644 (file)
@@ -1050,7 +1050,11 @@ static HChar* show_hwcaps_amd64 ( UInt hwcaps )
    /* SSE3 and CX16 are orthogonal and > baseline, although we really
       don't expect to come across anything which can do SSE3 but can't
       do CX16.  Still, we can handle that case.  LZCNT is similarly
-      orthogonal. */
+      orthogonal.  AVX is technically orthogonal, but just add the
+      cases we actually come across.  (This scheme for printing is
+      very stupid.  We should add strings independently based on
+      feature bits, but then it would be hard to return a string that
+      didn't need deallocating by the caller.) */
    switch (hwcaps) {
       case 0:
          return "amd64-sse2";
@@ -1067,7 +1071,9 @@ static HChar* show_hwcaps_amd64 ( UInt hwcaps )
       case VEX_HWCAPS_AMD64_SSE3 | VEX_HWCAPS_AMD64_CX16
            | VEX_HWCAPS_AMD64_LZCNT:
          return "amd64-sse3-cx16-lzcnt";
-
+      case VEX_HWCAPS_AMD64_SSE3 | VEX_HWCAPS_AMD64_CX16
+           | VEX_HWCAPS_AMD64_AVX:
+         return "amd64-sse3-cx16-avx";
       default:
          return NULL;
    }
index ef50206cc84f44f13b7095a3e2f95c73134db805..51495e186248c3d36992214eee9dc5edc7960620 100644 (file)
@@ -80,6 +80,7 @@ typedef
 #define VEX_HWCAPS_AMD64_SSE3  (1<<5)  /* SSE3 support */
 #define VEX_HWCAPS_AMD64_CX16  (1<<6)  /* cmpxchg16b support */
 #define VEX_HWCAPS_AMD64_LZCNT (1<<7)  /* SSE4a LZCNT insn */
+#define VEX_HWCAPS_AMD64_AVX   (1<<8)  /* AVX instructions */
 
 /* ppc32: baseline capability is integer only */
 #define VEX_HWCAPS_PPC32_F     (1<<8)  /* basic (non-optional) FP */