summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/translate/translate.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-08-10 02:14:04 +0200
committerLuca Barbieri <[email protected]>2010-08-16 17:09:24 +0200
commitc2da8e77023325f46dde2009def2947b1a687c7b (patch)
tree3ae7625d8526e38e73a155a15903b1206a0bf117 /src/gallium/auxiliary/translate/translate.c
parenta3e6e50544de74558ceb7cd4b618c350cdef36c6 (diff)
translate_sse: major rewrite (v5)
NOTE: Win64 is untested, and is thus currently disabled. If you have such a system, please enable it and report whether it works. To enable it, change src/gallium/auxiliary/translate/translate.c Changes in v5: - On Win64, preserve %xmm6 and %xmm7 as required by the ABI - Use _WIN64 instead of WIN64 Changes in v4: - Use x86_target() and x86_target_caps() - Enable translate_sse in x86-64, but not in Win64 Changes in v3: - Win64 support (untested) - Use u_cpu_detect.h constants instead of #ifs Changes in v2: - Minimize #ifs - Give a name to magic number CHANNELS_0001 - Add support for CPUs without SSE (only memcpy and swizzles, like non SSE2) - Fixed comments translate_sse is currently very limited to the point of being useless in essentially all cases. In particular, it only support some float32 and unorm8 formats and doesn't work on x86-64. This commit rewrites it to support: 1. Dumb memory copy for any pair of identical formats 2. All formats that are swizzles of each other 3. Converting 32/64-bit floats and all 8/16/32-bit integers to 32-bit float 4. Converting unorm8/snorm8 to snorm16 and uscaled8/sscaled8 to sscaled16 5. Support for x86-64 (doesn't take advantage of it in any way though) This new translate can even be useful to translate index buffers for cards that lack 8-bit index support. It passes the testsuite I wrote, but note that this is a major change, and more testing would be great.
Diffstat (limited to 'src/gallium/auxiliary/translate/translate.c')
-rw-r--r--src/gallium/auxiliary/translate/translate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/translate/translate.c b/src/gallium/auxiliary/translate/translate.c
index fe638e211fa..03a7f050aa2 100644
--- a/src/gallium/auxiliary/translate/translate.c
+++ b/src/gallium/auxiliary/translate/translate.c
@@ -38,7 +38,8 @@ struct translate *translate_create( const struct translate_key *key )
{
struct translate *translate = NULL;
-#if defined(PIPE_ARCH_X86)
+/* TODO: enable Win64 once it has actually been tested */
+#if defined(PIPE_ARCH_X86) || (defined(PIPE_ARCH_X86_64) && !defined(_WIN64))
translate = translate_sse2_create( key );
if (translate)
return translate;