From: <sv...@va...> - 2012-04-26 14:17:04
|
sewardj 2012-04-26 15:16:52 +0100 (Thu, 26 Apr 2012) New Revision: 2316 Log: Add a feature check flag for AVX. Modified files: trunk/priv/host_amd64_isel.c trunk/priv/main_main.c trunk/pub/libvex.h Modified: trunk/pub/libvex.h (+1 -0) =================================================================== --- trunk/pub/libvex.h 2012-04-25 17:47:53 +01:00 (rev 2315) +++ trunk/pub/libvex.h 2012-04-26 15:16:52 +01:00 (rev 2316) @@ -80,6 +80,7 @@ #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 */ Modified: trunk/priv/main_main.c (+8 -2) =================================================================== --- trunk/priv/main_main.c 2012-04-25 17:47:53 +01:00 (rev 2315) +++ trunk/priv/main_main.c 2012-04-26 15:16:52 +01:00 (rev 2316) @@ -1050,7 +1050,11 @@ /* 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 @@ 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; } Modified: trunk/priv/host_amd64_isel.c (+2 -1) =================================================================== --- trunk/priv/host_amd64_isel.c 2012-04-25 17:47:53 +01:00 (rev 2315) +++ trunk/priv/host_amd64_isel.c 2012-04-26 15:16:52 +01:00 (rev 2316) @@ -4327,7 +4327,8 @@ 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)); |