Revision: 45567
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45567&view=rev
Author:   erikgreenwald
Date:     2011-07-21 21:19:52 +0000 (Thu, 21 Jul 2011)

Log Message:
-----------
ia32 seems to be unhappy about trying to address ebx at all in PIC mode, so 
simplify by completely duplicating the asm section to contain all the 
specialisms

Modified Paths:
--------------
    brlcad/trunk/src/libbu/simd.c

Modified: brlcad/trunk/src/libbu/simd.c
===================================================================
--- brlcad/trunk/src/libbu/simd.c       2011-07-21 21:01:01 UTC (rev 45566)
+++ brlcad/trunk/src/libbu/simd.c       2011-07-21 21:19:52 UTC (rev 45567)
@@ -25,19 +25,13 @@
 bu_simd_level()
 {
 #if defined(__GNUC__) && defined(__SSE__)
-    int b=0, c=0, d=0;
-    asm volatile(
-    /* since we're PIC, we need to stash EBX on ia32 */
+    int c=0, d=0;
 # ifdef __i386__
-                   "pushl %%ebx;"
+    asm volatile("pushl %%ebx;cpuid;popl %%ebx;":"=c"(c),"=d"(d):"a"(0x1));
+# else
+    int b=0; 
+    asm volatile("cpuid":"=b"(b),"=c"(c),"=d"(d):"a"(0x1));
 # endif
-                   "cpuid;"
-# ifdef __i386__
-                   "popl %%ebx;"
-# endif
-                   : "=b"(b), "=c"(c), "=d" (d)
-                   : "a" (0x1));
-
     if(c & 0x100000)
        return BU_SIMD_SSE4_2;
     if(c & 0x080000)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to