Mesa (lp-binning): util: Force ESI register for cpuid's ebx result.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Fri Oct 9 12:25:11 UTC 2009


Module: Mesa
Branch: lp-binning
Commit: 00ffef383c62ca6cd0d5687539dc45fecfbefeec
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=00ffef383c62ca6cd0d5687539dc45fecfbefeec

Author: José Fonseca <jfonseca at vmware.com>
Date:   Fri Oct  9 13:22:42 2009 +0100

util: Force ESI register for cpuid's ebx result.

Fixes a segfault and better code. Unfortunately using an arbitrary
register ("=r") causes the gcc to abort when the code is optimized saying
it can't satisfy the constraint. Setting seems to do the trick.

---

 src/gallium/auxiliary/util/u_cpu_detect.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index 70ce25c..ded361c 100644
--- a/src/gallium/auxiliary/util/u_cpu_detect.c
+++ b/src/gallium/auxiliary/util/u_cpu_detect.c
@@ -346,7 +346,7 @@ cpuid(uint32_t ax, uint32_t *p)
      "cpuid\n\t"
      "xchgl %%ebx, %1"
      : "=a" (p[0]),
-       "=m" (p[1]),
+       "=S" (p[1]),
        "=c" (p[2]),
        "=d" (p[3])
      : "0" (ax)




More information about the mesa-commit mailing list