pixman: Branch 'master'

Jeff Muizelaar jrmuizel at kemper.freedesktop.org
Wed Apr 15 07:39:53 PDT 2009


 pixman/pixman-arm-detect-win32.asm |   10 ++++++++++
 pixman/pixman-arm-simd.h           |    2 +-
 pixman/pixman-pict.c               |   30 ++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)

New commits:
commit 2423118e239e9c85dd68403bf8b97b30965df38e
Author: Jeff Muizelaar <jmuizelaar at mozilla.com>
Date:   Wed Apr 15 10:38:37 2009 -0400

    Add support for doing ARM simd detection on Windows

diff --git a/pixman/pixman-arm-detect-win32.asm b/pixman/pixman-arm-detect-win32.asm
new file mode 100644
index 0000000..dfe363e
--- /dev/null
+++ b/pixman/pixman-arm-detect-win32.asm
@@ -0,0 +1,10 @@
+    area pixman_msvc, code, readonly
+
+    export  pixman_msvc_try_armv6_op
+
+pixman_msvc_try_armv6_op
+    uqadd8 r0,r0,r1
+    mov pc,lr
+    endp
+
+    end
diff --git a/pixman/pixman-arm-simd.h b/pixman/pixman-arm-simd.h
index ecaace5..fae7b94 100644
--- a/pixman/pixman-arm-simd.h
+++ b/pixman/pixman-arm-simd.h
@@ -28,7 +28,7 @@
 
 #ifdef USE_ARM_SIMD
 
-static inline pixman_bool_t pixman_have_arm_simd(void) { return TRUE; }
+pixman_bool_t pixman_have_arm_simd(void);
 
 #else
 #define pixman_have_arm_simd() FALSE
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 5f3ddd2..82d7160 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -37,6 +37,11 @@
 #include "pixman-arm-simd.h"
 #include "pixman-combine32.h"
 
+#if defined(USE_ARM_SIMD) && defined(_MSC_VER)
+/* Needed for EXCEPTION_ILLEGAL_INSTRUCTION */
+#include <windows.h>
+#endif
+
 #define FbFullMask(n)   ((n) == 32 ? (uint32_t)-1 : ((((uint32_t) 1) << n) - 1))
 
 #undef READ
@@ -2190,6 +2195,31 @@ pixman_bool_t pixman_have_vmx (void) {
 #endif /* __APPLE__ */
 #endif /* USE_VMX */
 
+#ifdef USE_ARM_SIMD
+pixman_bool_t
+pixman_have_arm_simd (void)
+{
+#ifdef _MSC_VER
+    static pixman_bool_t initialized = FALSE;
+    static pixman_bool_t have_arm_simd = FALSE;
+
+    if (!initialized) {
+        __try {
+            pixman_msvc_try_armv6_op();
+            have_arm_simd = TRUE;
+        } __except(GetExceptionCode() == EXCEPTION_ILLEGAL_INSTRUCTION) {
+            have_arm_simd = FALSE;
+        }
+	initialized = TRUE;
+    }
+
+    return have_arm_simd;
+#else
+    return TRUE;
+#endif
+}
+#endif
+
 #ifdef USE_MMX
 /* The CPU detection code needs to be in a file not compiled with
  * "-mmmx -msse", as gcc would generate CMOV instructions otherwise


More information about the xorg-commit mailing list