Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common
Modified Files:
evas_cpu.c
Log Message:
well cpu detection was fucked up.. fixed now! :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_cpu.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- evas_cpu.c 10 Sep 2003 08:52:17 -0000 1.13
+++ evas_cpu.c 20 Sep 2003 04:42:45 -0000 1.14
@@ -7,8 +7,10 @@
static jmp_buf detect_buf;
static int cpu_feature_mask = 0;
-void
-evas_common_cpu_catch_ill(void)
+static void evas_common_cpu_catch_ill(int sig);
+
+static void
+evas_common_cpu_catch_ill(int sig)
{
longjmp(detect_buf, 1);
}
@@ -26,10 +28,9 @@
evas_common_cpu_mmx2_test(void)
{
#ifdef BUILD_MMX
- char data[128];
- char data2[128];
-
- MOVE_16DWORDS_MMX2(data, data2);
+ char data[8];
+
+ mmx_r2m(movntq, mm0, data);
#endif
}
@@ -50,7 +51,7 @@
evas_common_cpu_altivec_test(void)
{
vector unsigned int zero;
- illegal = 0;
+
zero = vec_splat_u32(0);
}
#endif /* __VEC__ */
@@ -69,13 +70,17 @@
int enabled = 1;
struct sigaction act, oact;
+ act.sa_handler = evas_common_cpu_catch_ill;
+ act.sa_flags = SA_RESTART;
+ sigemptyset(&act.sa_mask);
sigaction(SIGILL, &act, &oact);
if (setjmp(detect_buf))
- enabled = 0;
- else
- feature();
+ {
+ sigaction(SIGILL, &oact, NULL);
+ return 0;
+ }
+ feature();
sigaction(SIGILL, &oact, NULL);
-
return enabled;
}
@@ -90,11 +95,14 @@
#ifdef BUILD_MMX
cpu_feature_mask |= CPU_FEATURE_MMX *
evas_common_cpu_feature_test(evas_common_cpu_mmx_test);
+ evas_common_cpu_end_opt();
cpu_feature_mask |= CPU_FEATURE_MMX2 *
evas_common_cpu_feature_test(evas_common_cpu_mmx2_test);
+ evas_common_cpu_end_opt();
#ifdef BUILD_SSE
cpu_feature_mask |= CPU_FEATURE_SSE *
evas_common_cpu_feature_test(evas_common_cpu_sse_test);
+ evas_common_cpu_end_opt();
#endif /* BUILD_SSE */
#endif /* BUILD_MMX */
#endif /* __i386__ */
@@ -102,13 +110,14 @@
#ifdef __VEC__
cpu_feature_mask |= CPU_FEATURE_ALTIVEC *
evas_common_cpu_feature_test(evas_common_cpu_altivec_test);
+ evas_common_cpu_end_opt();
#endif /* __VEC__ */
#endif /* __POWERPC__ */
#ifdef __SPARC__
cpu_feature_mask |= CPU_FEATURE_VIS *
evas_common_cpu_feature_test(evas_common_cpu_vis_test);
-#endif /* __SPARC__ */
evas_common_cpu_end_opt();
+#endif /* __SPARC__ */
}
inline int
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs