diff options
Diffstat (limited to 'volk/gen')
-rw-r--r-- | volk/gen/compilers.xml | 14 | ||||
-rw-r--r-- | volk/gen/machines.xml | 8 | ||||
-rw-r--r-- | volk/gen/make_cpuid_c.py | 2 | ||||
-rw-r--r-- | volk/gen/volk_regexp.py | 3 | ||||
-rw-r--r-- | volk/gen/volk_register.py | 3 |
5 files changed, 22 insertions, 8 deletions
diff --git a/volk/gen/compilers.xml b/volk/gen/compilers.xml index 70c82e555..005eda2aa 100644 --- a/volk/gen/compilers.xml +++ b/volk/gen/compilers.xml @@ -2,9 +2,21 @@ <grammar> <compiler name="MSVC"> + <!-- remap the following flags to SSE --> <remap name="mmmx">arch:SSE</remap> <remap name="msse">arch:SSE</remap> + + <!-- remap the following flags to SSE2 --> <remap name="msse2">arch:SSE2</remap> + + <!-- remap the following flags to AVX --> + <remap name="msse3">arch:AVX</remap> + <remap name="mssse3">arch:AVX</remap> + <remap name="msse4.1">arch:AVX</remap> + <remap name="msse4.2">arch:AVX</remap> + <remap name="mpopcnt">arch:AVX</remap> + <remap name="mavx">arch:AVX</remap> + <prefix>/</prefix> </compiler> @@ -15,4 +27,4 @@ -</grammar>
\ No newline at end of file +</grammar> diff --git a/volk/gen/machines.xml b/volk/gen/machines.xml index b872b9fb1..9c19c91c6 100644 --- a/volk/gen/machines.xml +++ b/volk/gen/machines.xml @@ -15,9 +15,9 @@ --> <!-- -Create an SSE2 only machine (without 64/32 inline assembly support). +Create an SSE2 and AVX only machine (without 64/32 inline assembly support). This machine is intended to support the MSVC compiler on x86/amd64. -The MSVC compiler has intrinsic support for SSE and SSE2, +The MSVC compiler has intrinsic support for SSE, SSE2, AVX however it does not support the gcc style inline assembly. --> @@ -57,6 +57,10 @@ however it does not support the gcc style inline assembly. <archs>generic 32|64 mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount avx</archs> </machine> +<machine name="avx_only"> +<archs>generic mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount avx</archs> +</machine> + <machine name="altivec"> <archs>generic altivec</archs> </machine> diff --git a/volk/gen/make_cpuid_c.py b/volk/gen/make_cpuid_c.py index 7281f45a3..2be1123a8 100644 --- a/volk/gen/make_cpuid_c.py +++ b/volk/gen/make_cpuid_c.py @@ -39,7 +39,7 @@ struct VOLK_CPU volk_cpu; //implement get cpuid for gcc compilers using a copy of cpuid.h #if defined(__GNUC__) #include <gcc_x86_cpuid.h> -#define cpuid_x86(op, r) __get_cpuid(op, r+0, r+1, r+2, r+3) +#define cpuid_x86(op, r) __get_cpuid(op, (unsigned int *)r+0, (unsigned int *)r+1, (unsigned int *)r+2, (unsigned int *)r+3) //implement get cpuid for MSVC compilers using __cpuid intrinsic #elif defined(_MSC_VER) diff --git a/volk/gen/volk_regexp.py b/volk/gen/volk_regexp.py index b83ce5206..eb4ceb54b 100644 --- a/volk/gen/volk_regexp.py +++ b/volk/gen/volk_regexp.py @@ -1,5 +1,4 @@ import re -import string remove_after_underscore = re.compile("_.*"); space_remove = re.compile(" "); @@ -10,5 +9,5 @@ replace_volk = re.compile("volk"); def strip_trailing(tostrip, stripstr): lindex = tostrip.rfind(stripstr) - tostrip = tostrip[0:lindex] + string.replace(tostrip[lindex:len(tostrip)], stripstr, ""); + tostrip = tostrip[0:lindex] + tostrip[lindex:len(tostrip)].replace(stripstr, ""); return tostrip diff --git a/volk/gen/volk_register.py b/volk/gen/volk_register.py index cd874e470..0774ece29 100644 --- a/volk/gen/volk_register.py +++ b/volk/gen/volk_register.py @@ -4,7 +4,6 @@ import sys import os import re import glob -import string from xml.dom import minidom from volk_regexp import * from make_cpuid_c import make_cpuid_c @@ -101,7 +100,7 @@ for filearch in filearchs: archs_or = "(" for arch in archs: - archs_or = archs_or + string.upper(arch) + "|"; + archs_or = archs_or + arch.upper() + "|"; archs_or = archs_or[0:len(archs_or)-1]; archs_or = archs_or + ")"; |